From 83338749ef84c6ba7e3f26851ece7867d7f7df57 Mon Sep 17 00:00:00 2001 From: David Spencer Date: Wed, 18 Nov 2015 19:17:43 +0000 Subject: academic/labplot2: Fixed build with gcc-5.2.0. Use SBo standard cmake template to add -fpermissive more easily. Signed-off-by: David Spencer Signed-off-by: Willy Sudiarto Raharjo --- academic/labplot2/labplot2.SlackBuild | 38 +++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'academic/labplot2') diff --git a/academic/labplot2/labplot2.SlackBuild b/academic/labplot2/labplot2.SlackBuild index 052e3324cf..ca807e8da1 100644 --- a/academic/labplot2/labplot2.SlackBuild +++ b/academic/labplot2/labplot2.SlackBuild @@ -24,11 +24,17 @@ PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi set -e @@ -46,19 +52,21 @@ 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 {} \; -./compile +# Use -fpermissive to fix build failure with gcc-5.2.0 +mkdir -p build +cd build + cmake \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -fpermissive" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DMAN_INSTALL_DIR=/usr/man \ + -DCMAKE_BUILD_TYPE=Release .. + make + make install DESTDIR=$PKG +cd .. -( cd build/ -cmake ./ -DCMAKE_INSTALL_PREFIX=/usr -cmake ./ -DCMAKE_BUILD_TYPE=Release -make install DESTDIR=$PKG -) - -( 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 -) +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 AUTHORS ChangeLog COPYING INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION -- cgit v1.2.3