comparison graphics/imlib2/imlib2.sh @ 907:9b4b37e3685f

graphics/imlib2: initial import, closes #2209
author David Demelier <markand@malikania.fr>
date Mon, 26 Aug 2019 20:17:00 +0200
parents
children ddab65a5b3f5
comparison
equal deleted inserted replaced
906:61459eb42b0f 907:9b4b37e3685f
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=imlib2
19 PKGVERSION=1.5.1
20 PKGREVISION=1
21 PKGLICENSE="CUSTOM"
22 PKGSUMMARY="image loading library"
23 PKGDOWNLOAD="https://sourceforge.net/projects/enlightenment/files/imlib2-src/$PKGVERSION/$PKGNAME-$PKGVERSION.tar.bz2"
24 PKGDEPENDS="freetype"
25 PKGOPTIONS="BZIP2 GIF ID3 PNG TIFF X ZLIB"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=clang}
30 : ${CFLAGS:=-O2}
31 : ${LDFLAGS:=}
32 : ${LIBS:=}
33 : ${BZIP2:=yes}
34 : ${GIF:=yes} # TODO: allow "libungif" as optional value
35 : ${ID3:=yes}
36 : ${PNG:=yes}
37 : ${TIFF:=yes}
38 : ${X:=yes}
39 : ${ZLIB:=yes}
40
41 if [ "$BZIP2" = "yes" ]; then
42 PKGDEPENDS="bzip2 $PKGDEPENDS"
43 with_bzip2="--with-bzip2"
44 else
45 with_bzip2="--without-bzip2"
46 fi
47
48 if [ "$GIF" = "yes" ]; then
49 PKGDEPENDS="giflib $PKGDEPENDS"
50 with_gif="--with-gif"
51 else
52 with_gif="--without-gif"
53 fi
54
55 if [ "$ID3" = "yes" ]; then
56 PKGDEPENDS="libid3tag $PKGDEPENDS"
57 with_id3="--with-id3"
58 else
59 with_id3="--without-id3"
60 fi
61
62 if [ "$PNG" = "yes" ]; then
63 PKGDEPENDS="libpng $PKGDEPENDS"
64 with_png="--with-png"
65 else
66 with_png="--without-png"
67 fi
68
69 if [ "$TIFF" = "yes" ]; then
70 PKGDEPENDS="tiff $PKGDEPENDS"
71 with_tiff="--with-tiff"
72 else
73 with_tiff="--without-tiff"
74 fi
75
76 if [ "$X" = "yes" ]; then
77 PKGDEPENDS="libx11 libxext libxcb $PKGDEPENDS"
78 with_x="--with-x"
79 else
80 with_x="--without-x11"
81 fi
82
83 build()
84 {
85 rm -rf $PKGNAME-$PKGVERSION
86 tar xvf $PKGNAME-$PKGVERSION.tar.bz2
87 cd $PKGNAME-$PKGVERSION
88
89 CC="$CC" \
90 CFLAGS="$CFLAGS" \
91 LDFLAGS="$LDFLAGS" \
92 LIBS="$LIBS" \
93 ./configure \
94 --build=$CBUILD \
95 --host=$CHOST \
96 --prefix= \
97 $with_bzip2 \
98 $with_gif \
99 $with_id3 \
100 $with_png \
101 $with_tiff \
102 $with_x \
103 $with_zlib
104 make
105 make install DESTDIR=$DESTDIR
106 find $DESTDIR -type f -name "*.la" -delete
107
108 cd ..
109 rm -rf $PKGNAME-$PKGVERSION
110 }