chiark / gitweb /
Various package updates
[termux-packages] / packages / netpbm / build.sh
1 TERMUX_PKG_HOMEPAGE=http://netpbm.sourceforge.net/
2 TERMUX_PKG_DESCRIPTION="Toolkit for manipulation of graphic images, including conversion of images between a variety of different formats"
3 # The netpbm releases are described at http://netpbm.sourceforge.net/release.html
4 # and are divided among (1) Development, (2) Advanced, (3) Stable and (4) Super Stable.
5 # Only Super Stable is distributed as a tar ball, but is outdated and does not compile with modern libpng.
6 # So use revisions from http://svn.code.sf.net/p/netpbm/code/advanced for packages.
7 _SVN_REVISION=2751
8 TERMUX_PKG_VERSION=${_SVN_REVISION}
9 TERMUX_PKG_DEPENDS="libpng, libxml2"
10 TERMUX_PKG_BUILD_IN_SRC=yes
11 TERMUX_MAKE_PROCESSES=1
12
13 termux_step_extract_package () {
14         svn co -r $_SVN_REVISION http://svn.code.sf.net/p/netpbm/code/advanced $TERMUX_PKG_SRCDIR
15 }
16
17 termux_step_configure () {
18         # Put the android libpng-config script in the path (before the host one):
19         TERMUX_PKG_LIBPNG_CONFIG_DIR=$TERMUX_PKG_TMPDIR/libpng-config
20         mkdir -p $TERMUX_PKG_LIBPNG_CONFIG_DIR
21         cp $TERMUX_PREFIX/bin/libpng-config $TERMUX_PKG_LIBPNG_CONFIG_DIR/
22         export PATH=$TERMUX_PKG_LIBPNG_CONFIG_DIR:$PATH
23
24
25         # See $SRC/doc/INSTALL about netpbm build system. For automatic builds it recommends just copying config.mk.in
26         cd $TERMUX_PKG_SRCDIR
27         cp config.mk.in config.mk
28         echo "AR = $AR" >> config.mk
29         echo "RANLIB = $RANLIB" >> config.mk
30         echo "CC = $CC" >> config.mk
31         echo "CFLAGS = $CFLAGS" >> config.mk
32         echo "LDFLAGS = $LDFLAGS" >> config.mk
33         echo "STATICLIB_TOO = n" >> config.mk
34         echo "INTTYPES_H = <inttypes.h>" >> config.mk
35         export STRIPPROG=$STRIP
36
37         echo "CC_FOR_BUILD = cc" >> config.mk
38         echo "LD_FOR_BUILD = cc" >> config.mk
39         echo "CFLAGS_FOR_BUILD = " >> config.mk
40         echo "LDFLAGS_FOR_BUILD = " >> config.mk
41 }
42
43 termux_step_make_install () {
44         rm -Rf /tmp/netpbm
45         make -j 1 package pkgdir=/tmp/netpbm
46         ./installnetpbm
47 }