summaryrefslogtreecommitdiff
path: root/development/gtest/gtest.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'development/gtest/gtest.SlackBuild')
-rw-r--r--development/gtest/gtest.SlackBuild66
1 files changed, 42 insertions, 24 deletions
diff --git a/development/gtest/gtest.SlackBuild b/development/gtest/gtest.SlackBuild
index 7adc1a21f8..6c4d73b8da 100644
--- a/development/gtest/gtest.SlackBuild
+++ b/development/gtest/gtest.SlackBuild
@@ -1,10 +1,32 @@
#!/bin/sh
# Slackware build script for gtest
+
# 2013-02-12 Bernski Comadizo <bcomadizo@gmail.com> Cebu
+# Copyright 2016 Dimitris Zlatanidis Orestiada, Greece
+#
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=gtest
-VERSION=${VERSION:-1.5.0}
+SRCNAM=googletest
+VERSION=${VERSION:-1.7.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -40,9 +62,9 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar -xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
+rm -rf $SRCNAM-release-$VERSION
+tar -xvf $CWD/$SRCNAM-release-$VERSION.tar.gz || tar -xvf $CWD/release-$VERSION.tar.gz
+cd $SRCNAM-release-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -50,32 +72,28 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --mandir=/usr/man \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- --disable-static \
- --build=$ARCH-slackware-linux
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DBUILD_SHARED_LIBS=ON \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+cd ..
+
+mkdir -p $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/include/$PRGNAM/internal
-# Compile the application and install it into the $PKG directory
-make
-make install DESTDIR=$PKG
+install -m 0644 build/*.so $PKG/usr/lib$LIBDIRSUFFIX
+install -m 0644 include/$PRGNAM/*.h $PKG/usr/include/$PRGNAM
+install -m 0644 include/$PRGNAM/internal/*.h $PKG/usr/include/$PRGNAM/internal
# Strip binaries and libraries
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
-# Remove 'special' files
-find $PKG -name perllocal.pod \
- -o -name ".packlist" \
- -o -name "*.bs" \
- | xargs rm -f
-
# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc