comparison audio/sdl2-mixer/sdl2-mixer.sh @ 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
children 0e6c54d47dfb
comparison
equal deleted inserted replaced
760:59f3318533db 761:346bbd98fda6
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 # TODO: add MODPLUG, MP3 (libmad|mpg123) option
19
20 PKGNAME=sdl2-mixer
21 PKGVERSION=2.0.4
22 PKGREVISION=1
23 PKGLICENSE="zlib"
24 PKGSUMMARY="sound addon for SDL2"
25 PKGDOWNLOAD="https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-$PKGVERSION.tar.gz"
26 PKGDEPENDS="lib/sdl2"
27 PKGOPTIONS="FLAC OGG OPUS WAVE"
28
29 : ${CHOST:=$(uname -m)-linux-musl}
30 : ${CBUILD:=$(uname -m)-linux-musl}
31 : ${CC:=clang}
32 : ${CFLAGS:=-O2}
33 : ${LDFLAGS:=}
34 : ${LIBS:=}
35 : ${FLAC:=yes}
36 : ${OGG:=yes}
37 : ${OPUS:=yes}
38 : ${WAVE:=yes}
39
40 if [ "$FLAC" = "yes" ]; then
41 PKGDEPENDS="audio/flac $PKGDEPENDS"
42 with_flac="--enable-music-flac"
43 else
44 with_flac="--disable-music-flac"
45 fi
46
47 if [ "$OPUS" = "yes" ]; then
48 PKGDEPENDS="audio/opus $PKGDEPENDS"
49 with_opus="--enable-music-opus"
50 else
51 with_opus="--disable-music-opus"
52 fi
53
54 if [ "$OGG" = "yes" ]; then
55 PKGDEPENDS="audio/ogg $PKGDEPENDS"
56 with_ogg="--enable-music-ogg"
57 else
58 with_ogg="--disable-music-ogg"
59 fi
60
61 if [ "$WAVE" = "yes" ]; then
62 PKGDEPENDS="audio/wave $PKGDEPENDS"
63 with_wave="--enable-music-wave"
64 else
65 with_wave="--disable-music-wave"
66 fi
67
68 build()
69 {
70 rm -rf SDL2_mixer-$PKGVERSION
71 tar xvf SDL2_mixer-$PKGVERSION.tar.gz
72 cd SDL2_mixer-$PKGVERSION
73
74 CC="$CC" \
75 CFLAGS="$CFLAGS" \
76 LDFLAGS="$LDFLAGS" \
77 LIBS="$LIBS" \
78 ./configure \
79 --build=$CBUILD \
80 --host=$CHOST \
81 --prefix= \
82 $with_flac \
83 $with_opus \
84 $with_ogg \
85 $with_wave
86 make
87 make install DESTDIR=$DESTDIR
88 rm -f $DESTDIR/lib/libSDL2_mixer.la
89
90 cd ..
91 rm -rf SDL2_mixer-$PKGVERSION
92 }