comparison graphics/gdk-pixbuf/gdk-pixbuf.sh @ 341:6f213a600195

graphics/gdk-pixbuf: initial import, closes #1431
author David Demelier <markand@malikania.fr>
date Wed, 27 Mar 2019 20:38:00 +0100
parents
children 6cfc4648ffab
comparison
equal deleted inserted replaced
340:1f23eb4953ce 341:6f213a600195
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=gdk-pixbuf
19 PKGVERSION=2.38.1
20 PKGREVISION=1
21 PKGLICENSE="LGPLv21"
22 PKGSUMMARY="image loading library"
23 PKGDOWNLOAD="http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.38/$PKGNAME-$PKGVERSION.tar.xz"
24 PKGDEPENDS="dev/meson:build"
25 PKGOPTIONS="JASPER JPEG PNG TIFF X"
26
27 : ${CC:=gcc}
28 : ${CFLAGS:=-O2}
29 : ${CXX:=g++}
30 : ${CXXFLAGS:=-O2}
31 : ${LDFLAGS:=}
32 : ${JASPER:=no}
33 : ${JPEG:=yes}
34 : ${PNG:=yes}
35 : ${TIFF:=yes}
36 : ${X:=yes}
37
38 if [ "$JASPER" = "yes" ]; then
39 PKGDEPENDS="graphics/jasper $PKGDEPENDS"
40 with_jasper="-D jasper=true"
41 else
42 with_jasper="-D jasper=false"
43 fi
44
45 if [ "$JPEG" = "yes" ]; then
46 PKGDEPENDS="graphics/libjpeg-turbo $PKGDEPENDS"
47 with_jpeg="-D jpeg=true"
48 else
49 with_jpeg="-D jpeg=false"
50 fi
51
52 if [ "$PNG" = "yes" ]; then
53 PKGDEPENDS="graphics/libpng $PKGDEPENDS"
54 with_png="-D png=true"
55 else
56 with_png="-D png=false"
57 fi
58
59 if [ "$TIFF" = "yes" ]; then
60 PKGDEPENDS="graphics/libtiff $PKGDEPENDS"
61 with_tiff="-D tiff=true"
62 else
63 with_tiff="-D tiff=false"
64 fi
65
66 if [ "$X" = "yes" ]; then
67 PKGDEPENDS="x11/libx11 $PKGDEPENDS"
68 with_x="-D x11=true"
69 else
70 with_x="-D x11=false"
71 fi
72
73 build()
74 {
75 rm -rf $PKGNAME-$PKGVERSION
76 tar xvaf $PKGNAME-$PKGVERSION.tar.xz
77 pushd $PKGNAME-$PKGVERSION
78
79 CC="$CC" \
80 CFLAGS="$CFLAGS" \
81 CXX="$CXX" \
82 CXXFLAGS="$CXXFLAGS" \
83 LDFLAGS="$LDFLAGS" \
84 meson \
85 --prefix /usr \
86 --buildtype release \
87 --default-library shared \
88 $with_jasper \
89 $with_jpeg \
90 $with_png \
91 $with_tiff \
92 $with_x \
93 . build
94 ninja -C build
95 DESTDIR=$DESTDIR ninja -C build install
96
97 popd
98 rm -rf $PKGNAME-$PKGVERSION
99 }
100