Update libxmp, reorganize project structure, add Makefile

This commit is contained in:
Kouya Heika
2026-04-22 19:04:22 -05:00
parent 2db7fe959b
commit 77d02142d3
17 changed files with 42 additions and 57 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
build/
out/

17
Makefile Normal file
View File

@@ -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

View File

@@ -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"

2
libxmp

Submodule libxmp updated: 6ad7a08cbe...301a9c0ae9

View File

@@ -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.

22
libxmp.exported Normal file
View File

@@ -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

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB