comparison graphics/libwebp/libwebp.sh @ 710:8104a57ba6ca

graphics/libwebp: initial import, closes #1736
author David Demelier <markand@malikania.fr>
date Fri, 02 Aug 2019 21:05:00 +0200
parents
children 59a2fa6992bc
comparison
equal deleted inserted replaced
709:263453ab2372 710:8104a57ba6ca
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=libwebp
19 PKGVERSION=1.0.3
20 PKGREVISION=1
21 PKGLICENSE="BSD3CLAUSE"
22 PKGSUMMARY="open image format for the web"
23 PKGDOWNLOAD="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/$PKGNAME-$PKGVERSION.tar.gz"
24 PKGDEPENDS=""
25 PKGOPTIONS="JPEG PNG TIFF"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=clang}
30 : ${CFLAGS:=-O2}
31 : ${CXX:=clang++}
32 : ${CXXFLAGS:=-O2}
33 : ${LDFLAGS:=}
34 : ${LIBS:=}
35 : ${JPEG:=yes}
36 : ${PNG:=yes}
37 : ${TIFF:=yes}
38
39 if [ "$JPEG" = "yes" ]; then
40 PKGDEPENDS="graphics/libjpeg $PKGDEPENDS"
41 with_jpeg="--enable-jpeg"
42 else
43 with_jpeg="--disable-jpeg"
44 fi
45
46 if [ "$PNG" = "yes" ]; then
47 PKGDEPENDS="graphics/libpng $PKGDEPENDS"
48 with_png="--enable-png"
49 else
50 with_png="--disable-png"
51 fi
52
53 if [ "$TIFF" = "yes" ]; then
54 PKGDEPENDS="graphics/libtiff $PKGDEPENDS"
55 with_tiff="--enable-tiff"
56 else
57 with_tiff="--disable-tiff"
58 fi
59
60 build()
61 {
62 rm -rf $PKGNAME-$PKGVERSION
63 tar xvf $PKGNAME-$PKGVERSION.tar.gz
64 cd $PKGNAME-$PKGVERSION
65
66 CC="$CC" \
67 CFLAGS="$CFLAGS" \
68 CXX="$CXX" \
69 CXXFLAGS="$CXXFLAGS" \
70 LDFLAGS="$LDFLAGS" \
71 LIBS="$LIBS" \
72 ./configure \
73 --build=$CBUILD \
74 --host=$CHOST \
75 --prefix= \
76 --disable-static \
77 --enable-shared \
78 $with_jpeg \
79 $with_png \
80 $with_tiff
81 make
82 make install DESTDIR=$DESTDIR
83 rm -f $DESTDIR/lib/libwebp*.la
84
85 cd ..
86 rm -rf $PKGNAME-$PKGVERSION
87 }