summaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorMarcel Steinbeck <marcel dot steinbeck at googlemail dot com>2017-02-07 01:23:03 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-02-10 07:16:15 +0700
commitddee9d560b82a37f60f75bcda3a160d0cba705f9 (patch)
tree5bc1ac60203ee93a1d87c2497cdbb2970a6325b3 /development
parentd32b96c05310779a8a38f887e51f950b56808969 (diff)
downloadslackbuilds-ddee9d560b82a37f60f75bcda3a160d0cba705f9.tar.gz
development/antlr2: Added (parser generator).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/antlr2/README8
-rw-r--r--development/antlr2/antlr-2.7.7-DESTDIR.patch178
-rw-r--r--development/antlr2/antlr-2.7.7-gcc-includes.patch18
-rw-r--r--development/antlr2/antlr2.SlackBuild107
-rw-r--r--development/antlr2/antlr2.info10
-rw-r--r--development/antlr2/slack-desc19
6 files changed, 340 insertions, 0 deletions
diff --git a/development/antlr2/README b/development/antlr2/README
new file mode 100644
index 0000000000..a81558fba0
--- /dev/null
+++ b/development/antlr2/README
@@ -0,0 +1,8 @@
+ANTLR (ANother Tool for Language Recognition) is a powerful parser
+generator for reading, processing, executing, or translating
+structured text or binary files.
+
+Optional dependencies are jdk and mono (to enable Java and C# support).
+C++ and Python are enabled by default.
+
+It is safe to install alongside libantlr3c
diff --git a/development/antlr2/antlr-2.7.7-DESTDIR.patch b/development/antlr2/antlr-2.7.7-DESTDIR.patch
new file mode 100644
index 0000000000..1e1f265106
--- /dev/null
+++ b/development/antlr2/antlr-2.7.7-DESTDIR.patch
@@ -0,0 +1,178 @@
+diff -uNr antlr-2.7.7.orig/antlr/Makefile.in antlr-2.7.7/antlr/Makefile.in
+--- antlr-2.7.7.orig/antlr/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/antlr/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -321,11 +321,11 @@
+
+ ## install antlr.jar in libdirectory if exists
+ install :: @ANTLR_JAR@
+- -$(MKDIR) -p "$(libdir)"
+- -$(MKDIR) -p "$(datadir)/$(versioneddir)"
++ -$(MKDIR) -p "$(DESTDIR)$(libdir)"
++ -$(MKDIR) -p "$(DESTDIR)$(datadir)/$(versioneddir)"
+ -test -f @ANTLR_JAR@ && {\
+- $(INSTALL) -m 444 @ANTLR_JAR@ "$(datadir)/$(versioneddir)" ; \
+- $(INSTALL) -m 444 @ANTLR_JAR@ "$(libdir)" ; \
++ $(INSTALL) -m 444 @ANTLR_JAR@ "$(DESTDIR)$(datadir)/$(versioneddir)" ; \
++ $(INSTALL) -m 444 @ANTLR_JAR@ "$(DESTDIR)$(libdir)" ; \
+ }
+
+ distclean :: clean
+diff -uNr antlr-2.7.7.orig/doc/Makefile.in antlr-2.7.7/doc/Makefile.in
+--- antlr-2.7.7.orig/doc/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/doc/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -43,12 +43,12 @@
+ $(eol)
+
+ install ::
+- @$(MKDIR) -p "$(antlr_doc_DIR)"
++ @$(MKDIR) -p "$(DESTDIR)$(antlr_doc_DIR)"
+ @@ECHO@ "install doc files .. "
+ @for f in $(antlr_doc_FILES) ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(antlr_doc_DIR)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(antlr_doc_DIR)" ; \
+ fi ;\
+ done
+
+diff -uNr antlr-2.7.7.orig/lib/cpp/antlr/Makefile.in antlr-2.7.7/lib/cpp/antlr/Makefile.in
+--- antlr-2.7.7.orig/lib/cpp/antlr/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/lib/cpp/antlr/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -75,11 +75,11 @@
+
+ install:
+ @@ECHO@ "install hpp files .. "
+- @$(MKDIR) -p "$(includedir)/antlr"
++ @$(MKDIR) -p "$(DESTDIR)$(includedir)/antlr"
+ @for f in $(antlr_hpp_FILES) ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(includedir)/antlr" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(includedir)/antlr" ; \
+ fi ;\
+ done
+
+diff -uNr antlr-2.7.7.orig/lib/cpp/src/Makefile.in antlr-2.7.7/lib/cpp/src/Makefile.in
+--- antlr-2.7.7.orig/lib/cpp/src/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/lib/cpp/src/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -114,12 +114,12 @@
+ $(eol)
+
+ this-install: @ANTLR_LIB@
+- @$(MKDIR) -p "$(libdir)"
++ @$(MKDIR) -p "$(DESTDIR)$(libdir)"
+ @@ECHO@ "install C++ core files .. "
+ @for f in $(antlr_lib_FILES) ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(libdir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(libdir)" ; \
+ fi ;\
+ done
+
+diff -uNr antlr-2.7.7.orig/lib/csharp/antlr.astframe/Makefile.in antlr-2.7.7/lib/csharp/antlr.astframe/Makefile.in
+--- antlr-2.7.7.orig/lib/csharp/antlr.astframe/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/lib/csharp/antlr.astframe/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -45,13 +45,13 @@
+
+ ## install our target ..
+ install :: @ASTFRAME_NET@
+- @$(MKDIR) -p "$(libdir)"
++ @$(MKDIR) -p "$(DESTDIR)$(libdir)"
+ @@ECHO@ "install C# core files .. "
+ @for f in @ASTFRAME_NET@ ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(libdir)" ; \
+- $(INSTALL) -m 444 "$${f}" "$(datadir)/$(versioneddir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(libdir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(datadir)/$(versioneddir)" ; \
+ fi ;\
+ done
+
+diff -uNr antlr-2.7.7.orig/lib/csharp/antlr.runtime/Makefile.in antlr-2.7.7/lib/csharp/antlr.runtime/Makefile.in
+--- antlr-2.7.7.orig/lib/csharp/antlr.runtime/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/lib/csharp/antlr.runtime/Makefile.in 2006-11-07 23:22:25.147461999 +0100
+@@ -135,13 +135,13 @@
+ @RMF@ Makefile
+
+ install :: @ANTLR_NET@
+- @$(MKDIR) -p "$(libdir)"
++ @$(MKDIR) -p "$(DESTDIR)$(libdir)"
+ @@ECHO@ "install C# core files .. "
+ @for f in @ANTLR_NET@ ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(libdir)" ; \
+- $(INSTALL) -m 444 "$${f}" "$(datadir)/$(versioneddir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(libdir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(datadir)/$(versioneddir)" ; \
+ fi ;\
+ done
+
+diff -uNr antlr-2.7.7.orig/lib/python/Makefile.in antlr-2.7.7/lib/python/Makefile.in
+--- antlr-2.7.7.orig/lib/python/Makefile.in 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7/lib/python/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -41,26 +41,26 @@
+ extradir = $(datadir)/$(versioneddir)
+
+ install-this:
+- $(MKDIR) -p "$(antlr_py_DIR)"
+- $(MKDIR) -p "$(libdir)"
++ $(MKDIR) -p "$(DESTDIR)$(antlr_py_DIR)"
++ $(MKDIR) -p "$(DESTDIR)$(libdir)"
+ @@ECHO@ "install python files .. "
+ @for f in $(antlr_py_FILES) ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(libdir)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(libdir)" ; \
+ fi ;\
+ done
+ @for f in $(antlr_py1_FILES) ; do \
+ @ECHO@ "install $${f}" ; \
+ if test -f "$${f}" ; then \
+- $(INSTALL) -m 444 "$${f}" "$(antlr_py_DIR)" ; \
++ $(INSTALL) -m 444 "$${f}" "$(DESTDIR)$(antlr_py_DIR)" ; \
+ fi ;\
+ done
+ @f="$(objdir)/scripts/pyantlr.sh"; \
+ if test -f "$${f}" ; then \
+ @ECHO@ "install Python installer" ; \
+- $(MKDIR) -p "$(sbindir)" ; \
+- $(INSTALL) -m 555 "$${f}" "$(sbindir)" ; \
++ $(MKDIR) -p "$(DESTDIR)$(sbindir)" ; \
++ $(INSTALL) -m 555 "$${f}" "$(DESTDIR)$(sbindir)" ; \
+ fi
+
+
+diff -uNr antlr-2.7.7.orig/Makefile.in antlr-2.7.7/Makefile.in
+--- antlr-2.7.7.orig/Makefile.in 2006-11-01 22:37:18.000000000 +0100
++++ antlr-2.7.7/Makefile.in 2006-11-07 23:21:49.133211249 +0100
+@@ -124,16 +124,16 @@
+ extradir = $(datadir)/$(versioneddir)
+
+ install ::
+- $(MKDIR) -p "$(bindir)"
+- $(MKDIR) -p "$(extradir)"
+- $(MKDIR) -p "$(docdir)"
+- $(INSTALL) -m 755 scripts/run-antlr "$(bindir)/antlr"
+- $(INSTALL) -m 755 scripts/antlr-config "$(bindir)/antlr-config"
+- $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-mode.el "$(extradir)"
+- $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-jedit.xml "$(extradir)"
+- $(INSTALL) -m 444 @abs_top_srcdir@/LICENSE.txt "$(docdir)"
+- $(INSTALL) -m 444 @abs_top_srcdir@/README.txt "$(docdir)"
+- $(INSTALL) -m 444 @abs_top_srcdir@/INSTALL.txt "$(docdir)"
++ $(MKDIR) -p "$(DESTDIR)$(bindir)"
++ $(MKDIR) -p "$(DESTDIR)$(extradir)"
++ $(MKDIR) -p "$(DESTDIR)$(docdir)"
++ $(INSTALL) -m 755 scripts/run-antlr "$(DESTDIR)$(bindir)/antlr"
++ $(INSTALL) -m 755 scripts/antlr-config "$(DESTDIR)$(bindir)/antlr-config"
++ $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-mode.el "$(DESTDIR)$(extradir)"
++ $(INSTALL) -m 444 @abs_top_srcdir@/extras/antlr-jedit.xml "$(DESTDIR)$(extradir)"
++ $(INSTALL) -m 444 @abs_top_srcdir@/LICENSE.txt "$(DESTDIR)$(docdir)"
++ $(INSTALL) -m 444 @abs_top_srcdir@/README.txt "$(DESTDIR)$(docdir)"
++ $(INSTALL) -m 444 @abs_top_srcdir@/INSTALL.txt "$(DESTDIR)$(docdir)"
+
+ install ::
+ @ECHO@ "installation done"
diff --git a/development/antlr2/antlr-2.7.7-gcc-includes.patch b/development/antlr2/antlr-2.7.7-gcc-includes.patch
new file mode 100644
index 0000000000..aa3a7921b8
--- /dev/null
+++ b/development/antlr2/antlr-2.7.7-gcc-includes.patch
@@ -0,0 +1,18 @@
+--- antlr-2.7.7/lib/cpp/antlr/CharScanner.hpp 2006-11-01 22:37:17.000000000 +0100
++++ antlr-2.7.7-patch/lib/cpp/antlr/CharScanner.hpp 2017-02-06 15:04:59.554926371 +0100
+@@ -18,10 +18,13 @@
+ #include <cctype>
+ #endif
+
+-#if ( _MSC_VER == 1200 )
+-// VC6 seems to need this
++#if ( _MSC_VER == 1200 ) || ( __GNUC__ )
++// VC6 and GCC seem to need this
+ // note that this is not a standard C++ include file.
+ # include <stdio.h>
++#if ( __GNUC__ )
++#include <strings.h>
++#endif
+ #endif
+
+ #include <antlr/TokenStream.hpp>
diff --git a/development/antlr2/antlr2.SlackBuild b/development/antlr2/antlr2.SlackBuild
new file mode 100644
index 0000000000..107729cc81
--- /dev/null
+++ b/development/antlr2/antlr2.SlackBuild
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+# Slackware build script for antlr2
+
+# 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=antlr2
+BASENAM=antlr
+VERSION=${VERSION:-2.7.7}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+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/$BASENAM-$VERSION.tar.gz
+cd $BASENAM-$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 {} \;
+
+# Fix compilation errors caused by missing includes
+patch -Np1 -i $CWD/antlr-2.7.7-gcc-includes.patch
+
+# Fix make install with DESTDIR
+patch -Np1 -i $CWD/antlr-2.7.7-DESTDIR.patch
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --includedir=/usr/include \
+ --mandir=/usr/man \
+ --disable-debug \
+ --disable-examples \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$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
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+mv $PKG/usr/share/doc/$BASENAM-$VERSION/* $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -rf $PKG/usr/share/doc/
+
+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/antlr2/antlr2.info b/development/antlr2/antlr2.info
new file mode 100644
index 0000000000..526c6fa741
--- /dev/null
+++ b/development/antlr2/antlr2.info
@@ -0,0 +1,10 @@
+PRGNAM="antlr2"
+VERSION="2.7.7"
+HOMEPAGE="http://www.antlr2.org/"
+DOWNLOAD="http://www.antlr2.org/download/antlr-2.7.7.tar.gz"
+MD5SUM="01cc9a2a454dd33dcd8c856ec89af090"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Marcel Steinbeck"
+EMAIL="marcel dot steinbeck at googlemail dot com"
diff --git a/development/antlr2/slack-desc b/development/antlr2/slack-desc
new file mode 100644
index 0000000000..8645aadbb6
--- /dev/null
+++ b/development/antlr2/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------------------------------------------------------|
+antlr2: antlr2 (a parser generator that uses LL(*) for parsing)
+antlr2:
+antlr2: ANTLR (ANother Tool for Language Recognition) is a powerful parser
+antlr2: generator for reading, processing, executing, or translating
+antlr2: structured text or binary files.
+antlr2:
+antlr2: http://www.antlr2.org/
+antlr2:
+antlr2:
+antlr2:
+antlr2: