summaryrefslogtreecommitdiffstats
path: root/python/pybind11/pybind11.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'python/pybind11/pybind11.SlackBuild')
-rw-r--r--python/pybind11/pybind11.SlackBuild45
1 files changed, 34 insertions, 11 deletions
diff --git a/python/pybind11/pybind11.SlackBuild b/python/pybind11/pybind11.SlackBuild
index 8a3563d0f6..8c2162a6e8 100644
--- a/python/pybind11/pybind11.SlackBuild
+++ b/python/pybind11/pybind11.SlackBuild
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for pybind11
-# Copyright 2019 Christoph Willing, Brisbane, Australia
+# Copyright 2019-2023 Christoph Willing, Brisbane, Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,10 +23,13 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=pybind11
-VERSION=${VERSION:-2.4.3}
+VERSION=${VERSION:-2.11.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -36,7 +39,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -70,19 +77,35 @@ 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
+mkdir build
-# Python 3 support.
-if $(python3 -c 'import sys' 2>/dev/null); then
- python3 setup.py install --root=$PKG
-fi
+python3 setup.py build
+
+(
+ cd build
+ cmake .. \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DPYTHON_EXECUTABLE=/usr/bin/python3 \
+ -DPYBIND11_TEST=OFF \
+
+ make
+)
+
+python3 setup.py install --prefix=/usr --root="$PKG" --install-headers=/usr/include/pybind11 --skip-build
+
+(
+ cd build
+ make install DESTDIR=$PKG
+)
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 \
+ LICENSE README* docs/* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -90,4 +113,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE