development/bacon: Added (BASIC to C translator)
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
66eef9bc90
commit
ebcdad8477
|
@ -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.
|
|
@ -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
|
|
@ -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"
|
|
@ -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
|
|
@ -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:
|
Loading…
Reference in New Issue