summaryrefslogtreecommitdiff
path: root/academic/scidavis/scidavis.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'academic/scidavis/scidavis.SlackBuild')
-rw-r--r--academic/scidavis/scidavis.SlackBuild69
1 files changed, 34 insertions, 35 deletions
diff --git a/academic/scidavis/scidavis.SlackBuild b/academic/scidavis/scidavis.SlackBuild
index ee13ce7f97..583fbe32b3 100644
--- a/academic/scidavis/scidavis.SlackBuild
+++ b/academic/scidavis/scidavis.SlackBuild
@@ -1,9 +1,10 @@
#!/bin/sh
# Slackware build script for SciDAVis
-# Based on the Slackware 14.1 SlackBuild
-# Written by Fellype do Nascimento <fellype(at)gmail.com>
-
+# Based on the Slackware 14.2 SlackBuild
+#
+# Copyright 2017, Fellype do Nascimento, Campinas - Brazil
+# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
@@ -23,7 +24,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=scidavis
-VERSION=${VERSION:-1.14}
+VERSION=${VERSION:-1.17}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -35,28 +36,34 @@ if [ -z "$ARCH" ]; then
esac
fi
-
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX="";
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ SPEC=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX="";
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ SPEC=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
+ SLKCFLAGS="-O2 -fPIC"
+ SPEC="-spec linux-g++-64"
fi
-
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -zxvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
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 \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Correction needed in order to find qwtplot3d in its default path
grep -rl "qwtplot3d/" libscidavis/src/ | xargs sed -i "s:<qwtplot3d/:<:"
@@ -64,53 +71,45 @@ grep -rl "qwtplot3d/" libscidavis/src/ | xargs sed -i "s:<qwtplot3d/:<:"
# Correction needed in order to re-enable desktop integration
cat $CWD/desktop_integration.txt >> scidavis/basic.pri
-## Applying a patch on libscidavis/src/Fit.cpp in order to have correct values of parameters' errors generated by fit functions
-patch -p1 < $CWD/fix_wrong_values_on_parameters_errors.patch libscidavis/src/Fit.cpp
-
## Applying a patch in the config.pri file in order to build with the correct path for qwt5
+## See https://sourceforge.net/p/scidavis/scidavis-bugs/291/
patch -p1 < $CWD/correction_to_use_qwt5.patch config.pri
## For some unknown reason, to build in Slackware we need to run qmake twice in order to get icons working properly
## See https://sourceforge.net/p/scidavis/scidavis-bugs/259/
qmake
-qmake CONFIG+="liborigin python" PRESET=linux_package
+qmake \
+ CONFIG+="liborigin python" \
+ PRESET=linux_package \
+ QMAKE_CFLAGS+="$SLKCFLAGS" \
+ QMAKE_CXXFLAGS+="$SLKCFLAGS" \
+ $SPEC
-# Build and install:
-LDFLAGS="$SLKLDFLAGS" \
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
make
make install INSTALL_ROOT=$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
+
## Sometimes 'make install' fails to install the translation files
mkdir -p $PKG/usr/share/scidavis/translations
cp scidavis/translations/*.qm $PKG/usr/share/scidavis/translations
+mkdir -p $PKG/usr/man/man1
+docbook2man man/manpage.sgml -o $PKG/usr/man/man1/
+gzip -9 $PKG/usr/man/man1/*.1
+ln -sf SciDAVis.1.gz $PKG/usr/man/man1/scidavis.1.gz
+rm $PKG/usr/man/man1/manpage.*
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README.md LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $PKG/usr/share/doc/scidavis/*.* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
rm -rf $PKG/usr/share/doc
-( cd $PKG
-find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null || true
-)
-
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/slack-desc > $PKG/usr/doc/$PRGNAM-$VERSION/slack-desc
-
-mkdir -p $PKG/usr/man/man1
-docbook2man man/manpage.sgml -o $PKG/usr/man/man1/
-cp $PKG/usr/man/man1/SciDAVis.1 $PKG/usr/man/man1/scidavis.1
-gzip -9 $PKG/usr/man/man1/*.1
-rm $PKG/usr/man/man1/manpage.*
-
-if [ -e /usr/bin/requiredbuilder ]; then
- requiredbuilder -v -y -s $CWD $PKG
-fi
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}