summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@iinet.net.au>2015-03-27 21:32:13 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2015-03-28 02:22:18 +0700
commitfbd5e0caf2f3d3d88a8766b6f7f138a005f45ba8 (patch)
tree98c8efe8fc264f67df23e8610317e77d12c41f91
parent7dd840b9e52c0ab12997a350de9081c692f6d128 (diff)
downloadslackbuilds-fbd5e0caf2f3d3d88a8766b6f7f138a005f45ba8.tar.gz
graphics/opencolorio: Fix python{2,3} compatibility.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--graphics/opencolorio/README3
-rw-r--r--graphics/opencolorio/opencolorio.SlackBuild91
2 files changed, 40 insertions, 54 deletions
diff --git a/graphics/opencolorio/README b/graphics/opencolorio/README
index 5800a1cee0..59b5477472 100644
--- a/graphics/opencolorio/README
+++ b/graphics/opencolorio/README
@@ -8,4 +8,5 @@ Color Encoding Specification (ACES) and is LUT-format agnostic,
supporting many popular formats.
This package includes building of a shared object library for each of
-python2 and python3 provided python3 is available on the build system.
+python2 and python3 provided the respective python version is available
+on the build system.
diff --git a/graphics/opencolorio/opencolorio.SlackBuild b/graphics/opencolorio/opencolorio.SlackBuild
index 7e1d197180..83d7e588e5 100644
--- a/graphics/opencolorio/opencolorio.SlackBuild
+++ b/graphics/opencolorio/opencolorio.SlackBuild
@@ -25,15 +25,9 @@
PRGNAM=opencolorio
SRCNAM=OpenColorIO
VERSION=${VERSION:-0.git20150311}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
-
-PYTHON3_INCLUDE_DIR=$(pkg-config --cflags-only-I python3 |sed -e 's/-I//')
-PYTHON2_INCLUDE_DIR=$(pkg-config --cflags-only-I python2 |sed -e 's/-I//')
-if [ -e /usr/bin/python3 ]; then
- PY2SITEDIR=$(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
- PY3SITEDIR=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
-fi
+PYTHON_VERSIONS=${PYTHON_VERSIONS:-"2 3"}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -66,51 +60,42 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $SRCNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
-cd $SRCNAM-$VERSION
-chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-mkdir -p build
-cd build
- cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DPYTHON=python2 \
- -DPYTHON_INCLUDE_DIR:PATH=$PYTHON2_INCLUDE_DIR \
- -DPYTHON_LIBRARY:PATH=$PY2SITEDIR \
- -DOCIO_BUILD_STATIC:BOOL=OFF \
- -DOCIO_BUILD_JNIGLUE:BOOL=OFF \
- -DCMAKE_BUILD_TYPE=Release ..
-
- make
- make install DESTDIR=$PKG
-
-if [ -e /usr/bin/python3 ]; then
- rm -rf *
- cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DPYTHON=python3 \
- -DPYTHON_INCLUDE_DIR:PATH=$PYTHON3_INCLUDE_DIR \
- -DPYTHON_LIBRARY:PATH=$PY3SITEDIR \
- -DOCIO_BUILD_STATIC:BOOL=OFF \
- -DOCIO_BUILD_JNIGLUE:BOOL=OFF \
- -DCMAKE_BUILD_TYPE=Release ..
-
- make
- make install DESTDIR=$PKG
-fi
+
+for v in $PYTHON_VERSIONS ; do
+ if [ $(which python$v 2>/dev/null) ]; then
+ PY_INCLUDE_DIR=$(pkg-config --cflags-only-I python$v |sed -e 's/-I//')
+ PY_SITEDIR=$(python$v -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+
+ cd $TMP
+ rm -rf $SRCNAM-$VERSION
+ tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+ cd $SRCNAM-$VERSION
+ chown -R root:root .
+ find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+ mkdir -p build
+ cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DPYTHON=python$v \
+ -DPYTHON_INCLUDE_DIR:PATH=$PY_INCLUDE_DIR \
+ -DPYTHON_LIBRARY:PATH=$PY_SITEDIR \
+ -DOCIO_BUILD_STATIC:BOOL=OFF \
+ -DOCIO_BUILD_JNIGLUE:BOOL=OFF \
+ -DCMAKE_BUILD_TYPE=Release ..
+
+ make
+ make install DESTDIR=$PKG
+ fi
+done
+
cd ..
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \