diff options
Diffstat (limited to 'libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild')
-rw-r--r-- | libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild | 71 |
1 files changed, 31 insertions, 40 deletions
diff --git a/libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild b/libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild index dcc0b4ebf9..88aecdbe4e 100644 --- a/libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild +++ b/libraries/libtorrent-rasterbar/libtorrent-rasterbar.SlackBuild @@ -2,6 +2,7 @@ # Slackware build script for libtorrent (rasterbar) +# Copyright 2022-2023 Logan Rathbone, Province of Ontario, Canada # Copyright 2019-2020 Donald Cooley, South Haven, Indiana, USA # Copyright 2009-2015 Erik W. Hanson, Minneapolis, MN, USA # All rights reserved. @@ -26,14 +27,19 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=libtorrent-rasterbar -VERSION=${VERSION:-1.2.11} +VERSION=${VERSION:-1.2.19} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + *) export ARCH=$( uname -m ) ;; + esac +fi + if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -43,14 +49,6 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) export ARCH=i586 ;; - arm*) export ARCH=arm ;; - *) export ARCH=$( uname -m ) ;; - esac -fi - if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -76,43 +74,36 @@ cd $PRGNAM-$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 \ + -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 {} \; - -# https://github.com/qbittorrent/qBittorrent/issues/6383#issuecomment-281535787 -sed -i -e "s/+ target_specific(),/+ target_specific() + ['-std=c++14'],/" \ - bindings/python/setup.py + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ EXAMPLES=${EXAMPLES:-no} -[ "$EXAMPLES" = "yes" ] && examples="--enable-examples" - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS -std=c++14" \ -LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var/lib \ - --disable-static \ - --enable-python-binding \ - --enable-encryption \ - $examples \ - --with-boost-libdir=/usr/lib${LIBDIRSUFFIX} \ - --disable-debug \ - --build=$ARCH-slackware-linux - -make -make install-strip DESTDIR=$PKG +[ "$EXAMPLES" = "yes" ] && examples="-Dbuild_examples=ON" + +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR:PATH=lib${LIBDIRSUFFIX} \ + -Dpython-bindings=ON \ + -Dpython-egg-info=ON \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip DESTDIR=$PKG +cd .. + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog NEWS docs/ tools/ \ +cp -a AUTHORS COPYING LICENSE ChangeLog NEWS README* docs/ tools/ \ $PKG/usr/doc/$PRGNAM-$VERSION if [ "$EXAMPLES" = "yes" ]; then cp -a examples/ $PKG/usr/doc/$PRGNAM-$VERSION - cp -a ed25519/ $PKG/usr/doc/$PRGNAM-$VERSION fi find $PKG \ |