annotate audio/libsamplerate/libsamplerate.sh @ 981:1cf16fcd751c

kde/kemoticons: initial import, closes #1806
author David Demelier <markand@malikania.fr>
date Wed, 28 Aug 2019 13:01:17 +0200
parents becf32eef32a
children ddab65a5b3f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
913
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 #!/bin/sh
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 #
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 #
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 # Permission to use, copy, modify, and/or distribute this software for any
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 # purpose with or without fee is hereby granted, provided that the above
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 # copyright notice and this permission notice appear in all copies.
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 #
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 #
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
17
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
18 # TODO: add option for fftw
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
19
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
20 PKGNAME=libsamplerate
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
21 PKGVERSION=0.1.9
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 PKGREVISION=1
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
23 PKGLICENSE="BSD2CLAUSE"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 PKGSUMMARY="library for performing sample rate conversion of audio data"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
25 PKGDOWNLOAD="http://www.mega-nerd.com/SRC/$PKGNAME-$PKGVERSION.tar.gz"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
26 PKGDEPENDS="alsa-lib"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
27 PKGOPTIONS="SNDFILE"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
28
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
29 : ${CHOST:=$(uname -m)-linux-musl}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
30 : ${CBUILD:=$(uname -m)-linux-musl}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
31 : ${CC:=clang}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 : ${CFLAGS:=-O2}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
33 : ${CXX:=clang++}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
34 : ${CXXFLAGS:=-O2}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
35 : ${LDFLAGS:=}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
36 : ${LIBS:=}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
37 : ${SNDFILE:=yes}
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
38
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
39 if [ "$SNDFILE" = "yes" ]; then
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
40 PKGDEPENDS="sndfile $PKGDEPENDS"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
41 with_sndfile="--enable-sndfile"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
42 else
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
43 with_sndfile="--disable-sndfile"
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
44 fi
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
45
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
46 build()
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
47 {
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
48 rm -rf $PKGNAME-$PKGVERSION
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
49 tar xvf $PKGNAME-$PKGVERSION.tar.gz
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
50 cd $PKGNAME-$PKGVERSION
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
51
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
52 patch -p0 < ../patch-fhs.patch
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
53 autoreconf -vif
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
54 CC="$CC" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
55 CFLAGS="$CFLAGS" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
56 CXX="$CXX" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
57 CXXFLAGS="$CXXFLAGS" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
58 LDFLAGS="$LDFLAGS" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
59 LIBS="$LIBS" \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
60 ./configure \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
61 --build=$CBUILD \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
62 --host=$CHOST \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
63 --prefix= \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
64 --docdir=/share/doc/$PKGNAME \
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
65 $with_sndfile
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
66 make
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
67 make install DESTDIR=$DESTDIR
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
68 find $DESTDIR -type f -name "*.la" -delete
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
69
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
70 cd ..
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
71 rm -rf $PKGNAME-$PKGVERSION
becf32eef32a audio/libsamplerate: initial import, closes #2219
David Demelier <markand@malikania.fr>
parents:
diff changeset
72 }