comparison fonts/harfbuzz/harfbuzz.sh @ 330:8e39eda94c46

fonts/harfbuzz: initial import, closes #1425
author David Demelier <markand@malikania.fr>
date Wed, 27 Mar 2019 20:10:00 +0100
parents
children ebca5f1df2e4
comparison
equal deleted inserted replaced
329:1856eb00ac7a 330:8e39eda94c46
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=harfbuzz
19 PKGVERSION=2.3.1
20 PKGREVISION=1
21 PKGLICENSE="MIT"
22 PKGSUMMARY="OpenType text shaping engine"
23 PKGDOWNLOAD="https://www.freedesktop.org/software/$PKGNAME/release/$PKGNAME-$PKGVERSION.tar.bz2"
24 PKGOPTIONS="CAIRO FONTCONFIG FREETYPE GLIB ICU"
25
26 : ${CHOST:=$(uname -m)-linux-musl}
27 : ${CBUILD:=$(uname -m)-linux-musl}
28 : ${CC:=gcc}
29 : ${CFLAGS:=-O2}
30 : ${CXX:=g++}
31 : ${CXXFLAGS:=-O2}
32 : ${LDFLAGS:=}
33 : ${LIBS:=}
34 : ${CAIRO:=yes}
35 : ${FONTCONFIG:=yes}
36 : ${FREETYPE:=yes}
37 : ${GLIB:=yes}
38 : ${ICU:=yes}
39
40 if [ "$CAIRO" = "yes" ]; then
41 PKGDEPENDS="graphics/cairo $PKGDEPENDS"
42 with_cairo="--with-cairo"
43 else
44 with_cairo="--without-cairo"
45 fi
46
47 if [ "$FONTCONFIG" = "yes" ]; then
48 PKGDEPENDS="fonts/fontconfig $PKGDEPENDS"
49 with_fontconfig="--with-fontconfig"
50 else
51 with_fontconfig="--without-fontconfig"
52 fi
53
54 if [ "$FREETYPE" = "yes" ]; then
55 PKGDEPENDS="fonts/freetype $PKGDEPENDS"
56 with_freetype="--with-freetype"
57 else
58 with_freetype="--without-freetype"
59 fi
60
61 if [ "$GLIB" = "yes" ]; then
62 PKGDEPENDS="lib/glib $PKGDEPENDS"
63 with_glib="--with-glib --with-gobject"
64 else
65 with_glib="--without-glib --without-gobject"
66 fi
67
68 if [ "$ICU" = "yes" ]; then
69 PKGDEPENDS="lib/icu $PKGDEPENDS"
70 with_icu="--with-icu"
71 else
72 with_icu="--without-icu"
73 fi
74
75 build()
76 {
77 rm -rf $PKGNAME-$PKGVERSION
78 tar xvaf $PKGNAME-$PKGVERSION.tar.bz2
79 pushd $PKGNAME-$PKGVERSION
80
81 CC="$CC" \
82 CFLAGS="$CFLAGS" \
83 CXX="$CXX" \
84 CXXFLAGS="$CXXFLAGS" \
85 LDFLAGS="$LDFLAGS" \
86 LIBS="$LIBS" \
87 ./configure \
88 --build=$CBUILD \
89 --host=$CHOST \
90 --prefix=/usr \
91 $with_cairo \
92 $with_fontconfig \
93 $with_freetype \
94 $with_glib \
95 $with_icu
96 make
97 make install DESTDIR=$DESTDIR
98 rm -f $DESTDIR/usr/lib/libharfbuzz{-gobject,-subset}.la
99
100 popd
101 rm -rf $PKGNAME-$PKGVERSION
102 }