From b72a6a7b1c24b70c47d33d4da330c7737268b2b2 Mon Sep 17 00:00:00 2001 From: powtrix Date: Sun, 4 Jan 2015 08:43:12 +0700 Subject: [PATCH] libraries/libwebp: Added optional python 3 support. Signed-off-by: Willy Sudiarto Raharjo --- libraries/libwebp/libwebp.SlackBuild | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/libraries/libwebp/libwebp.SlackBuild b/libraries/libwebp/libwebp.SlackBuild index 1adef44542..5a87653ff9 100644 --- a/libraries/libwebp/libwebp.SlackBuild +++ b/libraries/libwebp/libwebp.SlackBuild @@ -5,7 +5,7 @@ PRGNAM=libwebp VERSION=${VERSION:-0.4.2} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -59,17 +59,34 @@ CXXFLAGS="$SLKCFLAGS" \ --localstatedir=/var \ --mandir=/usr/man \ --disable-static \ + --disable-silent-rules \ + --enable-everything \ + --enable-swap-16bit-csp \ + --enable-experimental \ --build=$ARCH-slackware-linux make make install-strip DESTDIR=$PKG +( + cd swig + # Fix temporary working directory. + sed -i "/^tmpdir/s|=.*|= 'tmpdir'|" setup.py + CFLAGS="$SLKCFLAGS -I$PKG/usr/include" \ + LDFLAGS="-L$PKG/usr/lib${LIBDIRSUFFIX} -lwebp" \ + python setup.py install --root=$PKG + # Install the python3 module if python3 is installed + if $(python3 -c 'import sys' 2>/dev/null); then + CFLAGS="$SLKCFLAGS -I$PKG/usr/include" \ + LDFLAGS="-L$PKG/usr/lib${LIBDIRSUFFIX} -lwebp" \ + python3 setup.py install --root=$PKG + fi +) + find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - AUTHORS COPYING ChangeLog NEWS PATENTS README \ - $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS COPYING ChangeLog NEWS PATENTS README $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install