comparison bluetooth/bluez/bluez.sh @ 737:24249b89d047

bluetooth/bluez: initial import, closes #1216
author David Demelier <markand@malikania.fr>
date Tue, 06 Aug 2019 20:34:00 +0200
parents
children 0e6c54d47dfb
comparison
equal deleted inserted replaced
736:5c0ac6497f9f 737:24249b89d047
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=bluez
19 PKGVERSION=5.50
20 PKGREVISION=1
21 PKGLICENSE="GPLv2 LGPLv21"
22 PKGSUMMARY="official bluetooth protocol stack for Linux"
23 PKGDOWNLOAD="http://www.kernel.org/pub/linux/bluetooth/$PKGNAME-$PKGVERSION.tar.xz"
24 PKGDEPENDS=""
25 PKGOPTIONS="AUDIO CUPS LEGACY UDEV"
26 PKGPROTECT="etc/bluetooth/main.conf
27 etc/rc.d/bluetooth"
28
29 : ${CHOST:=$(uname -m)-linux-musl}
30 : ${CBUILD:=$(uname -m)-linux-musl}
31 : ${CC:=clang}
32 : ${CFLAGS:=-O2}
33 : ${CXX:=clang++}
34 : ${CXXFLAGS:=-O2}
35 : ${LDFLAGS:=}
36 : ${LIBS:=}
37 : ${AUDIO:=yes}
38 : ${CUPS:=yes}
39 : ${LEGACY:=no}
40 : ${UDEV:=yes}
41
42 if [ "$AUDIO" = "yes" ]; then
43 with_audio="--enable-a2dp"
44 else
45 with_audio="--disable-a2dp"
46 fi
47
48 if [ "$CUPS" = "yes" ]; then
49 with_cups="--enable-cups"
50 else
51 with_cups="--disable-cups"
52 fi
53
54 if [ "$LEGACY" = "yes" ]; then
55 with_legacy="--enable-deprecated"
56 else
57 with_legacy="--disable-deprecated"
58 fi
59
60 if [ "$UDEV" = "yes" ]; then
61 PKGDEPENDS="core/eudev $PKGDEPENDS"
62 with_udev="--enable-udev"
63 else
64 with_udev="--disable-udev"
65 fi
66
67 build()
68 {
69 rm -rf $PKGNAME-$PKGVERSION
70 tar xvf $PKGNAME-$PKGVERSION.tar.xz
71 cd $PKGNAME-$PKGVERSION
72
73 # --enable-library: required by many packages.
74 CC="$CC" \
75 CFLAGS="$CFLAGS" \
76 CXX="$CXX" \
77 CXXFLAGS="$CXXFLAGS" \
78 LDFLAGS="$LDFLAGS" \
79 LIBS="$LIBS" \
80 ./configure \
81 --build=$CBUILD \
82 --host=$CHOST \
83 --prefix= \
84 --disable-systemd \
85 --enable-library \
86 $with_audio \
87 $with_cups \
88 $with_legacy \
89 $with_udev
90 make
91 make install DESTDIR=$DESTDIR
92 rm -f $DESTDIR/lib/libbluetooth.la
93 install -Dm0644 src/main.conf $DESTDIR/etc/bluetooth/main.conf
94 install -Dm0644 ../bluetooth $DESTDIR/etc/rc.d/bluetooth
95
96 cd ..
97 rm -rf $PKGNAME-$PKGVERSION
98 }