comparison audio/flac/flac.sh @ 625:ed35d7d01f62

audio/flac: initial import, closes #1702
author David Demelier <markand@malikania.fr>
date Tue, 23 Jul 2019 21:16:00 +0200
parents
children 4ab57189a2b5
comparison
equal deleted inserted replaced
624:608de07347ff 625:ed35d7d01f62
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 PKGNAME=flac
19 PKGVERSION=1.3.2
20 PKGREVISION=1
21 PKGLICENSE="CUSTOM GPLv2 LGPLv21"
22 PKGSUMMARY="free lossless audio codec"
23 PKGDOWNLOAD="http://downloads.xiph.org/releases/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz"
24 PKGDEPENDS=""
25 PKGOPTIONS="DOXYGEN OGG"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=clang}
30 : ${CFLAGS:=-O2}
31 : ${CXX:=clang++}
32 : ${CXXFLAGS:=-O2}
33 : ${LDFLAGS:=}
34 : ${LIBS:=}
35 : ${DOXYGEN:=yes}
36 : ${OGG:=yes}
37
38 if [ "$DOXYGEN" = "yes" ]; then
39 PKGDEPENDS="dev/doxygen:build $PKGDEPENDS"
40 with_doxygen="--enable-doxygen-docs"
41 else
42 with_doxygen="--disable-doxygen-docs"
43 fi
44
45 if [ "$OGG" = "yes" ]; then
46 PKGDEPENDS="audio/libogg $PKGDEPENDS"
47 with_ogg="--enable-ogg"
48 else
49 with_ogg="--disable-ogg"
50 fi
51
52 build()
53 {
54 rm -rf $PKGNAME-$PKGVERSION
55 tar xvf $PKGNAME-$PKGVERSION.tar.xz
56 cd $PKGNAME-$PKGVERSION
57
58 CC="$CC" \
59 CFLAGS="$CFLAGS" \
60 CXX="$CXX" \
61 CXXFLAGS="$CXXFLAGS" \
62 LDFLAGS="$LDFLAGS" \
63 LIBS="$LIBS" \
64 ./configure \
65 --build=$CBUILD \
66 --host=$CHOST \
67 --prefix= \
68 $with_doxygen \
69 $with_ogg
70 make
71 make install DESTDIR=$DESTDIR
72 rm -f $DESTDIR/lib/libFLAC*.la
73
74 cd ..
75 rm -rf $PKGNAME-$PKGVERSION
76 }