From 1e386bdd4235cc246cc33aaa336671db9486f914 Mon Sep 17 00:00:00 2001 From: Matteo Bernardini Date: Fri, 5 Jul 2019 13:18:04 +0200 Subject: libraries/aubio: Fix handling of the python{,3} bindings. Signed-off-by: Matteo Bernardini --- libraries/aubio/README | 6 ++++-- libraries/aubio/aubio.SlackBuild | 16 +++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'libraries') diff --git a/libraries/aubio/README b/libraries/aubio/README index 1f7d7c3080..e9643bc662 100644 --- a/libraries/aubio/README +++ b/libraries/aubio/README @@ -7,5 +7,7 @@ results too. jack-audio-connection-kit and ffmpeg are optional dependencies. -To build the python bindings, pass BINDINGS=yes to the script: -for these you need the additional dependency numpy. +The python bindings are built if numpy is available and the python3 +ones are built if numpy3 is available: if both versions of python +are present in the system, the aubio and aubiocut python scripts +will use python3. diff --git a/libraries/aubio/aubio.SlackBuild b/libraries/aubio/aubio.SlackBuild index b115f4c930..254ed00744 100644 --- a/libraries/aubio/aubio.SlackBuild +++ b/libraries/aubio/aubio.SlackBuild @@ -60,7 +60,7 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION-2 tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 cd $PRGNAM-$VERSION chown -R root:root . @@ -93,10 +93,16 @@ CXXFLAGS="$SLKCFLAGS" \ ./waf install \ --destdir=$PKG -if ! [ "${BINDINGS:-no}" = "no" ]; then - cd python - python setup.py install --root=$PKG - cd .. +cd .. +cp -a $PRGNAM-$VERSION $PRGNAM-$VERSION-2 +cd - + +if $(python -c 'import numpy' 2>/dev/null); then + python setup.py install --root=$PKG +fi +if $(python3 -c 'import numpy' 2>/dev/null); then + ( cd ../$PRGNAM-$VERSION-2 + python3 setup.py install --root=$PKG ) fi find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ -- cgit v1.2.3