Mercurial > vanilla
comparison graphics/libgd/libgd.sh @ 363:acf210415c64
graphics/libgd: initial import, closes #1479
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 30 Mar 2019 08:57:22 +0100 |
parents | |
children | 7828241c9634 |
comparison
equal
deleted
inserted
replaced
362:712440df2f79 | 363:acf210415c64 |
---|---|
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=libgd | |
19 PKGVERSION=2.2.5 | |
20 PKGREVISION=1 | |
21 PKGLICENSE="CUSTOM" | |
22 PKGSUMMARY="library for the dynamic creation of images" | |
23 PKGDOWNLOAD="https://github.com/libgd/libgd/releases/download/gd-$PKGVERSION/$PKGNAME-$PKGVERSION.tar.xz" | |
24 PKGOPTIONS="FONTCONFIG FREETYPE JPEG LIQ PNG TIFF WEBP X ZLIB" | |
25 | |
26 : ${CHOST:=$(uname -m)-linux-musl} | |
27 : ${CBUILD:=$(uname -m)-linux-musl} | |
28 : ${CC:=gcc} | |
29 : ${CFLAGS:=-O2} | |
30 : ${LDFLAGS:=} | |
31 : ${LIBS:=} | |
32 : ${FONTCONFIG:=no} | |
33 : ${FREETYPE:=no} | |
34 : ${JPEG:=yes} | |
35 : ${LIQ:=no} | |
36 : ${PNG:=yes} | |
37 : ${TIFF:=no} | |
38 : ${WEBP:=no} | |
39 : ${X:=no} | |
40 : ${ZLIB:=no} | |
41 | |
42 if [ "$FONTCONFIG" = "yes" ]; then | |
43 PKGDEPENDS="fonts/fontconfig $PKGDEPENDS" | |
44 with_fontconfig="--with-fontconfig" | |
45 else | |
46 with_fontconfig="--without-fontconfig" | |
47 fi | |
48 | |
49 if [ "$FREETYPE" = "yes" ]; then | |
50 PKGDEPENDS="fonts/freetype $PKGDEPENDS" | |
51 with_freetype="--with-freetype" | |
52 else | |
53 with_freetype="--without-freetype" | |
54 fi | |
55 | |
56 if [ "$JPEG" = "yes" ]; then | |
57 PKGDEPENDS="graphics/libjpeg-turbo $PKGDEPENDS" | |
58 with_jpeg="--with-jpeg" | |
59 else | |
60 with_jpeg="--without-jpeg" | |
61 fi | |
62 | |
63 if [ "$LIQ" = "yes" ]; then | |
64 PKGDEPENDS="graphics/libimagequant $PKGDEPENDS" | |
65 with_liq="--with-liq" | |
66 else | |
67 with_liq="--without-liq" | |
68 fi | |
69 | |
70 if [ "$PNG" = "yes" ]; then | |
71 PKGDEPENDS="graphics/libpng $PKGDEPENDS" | |
72 with_png="--with-png" | |
73 else | |
74 with_png="--without-png" | |
75 fi | |
76 | |
77 if [ "$TIFF" = "yes" ]; then | |
78 PKGDEPENDS="graphics/libtiff $PKGDEPENDS" | |
79 with_tiff="--with-tiff" | |
80 else | |
81 with_tiff="--without-tiff" | |
82 fi | |
83 | |
84 if [ "$WEBP" = "yes" ]; then | |
85 PKGDEPENDS="graphics/webp $PKGDEPENDS" | |
86 with_webp="--with-webp" | |
87 else | |
88 with_webp="--without-webp" | |
89 fi | |
90 | |
91 if [ "$X" = "yes" ]; then | |
92 PKGDEPENDS="x11/libxpm $PKGDEPENDS" | |
93 with_x="--with-xpm --with-x" | |
94 else | |
95 with_x="--without-xpm --without-x" | |
96 fi | |
97 | |
98 if [ "$ZLIB" = "yes" ]; then | |
99 PKGDEPENDS="lib/zlib $PKGDEPENDS" | |
100 with_zlib="--with-zlib" | |
101 else | |
102 with_zlib="--without-zlib" | |
103 fi | |
104 | |
105 build() | |
106 { | |
107 rm -rf $PKGNAME-$PKGVERSION | |
108 tar xvaf $PKGNAME-$PKGVERSION.tar.xz | |
109 pushd $PKGNAME-$PKGVERSION | |
110 | |
111 CC="$CC" \ | |
112 CFLAGS="$CFLAGS" \ | |
113 LDFLAGS="$LDFLAGS" \ | |
114 LIBS="$LIBS" \ | |
115 ./configure \ | |
116 --build=$CBUILD \ | |
117 --host=$CHOST \ | |
118 --prefix=/usr \ | |
119 --disable-static \ | |
120 --enable-shared \ | |
121 $with_fontconfig \ | |
122 $with_freetype \ | |
123 $with_jpeg \ | |
124 $with_liq \ | |
125 $with_png \ | |
126 $with_tiff \ | |
127 $with_webp \ | |
128 $with_x \ | |
129 $with_zlib | |
130 make | |
131 make install DESTDIR=$DESTDIR | |
132 rm -f $DESTDIR/usr/lib/libgd.la | |
133 | |
134 popd | |
135 rm -rf $PKGNAME-$PKGVERSION | |
136 } |