diff options
Diffstat (limited to 'gis/saga-gis/saga-gis.SlackBuild')
-rw-r--r-- | gis/saga-gis/saga-gis.SlackBuild | 96 |
1 files changed, 61 insertions, 35 deletions
diff --git a/gis/saga-gis/saga-gis.SlackBuild b/gis/saga-gis/saga-gis.SlackBuild index 29ef4478af..e02d2da421 100644 --- a/gis/saga-gis/saga-gis.SlackBuild +++ b/gis/saga-gis/saga-gis.SlackBuild @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for saga-gis -# Copyright 2014-2019 Benjamin Trigona-Harany <slackbuilds@jaxartes.net> +# Copyright 2023-2024 Giancarlo Dessi, Cagliari, IT +# Copyright 2014-2021 Benjamin Trigona-Harany <slackbuilds@jaxartes.net> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -22,10 +23,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=saga-gis -VERSION=${VERSION:-7.3.0} -BUILD=${BUILD:-2} +VERSION=${VERSION:-9.3.2} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} SRCNAM=saga @@ -37,34 +41,60 @@ 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-$SRCNAM +PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # issues with -O2 causing build failures if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-march=i586 -mtune=i686" - LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-march=i686 -mtune=i686" - LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-fPIC" - LIBDIRSUFFIX="64" else SLKCFLAGS="" - LIBDIRSUFFIX="" fi set -e +# unixODBC is needed in 32 bit systems instead of libiodbc released +# with Slackware 15.0. The slackbuild stops if unixODBC is not installed +if [[ "$ARCH" = "i586" || "$ARCH" = "i686" ]] ; then + if ! [ -f /usr/lib/libodbc.so ] ; then + echo ""; + echo ""; + echo ""; + echo "******************** WARNING *********************"; + echo " This script cannot be executed in 32 bit systems "; + echo " with iODBC as default ODBC library installed. "; + echo " The current process will be stopped. "; + echo " Please install the unixODBC package from the "; + echo " slackbuild available in the SBo repository. "; + echo "**************************************************"; + exit 1; + fi +fi + +if [ -d /usr/share/cmake-3.29 ]; then + # This prevents some cmake warnings in current + CMAKE_POLICY="-DCMAKE_POLICY_DEFAULT_CMP0153=OLD " +else + CMAKE_POLICY="" +fi + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $SRCNAM-$VERSION tar xvf $CWD/$SRCNAM-$VERSION.tar.gz -cd $SRCNAM-$VERSION +cd $SRCNAM-$VERSION/saga-gis + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -72,43 +102,39 @@ 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 {} \; -if [ "$OPENCV" != "ON" ] ; then - sed -i "s/CVFOUND=1/true/g" configure -fi - -sed -i "s/isinf/std::isinf/g" src/saga_core/saga_gui/wksp_map_layer.cpp - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -PYTHON=python3 \ -./configure \ - --build=$ARCH \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --mandir=/usr/man \ - --enable-python \ - --disable-odbc \ - --build=$ARCH-slackware-linux - -make -make install DESTDIR=$PKG +mkdir -p build +cd build + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_MANDIR=/usr/man \ + $CMAKE_POLICY \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install/strip 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 +# DCMAKE_INSTALL_MANDIR is not applied by the process we move files manually from /usr/share +mv $PKG/usr/share/man $PKG/usr/ find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done mv $PKG/usr/share/metainfo $PKG/usr/share/appdata +# fix some bad perms in doc files that have to install +chmod 644 readme.md src/*.txt + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - AUTHORS COPYING ChangeLog NEWS README \ - $PKG/usr/doc/$PRGNAM-$VERSION +cp -a readme.md src/gpl.txt src/lgpl.txt $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh 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 |