comparison graphics/libtiff/libtiff.sh @ 338:b408f1c4945e

graphics/libtiff: initial import, closes #1428
author David Demelier <markand@malikania.fr>
date Wed, 27 Mar 2019 20:30:00 +0100
parents
children 7828241c9634
comparison
equal deleted inserted replaced
337:04a8950662f7 338:b408f1c4945e
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=libtiff
19 PKGVERSION=4.0.10
20 PKGREVISION=1
21 PKGLICENSE="one of README.licenses.md or CUSTOM"
22 PKGSUMMARY="short summary"
23 PKGDOWNLOAD="https://download.osgeo.org/$PKGNAME/tiff-$PKGVERSION.tar.gz"
24 PKGOPTIONS="JPEG LZMA ZLIB ZSTD"
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 : ${JPEG:=yes}
35 : ${LZMA:=yes}
36 : ${ZLIB:=yes}
37 : ${ZSTD:=yes}
38
39 if [ "$JPEG" = "yes" ]; then
40 PKGDEPENDS="graphics/libjpeg-turbo $PKGDEPENDS"
41 with_jpeg="--enable-jpeg"
42 else
43 with_jpeg="--disable-jpeg"
44 fi
45
46 if [ "$LZMA" = "yes" ]; then
47 PKGDEPENDS="core/xz $PKGDEPENDS"
48 with_lzma="--enable-lzma"
49 else
50 with_lzma="--disable-lzma"
51 fi
52
53 if [ "$ZLIB" = "yes" ]; then
54 PKGDEPENDS="lib/zlib $PKGDEPENDS"
55 with_zlib="--enable-zlib"
56 else
57 with_zlib="--disable-zlib"
58 fi
59
60 if [ "$ZSTD" = "yes" ]; then
61 PKGDEPENDS="lib/zstd $PKGDEPENDS"
62 with_zstd="--enable-zstd"
63 else
64 with_zstd="--disable-zstd"
65 fi
66
67 build()
68 {
69 rm -rf tiff-$PKGVERSION
70 tar xvaf tiff-$PKGVERSION.tar.gz
71 pushd tiff-$PKGVERSION
72
73 CC="$CC" \
74 CFLAGS="$CFLAGS" \
75 CXX="$CXX" \
76 CXXFLAGS="$CXXFLAGS" \
77 LDFLAGS="$LDFLAGS" \
78 LIBS="$LIBS" \
79 ./configure \
80 --build=$CBUILD \
81 --host=$CHOST \
82 --prefix=/usr \
83 --with-docdir=/usr/share/doc/libtiff \
84 --disable-static \
85 --enable-shared \
86 $with_jpeg \
87 $with_lzma \
88 $with_zlib \
89 $with_zstd
90 make
91 make install DESTDIR=$DESTDIR
92 rm -f $DESTDIR/usr/lib/libtiff{,xx}.la
93
94 popd
95 rm -rf tiff-$PKGVERSION
96 }