aboutsummaryrefslogtreecommitdiff
path: root/development/srcML/srcML.SlackBuild
diff options
context:
space:
mode:
authorMarcel Steinbeck <marcel dot steinbeck at googlemail dot com>2017-04-09 00:54:17 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-04-13 07:27:46 +0700
commit89f6ac9939728d7cfa8dfa8937205ff390b308b2 (patch)
tree755230255b9f86afd90c1fb715991c8fe9c75034 /development/srcML/srcML.SlackBuild
parente5380977a1a09f7aa85feb75786d58d62faede49 (diff)
development/srcML: Added (XML representation of source code).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/srcML/srcML.SlackBuild')
-rw-r--r--development/srcML/srcML.SlackBuild127
1 files changed, 127 insertions, 0 deletions
diff --git a/development/srcML/srcML.SlackBuild b/development/srcML/srcML.SlackBuild
new file mode 100644
index 0000000000000..4d8e628a63f4a
--- /dev/null
+++ b/development/srcML/srcML.SlackBuild
@@ -0,0 +1,127 @@
+#!/bin/sh
+
+# Slackware build script for srcML
+
+# Copyright 2017 Marcel Steinbeck Germany
+# 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=srcML
+VERSION=${VERSION:-0.9.5}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+BOOST=boost_1_59_0
+DEPDIR=deps
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ 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"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-src.tar.gz
+mv $PRGNAM-src $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+tar xvf $CWD/$BOOST.tar.bz2
+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 {} \;
+
+# Contains all compile time dependencies of srcML
+DEPPATH=$TMP/$PRGNAM-$VERSION/$DEPDIR
+mkdir -p $DEPPATH
+
+cd $BOOST
+ ./bootstrap.sh \
+ --prefix=$DEPPATH \
+ --without-libraries=atomic,chrono,context,coroutine,exception,graph,\
+graph_parallel,iostreams,locale,log,math,mpi,python,random,serialization,\
+signals,test,timer,wave
+ ./b2 \
+ link=static \
+ cxxflags="-fPIC -static -Wl,--whole-archive" \
+ threading=multi \
+ install
+cd ..
+
+# Fix a compilation error caused by an invalid check of a boost optional
+patch -Np1 -i $CWD/srcML-0.9.5-boost-optional.patch
+
+# Fix library installation directory for 64 bit systems
+patch -Np1 -i $CWD/srcML-0.9.5-lib-install-dir.patch
+
+# CMAKE_INSTALL_PREFIX is ignored
+sed -i -e 's#usr/local#usr#' CMake/install.cmake
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DBOOST_ROOT=$DEPPATH \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make
+ make install 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
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ BUILD.md COPYING.txt README.md \
+ $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
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}