changeset 761:346bbd98fda6

audio/sdl2-mixer: initial import, closes #1005
author David Demelier <markand@malikania.fr>
date Thu, 08 Aug 2019 20:33:00 +0200
parents 59f3318533db
children c5aee53e506f
files audio/sdl2-mixer/sdl2-mixer.sh audio/sdl2-mixer/sdl2-mixer.sha1
diffstat 2 files changed, 93 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/sdl2-mixer/sdl2-mixer.sh	Thu Aug 08 20:33:00 2019 +0200
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+# TODO: add MODPLUG, MP3 (libmad|mpg123) option
+
+PKGNAME=sdl2-mixer
+PKGVERSION=2.0.4
+PKGREVISION=1
+PKGLICENSE="zlib"
+PKGSUMMARY="sound addon for SDL2"
+PKGDOWNLOAD="https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-$PKGVERSION.tar.gz"
+PKGDEPENDS="lib/sdl2"
+PKGOPTIONS="FLAC OGG OPUS WAVE"
+
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=clang}
+: ${CFLAGS:=-O2}
+: ${LDFLAGS:=}
+: ${LIBS:=}
+: ${FLAC:=yes}
+: ${OGG:=yes}
+: ${OPUS:=yes}
+: ${WAVE:=yes}
+
+if [ "$FLAC" = "yes" ]; then
+	PKGDEPENDS="audio/flac $PKGDEPENDS"
+	with_flac="--enable-music-flac"
+else
+	with_flac="--disable-music-flac"
+fi
+
+if [ "$OPUS" = "yes" ]; then
+	PKGDEPENDS="audio/opus $PKGDEPENDS"
+	with_opus="--enable-music-opus"
+else
+	with_opus="--disable-music-opus"
+fi
+
+if [ "$OGG" = "yes" ]; then
+	PKGDEPENDS="audio/ogg $PKGDEPENDS"
+	with_ogg="--enable-music-ogg"
+else
+	with_ogg="--disable-music-ogg"
+fi
+
+if [ "$WAVE" = "yes" ]; then
+	PKGDEPENDS="audio/wave $PKGDEPENDS"
+	with_wave="--enable-music-wave"
+else
+	with_wave="--disable-music-wave"
+fi
+
+build()
+{
+	rm -rf SDL2_mixer-$PKGVERSION
+	tar xvf SDL2_mixer-$PKGVERSION.tar.gz
+	cd SDL2_mixer-$PKGVERSION
+
+	CC="$CC" \
+	CFLAGS="$CFLAGS" \
+	LDFLAGS="$LDFLAGS" \
+	LIBS="$LIBS" \
+	./configure \
+		--build=$CBUILD \
+		--host=$CHOST \
+		--prefix= \
+		$with_flac \
+		$with_opus \
+		$with_ogg \
+		$with_wave
+	make
+	make install DESTDIR=$DESTDIR
+	rm -f $DESTDIR/lib/libSDL2_mixer.la
+
+	cd ..
+	rm -rf SDL2_mixer-$PKGVERSION
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/sdl2-mixer/sdl2-mixer.sha1	Thu Aug 08 20:33:00 2019 +0200
@@ -0,0 +1,1 @@
+242a63b1c7f38e358e94b1e0dc5120a6c1f3763b  SDL2_mixer-2.0.4.tar.gz