comparison graphics/sdl2-image/sdl2-image.sh @ 762:c5aee53e506f

graphics/sdl2-image: initial import, closes #1002
author David Demelier <markand@malikania.fr>
date Thu, 08 Aug 2019 20:40:00 +0200
parents
children 0e6c54d47dfb
comparison
equal deleted inserted replaced
761:346bbd98fda6 762:c5aee53e506f
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=sdl2-image
19 PKGVERSION=2.0.5
20 PKGREVISION=1
21 PKGLICENSE="zlib"
22 PKGSUMMARY="image addon for SDL2"
23 PKGDOWNLOAD="https://www.libsdl.org/projects/SDL_image/release/SDL2_image-$PKGVERSION.tar.gz"
24 PKGDEPENDS="lib/sdl2"
25 PKGOPTIONS="BMP
26 GIF
27 JPEG
28 LBM
29 PCX
30 PNG
31 PNM
32 SVG
33 TGA
34 TIFF
35 WEBP
36 XCF
37 XPM
38 XV"
39
40 : ${CHOST:=$(uname -m)-linux-musl}
41 : ${CBUILD:=$(uname -m)-linux-musl}
42 : ${CC:=clang}
43 : ${CFLAGS:=-O2}
44 : ${LDFLAGS:=}
45 : ${LIBS:=}
46 : ${BMP:=yes}
47 : ${GIF:=yes}
48 : ${JPEG:=yes}
49 : ${LBM:=yes}
50 : ${PCX:=yes}
51 : ${PNG:=yes}
52 : ${PNM:=yes}
53 : ${SVG:=yes}
54 : ${TGA:=yes}
55 : ${TIFF:=yes}
56 : ${WEBP:=yes}
57 : ${XCF:=yes}
58 : ${XPM:=yes}
59 : ${XV:=yes}
60
61 if [ "$BMP" = "yes" ]; then
62 with_bmp="--enable-bmp"
63 else
64 with_bmp="--disable-bmp"
65 fi
66
67 if [ "$GIF" = "yes" ]; then
68 with_gif="--enable-gif"
69 else
70 with_gif="--disable-gif"
71 fi
72
73 if [ "$JPEG" = "yes" ]; then
74 PKGDEPENDS="graphics/libjpeg-turbo $PKGDEPENDS"
75 with_jpeg="--enable-jpg"
76 else
77 with_jpeg="--disable-jpg"
78 fi
79
80 if [ "$LBM" = "yes" ]; then
81 with_lbm="--enable-lbm"
82 else
83 with_lbm="--disable-lbm"
84 fi
85
86 if [ "$PCX" = "yes" ]; then
87 with_pcx="--enable-pcx"
88 else
89 with_pcx="--disable-pcx"
90 fi
91
92 if [ "$PNG" = "yes" ]; then
93 with_png="--enable-png"
94 else
95 with_png="--disable-png"
96 fi
97
98 if [ "$PNM" = "yes" ]; then
99 with_pnm="--enable-pnm"
100 else
101 with_pnm="--disable-pnm"
102 fi
103
104 if [ "$SVG" = "yes" ]; then
105 with_svg="--enable-svg"
106 else
107 with_svg="--disable-svg"
108 fi
109
110 if [ "$TGA" = "yes" ]; then
111 with_tga="--enable-tga"
112 else
113 with_tga="--disable-tga"
114 fi
115
116 if [ "$TIFF" = "yes" ]; then
117 PKGDEPENDS="graphics/libtiff $PKGDEPENDS"
118 with_tiff="--enable-tif"
119 else
120 with_tiff="--disable-tif"
121 fi
122
123 if [ "$XCF" = "yes" ]; then
124 with_xcf="--enable-xcf"
125 else
126 with_xcf="--disable-xcf"
127 fi
128
129 if [ "$XPM" = "yes" ]; then
130 with_xpm="--enable-xpm"
131 else
132 with_xpm="--disable-xpm"
133 fi
134
135 if [ "$XV" = "yes" ]; then
136 with_xv="--enable-xv"
137 else
138 with_xv="--disable-xv"
139 fi
140
141 if [ "$WEBP" = "yes" ]; then
142 PKGDEPENDS="graphics/libwebp $PKGDEPENDS"
143 with_webp="--enable-webp"
144 else
145 with_webp="--disable-webp"
146 fi
147
148 build()
149 {
150 rm -rf SDL2_image-$PKGVERSION
151 tar xvf SDL2_image-$PKGVERSION.tar.gz
152 cd SDL2_image-$PKGVERSION
153
154 CC="$CC" \
155 CFLAGS="$CFLAGS" \
156 LDFLAGS="$LDFLAGS" \
157 LIBS="$LIBS" \
158 ./configure \
159 --build=$CBUILD \
160 --host=$CHOST \
161 --prefix= \
162 $with_bmp \
163 $with_gif \
164 $with_jpeg \
165 $with_lbm \
166 $with_pcx \
167 $with_png \
168 $with_pnm \
169 $with_svg \
170 $with_tga \
171 $with_tiff \
172 $with_webp \
173 $with_xcf \
174 $with_xpm \
175 $with_xv
176 make
177 make install DESTDIR=$DESTDIR
178 rm -f $DESTDIR/lib/libSDL2_image.la
179
180 cd ..
181 rm -rf SDL2_image-$PKGVERSION
182 }