summaryrefslogtreecommitdiffstats
path: root/development/bacon
diff options
context:
space:
mode:
author B. Watson2023-05-05 00:29:39 +0200
committer Willy Sudiarto Raharjo2023-05-06 03:28:25 +0200
commitebcdad84772075f6cc7165ae225678152fe44a90 (patch)
treeb890ae7511e3f9279cd8894dba509fd2872b895f /development/bacon
parent66eef9bc9001f878bd1fe4116dd75694042cce5f (diff)
downloadslackbuilds-ebcdad84772075f6cc7165ae225678152fe44a90.tar.gz
development/bacon: Added (BASIC to C translator)
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/bacon')
-rw-r--r--development/bacon/README20
-rw-r--r--development/bacon/bacon.SlackBuild145
-rw-r--r--development/bacon/bacon.info10
-rw-r--r--development/bacon/doinst.sh9
-rw-r--r--development/bacon/slack-desc19
5 files changed, 203 insertions, 0 deletions
diff --git a/development/bacon/README b/development/bacon/README
new file mode 100644
index 0000000000..121f2c54bd
--- /dev/null
+++ b/development/bacon/README
@@ -0,0 +1,20 @@
+bacon (BASIC to C translator)
+
+BaCon is a free BASIC to C translator for Unix-based systems. It
+intends to be a programming aid in creating tools which can be
+compiled on different platforms while trying to revive the days of the
+good old BASIC. BaCon can be described as a translator, a converter,
+a source-to-source compiler, a transcompiler or a transpiler. It also
+can be described as a very elaborate preprocessor to C.
+
+Note: BaCon only supports its own dialect of BASIC, which does not
+support line numbers. You can't use this to compile ancient code from
+the 80s.
+
+Optional dependency: fltk (autodetected). If fltk is installed at
+build time, the BaCon FLTK GUI will be built instead of the TK GUI.
+If you have fltk installed but prefer the TK GUI, export FLTK=no in
+the script's environment.
+
+Note: BaCon has a GTK+ GUI option, but it is not supported by this
+SlackBuild.
diff --git a/development/bacon/bacon.SlackBuild b/development/bacon/bacon.SlackBuild
new file mode 100644
index 0000000000..2bb0b9a7d2
--- /dev/null
+++ b/development/bacon/bacon.SlackBuild
@@ -0,0 +1,145 @@
+#!/bin/bash
+
+# Slackware build script for bacon
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=bacon
+VERSION=${VERSION:-4.6.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+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-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# The --enable-gui-* and --disable-gui-* don't actually work.
+# We can't run autoreconf either (fails).
+# The intent here is to build the fltk gui if fltk is installed and
+# not disabled with FLTK=no, or the tk gui if fltk is missing or
+# disabled.
+# Either way, we don't currently support the gtk 2 gui (it depends
+# on webkitgtk 2.x, which is outdated and gone from our repo) or the
+# gtk 3 gui (because I don't feel like dealing with webkit2gtk as a
+# dependency, not even an optional one).
+if [ "${FLTK:-yes}" = "yes" -a -x /usr/bin/fltk-config ]; then
+ GUI="FLTK=true TK=false GTK3=false GTK2=false"
+ GUITYPE=FLTK
+else
+ GUI="FLTK=false TK=true GTK3=false GTK2=false"
+ GUITYPE=TK
+fi
+
+# Keep the .xbm icon in a private directory, so nothing else accidentally
+# uses it (it's ugly).
+sed -i 's,/share/pixmaps/,/share/BaCon/,' bacon.bac
+
+# I use this when editing the script, to avoid the 5+ minute build time.
+# The C implementation is thousands of times faster than the shell script.
+if [ "${CHEAT:-no}" = "yes" -a -x /usr/bin/bacon ]; then
+ sed -i 's,\$(BSHELL) \./bacon\.sh,/usr/bin/bacon,' /tmp/SBo/bacon-4.6.1/Makefile.in
+fi
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --with-bash \
+ --build=$ARCH-slackware-linux
+
+# The -j1 really is needed here. Anyway the build process has a
+# 5+ minute "Converting 'bacon.bac'" that has to finish before
+# the other make targets can begin, so patching the Makefile to
+# support parallelism wouldn't actually speed it up noticeably.
+# The fakehome stuff is to keep it from creating or reading a
+# /root/.bacon/bacon.cfg file (we don't want to write outside of $TMP).
+mkdir -p `pwd`/fakehome
+HOME=`pwd`/fakehome make -j1 $GUI
+make -j1 install DESTDIR=$PKG $GUI
+
+gzip -9 $PKG/usr/man/man*/*
+
+# This is where we patched it to look for this icon:
+mv $PKG/usr/share/pixmaps/BaCon.xbm $PKG/usr/share/BaCon/
+
+# I should really do the whole /usr/share/icons and pre-scale them,
+# but for now:
+sed -i '/^Icon/s,\(=\)\(.*\),\1/usr/share/pixmaps/\2.png,' \
+ $PKG/usr/share/applications/*.desktop
+
+# The GUI has the documentation path baked in, so symlink it to the
+# the Slackware doc dir.
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a README* $PKGDOC
+ln -s ../../share/BaCon/documentation $PKGDOC/documentation
+ln -s ../../share/BaCon/LICENSE $PKGDOC/LICENSE
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+# The encscript synax file (bacon.st) gets installed to the right place.
+# Move the others to the right places.
+mkdir -p $PKG/usr/share/vim/vimfiles/syntax/
+mv $PKG/usr/share/BaCon/syntax/bacon.vim $PKG/usr/share/vim/vimfiles/syntax/bacon.vim
+mkdir -p $PKG/usr/share/gtksourceview-3.0/language-specs/
+mv $PKG/usr/share/BaCon/syntax/bacon.lang $PKG/usr/share/gtksourceview-3.0/language-specs/bacon.lang
+
+# The vim syntax file works, but won't be used automatically without this:
+mkdir -p $PKG/usr/share/vim/vimfiles/ftdetect
+echo "au! BufRead,BufNewFile *.bac,*.bacon setfiletype bacon" > \
+ $PKG/usr/share/vim/vimfiles/ftdetect/bacon.vim
+
+mkdir -p $PKG/install
+sed "s,@GUITYPE@,$GUITYPE," < $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/bacon/bacon.info b/development/bacon/bacon.info
new file mode 100644
index 0000000000..4605e392b5
--- /dev/null
+++ b/development/bacon/bacon.info
@@ -0,0 +1,10 @@
+PRGNAM="bacon"
+VERSION="4.6.1"
+HOMEPAGE="http://www.basic-converter.org/"
+DOWNLOAD="http://www.basic-converter.org/stable/bacon-4.6.1.tar.gz"
+MD5SUM="d639d7d287cf55df101abd0ab13be6ce"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/development/bacon/doinst.sh b/development/bacon/doinst.sh
new file mode 100644
index 0000000000..3e5691a052
--- /dev/null
+++ b/development/bacon/doinst.sh
@@ -0,0 +1,9 @@
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/development/bacon/slack-desc b/development/bacon/slack-desc
new file mode 100644
index 0000000000..48770a2c95
--- /dev/null
+++ b/development/bacon/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------------------------------------------------------|
+bacon: bacon (BASIC to C translator)
+bacon:
+bacon: BaCon is a free BASIC to C translator for Unix-based systems. It
+bacon: intends to be a programming aid in creating tools which can be
+bacon: compiled on different platforms while trying to revive the days of the
+bacon: good old BASIC. BaCon can be described as a translator, a converter,
+bacon: a source-to-source compiler, a transcompiler or a transpiler. It also
+bacon: can be described as a very elaborate preprocessor to C.
+bacon:
+bacon: This package built with the @GUITYPE@ GUI.
+bacon: