Skip to content

Commit

Permalink
gamecube-sdl_mixer: enable modplug support
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterMute committed Mar 25, 2021
1 parent e21cfb8 commit f9dda6c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 6 deletions.
11 changes: 5 additions & 6 deletions gamecube/SDL_mixer/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pkgname=gamecube-sdl_mixer
pkgver=1.2.12
pkgrel=1
pkgrel=2
pkgdesc="A sample multi-channel audio mixer library (Nintendo Gamecube/Wii port)"
arch=('any')
url="https://libsdl.org"
Expand All @@ -14,6 +14,7 @@ depends=(
'ppc-libvorbis'
'ppc-libogg'
'ppc-libmad'
'ppc-libmodplug'
)
groups=('gamecube-portlibs' 'gamecube-sdl-libs')

Expand All @@ -24,7 +25,7 @@ makedepends=(
source=("${url}/projects/SDL_mixer/release/SDL_mixer-${pkgver}.tar.gz" "SDL_mixer-1.2.12.patch")
sha256sums=(
'1644308279a975799049e4826af2cfc787cad2abb11aa14562e402521f86992a'
'3ad77d7ea3468992be2cc7d5e1bbcfd142866a72aa5cb8c9f58218da97420578'
'fb64421673349aeefe8071e6aad0b1d69345bff9227ba5dfb9ba077c9acb7312'
)

build() {
Expand All @@ -34,15 +35,13 @@ build() {

patch -p1 -i $srcdir/SDL_mixer-1.2.12.patch

sed -i 's,\$(objects)/playwave\$(EXE) \$(objects)/playmus\$(EXE),,g' Makefile.in

./autogen.sh

LIBS="-lvorbis -logg -lm" ./configure --prefix="${PORTLIBS_PREFIX}" --host=powerpc-eabi \
--disable-shared --enable-static \
--enable-music-ogg \
--disable-music-cmd \
--disable-music-mod \
--enable-music-mod-modplug \
--enable-music-mp3-mad-gpl

make
Expand All @@ -56,7 +55,7 @@ package() {
make DESTDIR="$pkgdir" install

# add our static libs
echo "Requires.private: mad vorbisfile vorbis ogg" >> "${pkgdir}/${PORTLIBS_PREFIX}/lib/pkgconfig/SDL_mixer.pc"
echo "Requires.private: libmodplug mad vorbisfile vorbis ogg" >> "${pkgdir}/${PORTLIBS_PREFIX}/lib/pkgconfig/SDL_mixer.pc"


}
70 changes: 70 additions & 0 deletions gamecube/SDL_mixer/SDL_mixer-1.2.12.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
diff --git a/Makefile.in b/Makefile.in
index 3d10565..833ef35 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -47,7 +47,7 @@ LT_RELEASE = @LT_RELEASE@
LT_REVISION = @LT_REVISION@
LT_LDFLAGS = -no-undefined -rpath $(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)

-all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/playwave$(EXE) $(objects)/playmus$(EXE)
+all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET)

$(srcdir)/configure: $(srcdir)/configure.in
@echo "Warning, configure.in is out of date"
@@ -60,18 +60,12 @@ Makefile: $(srcdir)/Makefile.in
$(objects):
$(SHELL) $(auxdir)/mkinstalldirs $@

-.PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
+.PHONY: all install install-hdrs install-lib uninstall uninstall-hdrs uninstall-lib clean distclean dist

$(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)

-$(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
-
-$(objects)/playmus$(EXE): $(objects)/playmus.lo $(objects)/$(TARGET)
- $(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playmus.lo $(SDL_CFLAGS) $(SDL_LIBS) $(objects)/$(TARGET)
-
-install: all install-hdrs install-lib #install-bin
+install: all install-hdrs install-lib
install-hdrs:
$(SHELL) $(auxdir)/mkinstalldirs $(includedir)/SDL
for src in $(srcdir)/SDL_mixer.h; do \
@@ -83,12 +77,8 @@ install-hdrs:
install-lib: $(objects) $(objects)/$(TARGET)
$(SHELL) $(auxdir)/mkinstalldirs $(libdir)
$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET)
-install-bin:
- $(SHELL) $(auxdir)/mkinstalldirs $(bindir)
- $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playwave$(EXE) $(bindir)/playwave$(EXE)
- $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(objects)/playmus$(EXE) $(bindir)/playmus$(EXE)

-uninstall: uninstall-hdrs uninstall-lib uninstall-bin
+uninstall: uninstall-hdrs uninstall-lib
uninstall-hdrs:
for src in $(srcdir)/SDL_mixer.h; do \
file=`echo $$src | sed -e 's|^.*/||'`; \
@@ -99,9 +89,6 @@ uninstall-hdrs:
-rmdir $(libdir)/pkgconfig
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET)
-uninstall-bin:
- rm -f $(bindir)/playwave$(EXE)
- rm -f $(bindir)/playmus$(EXE)

clean:
rm -rf $(objects)
diff --git a/load_ogg.c b/load_ogg.c
index 2d0ee65..1e94fa6 100644
--- a/load_ogg.c
Expand All @@ -23,6 +81,18 @@ index 2d0ee65..1e94fa6 100644
#endif
{
if (read == OV_HOLE || read == OV_EBADLINK)
diff --git a/music_modplug.h b/music_modplug.h
index 92cbafd..555227b 100644
--- a/music_modplug.h
+++ b/music_modplug.h
@@ -1,6 +1,6 @@
#ifdef MODPLUG_MUSIC

-#include "modplug.h"
+#include <libmodplug/modplug.h>
#include "SDL_rwops.h"
#include "SDL_audio.h"
#include "SDL_mixer.h"
diff --git a/music_ogg.c b/music_ogg.c
index 18a094b..269a197 100644
--- a/music_ogg.c
Expand Down

0 comments on commit f9dda6c

Please sign in to comment.