comparison lib/libxkbcommon/libxkbcommon.sh @ 272:c6a33cbb38f0

lib/libxkbcommon: initial import, closes #1416
author David Demelier <markand@malikania.fr>
date Fri, 22 Mar 2019 20:00:00 +0100
parents
children 8017138b628e
comparison
equal deleted inserted replaced
271:a90acb3c5272 272:c6a33cbb38f0
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=libxkbcommon
19 PKGVERSION=0.8.4
20 PKGREVISION=1
21 PKGLICENSE="CUSTOM"
22 PKGSUMMARY="keymap handling library"
23 PKGDOWNLOAD="http://xkbcommon.org/download/$PKGNAME-$PKGVERSION.tar.xz"
24 PKGDEPENDS="x11/util-macros:build"
25 PKGOPTIONS="DOXYGEN WAYLAND X"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=gcc}
30 : ${CFLAGS:=-O2}
31 : ${LDFLAGS:=}
32 : ${LIBS:=}
33 : ${DOXYGEN:=yes}
34 : ${X:=yes}
35 : ${WAYLAND:=yes}
36
37 if [ "$DOXYGEN" = "yes" ]; then
38 PKGDEPENDS="dev/doxygen:build $PKGDEPENDS"
39 with_doxygen="--with-doxygen"
40 else
41 with_doxygen="--without-doxygen"
42 fi
43
44 if [ "$X" = "yes" ]; then
45 PKGDEPENDS="x11/libxcb $PKGDEPENDS"
46 with_x="--enable-x11"
47 else
48 with_x="--disable-x11"
49 fi
50
51 if [ "$WAYLAND" = "yes" ]; then
52 PKGDEPENDS="graphics/wayland $PKGDEPENDS"
53 with_wayland="--enable-wayland"
54 else
55 with_wayland="--disable-wayland"
56 fi
57
58 build()
59 {
60 rm -rf $PKGNAME-$PKGVERSION
61 tar xvaf $PKGNAME-$PKGVERSION.tar.xz
62 pushd $PKGNAME-$PKGVERSION
63
64 CC="$CC" \
65 CFLAGS="$CFLAGS" \
66 LDFLAGS="$LDFLAGS" \
67 LIBS="$LIBS" \
68 ./configure \
69 --build=$CBUILD \
70 --host=$CHOST \
71 --prefix=/usr \
72 --disable-static \
73 --enable-shared \
74 $with_doxygen \
75 $with_x \
76 $with_wayland
77 make
78 make install DESTDIR=$DESTDIR
79 rm -f $DESTDIR/usr/lib/libxkbcommon{,-x11}.la
80
81 popd
82 rm -rf $PKGNAME-$PKGVERSION
83 }