From 4a9c97e39429775812d28d720f66481117decf55 Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Fri, 12 Feb 2021 09:29:54 +1000 Subject: python/pybind11: Use CMake Signed-off-by: Christoph Willing Signed-off-by: Willy Sudiarto Raharjo --- python/pybind11/pybind11.SlackBuild | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/python/pybind11/pybind11.SlackBuild b/python/pybind11/pybind11.SlackBuild index 09b5ff9065..093db9bc54 100644 --- a/python/pybind11/pybind11.SlackBuild +++ b/python/pybind11/pybind11.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for pybind11 -# Copyright 2019,2020 Christoph Willing, Brisbane, Australia +# Copyright 2019,2021 Christoph Willing, Brisbane, Australia # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +25,7 @@ PRGNAM=pybind11 VERSION=${VERSION:-2.5.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -70,19 +70,25 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -python setup.py install --root=$PKG -# Python 3 support. -if $(python3 -c 'import sys' 2>/dev/null); then - python3 setup.py install --root=$PKG -fi +mkdir build && cd build +cmake .. \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DPYBIND11_PYTHON_VERSION=$(python3 --version|cut -d' ' -f2) \ + -DPYBIND11_TEST=OFF \ + +make +make install DESTDIR=$PKG +cd .. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ - CONTRIBUTING.md LICENSE README.md \ + CONTRIBUTING.md LICENSE README.md docs/* \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -- cgit v1.2.3