diff --git a/.gitignore b/.gitignore index fb1e5d2..ea6f258 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ build* subprojects/*/ .cache compile_commands.json -!subprojects/SDL-Mixer-X/ \ No newline at end of file +!subprojects/SDL-Mixer-X/ +!subprojects/jsoncpp/ +.flatpak-builder +flatpak-repo +*.flatpak diff --git a/.gitmodules b/.gitmodules index 2fd0a96..b9d247f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "subprojects/SDL-Mixer-X"] path = subprojects/SDL-Mixer-X url = https://github.com/WohlSoft/SDL-Mixer-X.git +[submodule "subprojects/jsoncpp"] + path = subprojects/jsoncpp + url = https://github.com/open-source-parsers/jsoncpp diff --git a/assets/neko-player.desktop b/assets/neko-player.desktop new file mode 100755 index 0000000..c4996e7 --- /dev/null +++ b/assets/neko-player.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Neko Player +Comment=An audio player that can properly loop audio files +GenericName=Looping audio player +Exec=neko-player +Icon=neko-player +Categories=Audio;AudioVideo; diff --git a/com.experimentalcraft.NekoPlayer.yml b/com.experimentalcraft.NekoPlayer.yml new file mode 100644 index 0000000..6fa4afb --- /dev/null +++ b/com.experimentalcraft.NekoPlayer.yml @@ -0,0 +1,31 @@ +app-id: com.experimentalcraft.NekoPlayer +runtime: org.freedesktop.Platform +runtime-version: '22.08' +sdk: org.freedesktop.Sdk +sdk-extensions: + - org.freedesktop.Platform.GL.default +command: neko-player +rename-desktop-file: neko-player.desktop +rename-icon: neko-player +modules: + - name: soundtouch + buildsystem: cmake + sources: + - type: git + url: https://codeberg.org/soundtouch/soundtouch.git + tag: 2.3.2 + - name: player + buildsystem: meson + builddir: build-flatpak + build-options: + - --buildtype release + sources: + - type: git + path: .git + branch: main +finish-args: + - --share=ipc + - --socket=x11 + - --socket=pulseaudio + - --device=dri + - --filesystem=xdg-music diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..d74759f --- /dev/null +++ b/install.sh @@ -0,0 +1,3 @@ +#!/bin/sh +./build-file.sh +flatpak install --reinstall -y --user --noninteractive ./neko-player.flatpak diff --git a/meson.build b/meson.build index 64cce15..fd84870 100644 --- a/meson.build +++ b/meson.build @@ -18,7 +18,7 @@ deps = [ dependency('sdl2'), dependency('SDL2_image'), dependency('gl'), - dependency('jsoncpp'), + subproject('jsoncpp').get_variable('jsoncpp_dep'), dependency('soundtouch'), #raudio_dep, smx_subproj.dependency('SDL2_mixer_ext_Static'), @@ -46,8 +46,9 @@ include_dirs = [ ] res = run_command('./assets/update-assets.sh', check: true) - -exe = executable('player', srcs, +install_data('assets/icon.svg', rename: 'neko-player.svg', install_dir: 'share/icons/hicolor/scalable/apps/') +install_data('assets/neko-player.desktop', install_dir: 'share/applications') +exe = executable('neko-player', srcs, dependencies: deps, include_directories: include_dirs, install : true) diff --git a/subprojects/jsoncpp b/subprojects/jsoncpp new file mode 160000 index 0000000..5defb4e --- /dev/null +++ b/subprojects/jsoncpp @@ -0,0 +1 @@ +Subproject commit 5defb4ed1a4293b8e2bf641e16b156fb9de498cc diff --git a/subprojects/jsoncpp.wrap b/subprojects/jsoncpp.wrap deleted file mode 100644 index ee3eb2e..0000000 --- a/subprojects/jsoncpp.wrap +++ /dev/null @@ -1,9 +0,0 @@ -[wrap-file] -directory = jsoncpp-1.9.5 -source_url = https://github.com/open-source-parsers/jsoncpp/archive/1.9.5.tar.gz -source_filename = jsoncpp-1.9.5.tar.gz -source_hash = f409856e5920c18d0c2fb85276e24ee607d2a09b5e7d5f0a371368903c275da2 - -[provide] -jsoncpp = jsoncpp_dep - diff --git a/subprojects/sdl2.wrap b/subprojects/sdl2.wrap deleted file mode 100644 index ad9a15b..0000000 --- a/subprojects/sdl2.wrap +++ /dev/null @@ -1,15 +0,0 @@ -[wrap-file] -directory = SDL2-2.26.5 -source_url = https://github.com/libsdl-org/SDL/releases/download/release-2.26.5/SDL2-2.26.5.tar.gz -source_filename = SDL2-2.26.5.tar.gz -source_hash = ad8fea3da1be64c83c45b1d363a6b4ba8fd60f5bde3b23ec73855709ec5eabf7 -patch_filename = sdl2_2.26.5-5_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/sdl2_2.26.5-5/get_patch -patch_hash = 4d8d3ae534c326f27b2d97616fdfa7cce41bd0333c7d9683dd8ae39d4ad70e6a -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sdl2_2.26.5-5/SDL2-2.26.5.tar.gz -wrapdb_version = 2.26.5-5 - -[provide] -sdl2 = sdl2_dep -sdl2main = sdl2main_dep -sdl2_test = sdl2_test_dep diff --git a/subprojects/sdl2_image.wrap b/subprojects/sdl2_image.wrap deleted file mode 100644 index e7b690c..0000000 --- a/subprojects/sdl2_image.wrap +++ /dev/null @@ -1,13 +0,0 @@ -[wrap-file] -directory = SDL2_image-2.6.3 -source_url = https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.6.3.tar.gz -source_filename = SDL2_image-2.6.3.tar.gz -source_hash = 931c9be5bf1d7c8fae9b7dc157828b7eee874e23c7f24b44ba7eff6b4836312c -patch_filename = sdl2_image_2.6.3-2_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/sdl2_image_2.6.3-2/get_patch -patch_hash = 1741274f30b5b88299b2588a498a54a4203861ec1fa64c3bf99b359a6b618354 -source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sdl2_image_2.6.3-2/SDL2_image-2.6.3.tar.gz -wrapdb_version = 2.6.3-2 - -[provide] -sdl2_image = sdl2_image_dep