diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c0160d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +out/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c7cf565 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +EMHOME = /usr/lib/emscripten + +.PHONY: libxmp + +libxmp: + mkdir -p build + ${EMHOME}/emcmake cmake -B build libxmp + ${EMHOME}/emmake make -C build + ${EMHOME}/emcc -O3 build/libxmp.a -o build/libxmp.js -s WASM=1 -s EXPORTED_FUNCTIONS=@libxmp.exported -s EXPORT_ALL=1 -s BINARYEN_METHOD="native-wasm" -s EXPORTED_RUNTIME_METHODS='["cwrap","UTF8ToString","HEAPU8","HEAPF32","HEAP16"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s JSPI=1 -s EXPORT_NAME='libxmp' -s ENVIRONMENT='web,worker' -s SINGLE_FILE=0 + +build: libxmp + +package: + mkdir -p out + zip -D -j out/WAXMPlayer.xpi src/* build/libxmp.js build/libxmp.wasm + +all: build package \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index d3d060b..0000000 --- a/build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# Change this if it differs -EMHOME=${EMHOME:=/usr/lib/emscripten/} - -cd libxmp -mkdir -p build -cd build -echo "_malloc -_free -_xmp_create_context -_xmp_free_context -_xmp_load_module -_xmp_release_module -_xmp_play_buffer -_xmp_play_frame -_xmp_get_format_list -_xmp_get_module_info -_xmp_set_player -_xmp_get_player -_xmp_get_frame_info -_xmp_start_player -_xmp_end_player -_xmp_restart_module -_xmp_seek_time -_xmp_channel_mute -_xmp_channel_vol -_xmp_inject_event -_xmp_test_module_from_memory -_xmp_load_module_from_memory" > exported.txt -$EMHOME/emcmake cmake .. -$EMHOME/emmake make -j4 -$EMHOME/emcc -O3 libxmp.a -o libxmp.js -s WASM=1 -s EXPORTED_FUNCTIONS=@exported.txt -s EXPORT_ALL=1 -s BINARYEN_METHOD="native-wasm" -s EXPORTED_RUNTIME_METHODS='["cwrap","UTF8ToString","HEAPU8","HEAPF32","HEAP16"]' -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s JSPI=1 -s EXPORT_NAME='libxmp' -s ENVIRONMENT='web,worker' -s SINGLE_FILE=0 -cd .. -cd .. -cp libxmp/build/libxmp.js libxmp/build/libxmp.wasm . -zip -r waxmplayer.xpi . -x "libxmp/*" "waxmplayer.xpi" \ No newline at end of file diff --git a/libxmp b/libxmp index 6ad7a08..301a9c0 160000 --- a/libxmp +++ b/libxmp @@ -1 +1 @@ -Subproject commit 6ad7a08cbeefbc9c761d1a9b5d48c75c80b04511 +Subproject commit 301a9c0ae9dcdde7dd5ec336ad497e228fb52568 diff --git a/libxmp.LICENSE b/libxmp.LICENSE deleted file mode 100644 index 7fc3345..0000000 --- a/libxmp.LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Extended Module Player -Copyright (C) 1996-2026 Claudio Matsuoka and Hipolito Carraro Jr - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/libxmp.exported b/libxmp.exported new file mode 100644 index 0000000..4293117 --- /dev/null +++ b/libxmp.exported @@ -0,0 +1,22 @@ +_malloc +_free +_xmp_create_context +_xmp_free_context +_xmp_load_module +_xmp_release_module +_xmp_play_buffer +_xmp_play_frame +_xmp_get_format_list +_xmp_get_module_info +_xmp_set_player +_xmp_get_player +_xmp_get_frame_info +_xmp_start_player +_xmp_end_player +_xmp_restart_module +_xmp_seek_time +_xmp_channel_mute +_xmp_channel_vol +_xmp_inject_event +_xmp_test_module_from_memory +_xmp_load_module_from_memory \ No newline at end of file diff --git a/FT2.ttf b/src/FT2.ttf similarity index 100% rename from FT2.ttf rename to src/FT2.ttf diff --git a/FT2.woff b/src/FT2.woff similarity index 100% rename from FT2.woff rename to src/FT2.woff diff --git a/background.js b/src/background.js similarity index 100% rename from background.js rename to src/background.js diff --git a/icon-48.png b/src/icon-48.png similarity index 100% rename from icon-48.png rename to src/icon-48.png diff --git a/icon-96.png b/src/icon-96.png similarity index 100% rename from icon-96.png rename to src/icon-96.png diff --git a/manifest.json b/src/manifest.json similarity index 100% rename from manifest.json rename to src/manifest.json diff --git a/player.css b/src/player.css similarity index 100% rename from player.css rename to src/player.css diff --git a/player.html b/src/player.html similarity index 100% rename from player.html rename to src/player.html diff --git a/player.js b/src/player.js similarity index 100% rename from player.js rename to src/player.js diff --git a/stereo.png b/src/stereo.png similarity index 100% rename from stereo.png rename to src/stereo.png diff --git a/volume.png b/src/volume.png similarity index 100% rename from volume.png rename to src/volume.png