diff options
author | Marcel Steinbeck <marcel dot steinbeck at googlemail dot com> | 2017-04-09 00:54:17 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-04-13 07:27:46 +0700 |
commit | 89f6ac9939728d7cfa8dfa8937205ff390b308b2 (patch) | |
tree | 755230255b9f86afd90c1fb715991c8fe9c75034 /development/srcML | |
parent | e5380977a1a09f7aa85feb75786d58d62faede49 (diff) |
development/srcML: Added (XML representation of source code).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/srcML')
-rw-r--r-- | development/srcML/README | 12 | ||||
-rw-r--r-- | development/srcML/slack-desc | 19 | ||||
-rw-r--r-- | development/srcML/srcML-0.9.5-boost-optional.patch | 11 | ||||
-rw-r--r-- | development/srcML/srcML-0.9.5-lib-install-dir.patch | 11 | ||||
-rw-r--r-- | development/srcML/srcML.SlackBuild | 127 | ||||
-rw-r--r-- | development/srcML/srcML.info | 12 |
6 files changed, 192 insertions, 0 deletions
diff --git a/development/srcML/README b/development/srcML/README new file mode 100644 index 000000000000..e2acf891c3bb --- /dev/null +++ b/development/srcML/README @@ -0,0 +1,12 @@ +The srcML format is a XML representation for source code, where the markup +tags identify elements of the abstract syntax for the language. The srcml +program is a command line application for the conversion of source code to +srcML, an interface for the exploration, analysis, and manipulation of source +code in this form, and the conversion of srcML back to source code. The +current parsing technologies support C/C++, C#, and Java. + +srcML requires some statically compiled Boost libraries which are not +available in Slackware's default installation. Thus, the required libraries +are compiled temporarily according to srcML's documentation but will not be +installed into your system. Also, srcML's Python binding will not be +installed. diff --git a/development/srcML/slack-desc b/development/srcML/slack-desc new file mode 100644 index 000000000000..0634af12df3a --- /dev/null +++ b/development/srcML/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +srcML: srcML (document-oriented XML representation of source code) +srcML: +srcML: The srcML format is a XML representation for source code, where the +srcML: markup tags identify elements of the abstract syntax for the language. +srcML: The srcml program is a command line application for the conversion +srcML: of source code to srcML, an interface for the exploration, analysis, +srcML: and manipulation of source code in this form, and the conversion of +srcML: srcML back to source code. The current parsing technologies support +srcML: C/C++, C#, and Java. +srcML: +srcML: http://www.srcml.org/ diff --git a/development/srcML/srcML-0.9.5-boost-optional.patch b/development/srcML/srcML-0.9.5-boost-optional.patch new file mode 100644 index 000000000000..80890dc2f618 --- /dev/null +++ b/development/srcML/srcML-0.9.5-boost-optional.patch @@ -0,0 +1,11 @@ +--- srcML-src.orig/src/libsrcml/srcml_reader_handler.hpp 2015-05-20 03:36:48.000000000 +0200 ++++ srcML-src/src/libsrcml/srcml_reader_handler.hpp 2017-04-07 17:10:40.137339217 +0200 +@@ -456,7 +456,7 @@ + + if(uri == SRCML_CPP_NS_URI) { + +- if(archive->language != 0) { ++ if(archive->language) { + + if(*archive->language == "C++" || *archive->language == "C" || *archive->language == "Objective-C") + archive->options |= SRCML_OPTION_CPP | SRCML_OPTION_CPP_NOMACRO; diff --git a/development/srcML/srcML-0.9.5-lib-install-dir.patch b/development/srcML/srcML-0.9.5-lib-install-dir.patch new file mode 100644 index 000000000000..d5d15fb60f69 --- /dev/null +++ b/development/srcML/srcML-0.9.5-lib-install-dir.patch @@ -0,0 +1,11 @@ +--- srcML-src.orig/src/CMakeLists.txt 2015-05-20 03:36:48.000000000 +0200 ++++ srcML-src/src/CMakeLists.txt 2017-04-08 15:07:12.155298797 +0200 +@@ -67,6 +67,8 @@ + install(TARGETS srcml_shared srcml_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib64 ARCHIVE DESTINATION lib64) + elseif(OS_NAME STREQUAL "openSUSE" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + install(TARGETS srcml_shared srcml_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib64 ARCHIVE DESTINATION lib64) ++elseif(OS_NAME STREQUAL "Slackware" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") ++ install(TARGETS srcml_shared srcml_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib64 ARCHIVE DESTINATION lib64) + else() + install(TARGETS srcml_shared srcml_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) + endif() diff --git a/development/srcML/srcML.SlackBuild b/development/srcML/srcML.SlackBuild new file mode 100644 index 000000000000..4d8e628a63f4 --- /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} diff --git a/development/srcML/srcML.info b/development/srcML/srcML.info new file mode 100644 index 000000000000..d9321d2396d0 --- /dev/null +++ b/development/srcML/srcML.info @@ -0,0 +1,12 @@ +PRGNAM="srcML" +VERSION="0.9.5" +HOMEPAGE="http://www.srcml.org/" +DOWNLOAD="http://131.123.42.38/lmcrs/beta/srcML-src.tar.gz \ + http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.bz2" +MD5SUM="e5c4223f7556b57984b20d70606f50ab \ + 6aa9a5c6a4ca1016edd0ed1178e3cb87" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="antlr2" +MAINTAINER="Marcel Steinbeck" +EMAIL="marcel dot steinbeck at googlemail dot com" |