summaryrefslogtreecommitdiffstats
path: root/development/tinyscheme
diff options
context:
space:
mode:
Diffstat (limited to 'development/tinyscheme')
-rw-r--r--development/tinyscheme/README11
-rw-r--r--development/tinyscheme/scheme.c.patch11
-rw-r--r--development/tinyscheme/slack-desc19
-rw-r--r--development/tinyscheme/tinyscheme.SlackBuild110
-rw-r--r--development/tinyscheme/tinyscheme.info10
5 files changed, 161 insertions, 0 deletions
diff --git a/development/tinyscheme/README b/development/tinyscheme/README
new file mode 100644
index 0000000000..28d8c867d5
--- /dev/null
+++ b/development/tinyscheme/README
@@ -0,0 +1,11 @@
+TinyScheme is a lightweight Scheme interpreter that implements as large
+subset of R5RS as was possible without getting very large and complicated.
+It's meant to be used as an embedded scripting interpreter for
+other programs. As such, it does not offer IDEs or extensive toolkits
+although it does sport a small top-level loop, included conditionally.
+A lot of functionality in TinyScheme is included conditionally,
+to allow developers freedom in balancing features and footprint.
+
+The compiled binary is installed as "tinyscheme" instead of "scheme" in
+order to avoid possible conflicts with other Scheme implementations that
+might be installed in the user's system.
diff --git a/development/tinyscheme/scheme.c.patch b/development/tinyscheme/scheme.c.patch
new file mode 100644
index 0000000000..9c05d95c5d
--- /dev/null
+++ b/development/tinyscheme/scheme.c.patch
@@ -0,0 +1,11 @@
+--- scheme.c 2020-05-30 04:37:00.000000000 +0200
++++ scheme.c.patched 2023-08-25 16:27:06.630913191 +0200
+@@ -101,7 +101,7 @@
+ #endif
+
+ #ifndef InitFile
+-# define InitFile "init.scm"
++# define InitFile "/usr/share/tinyscheme/init.scm"
+ #endif
+
+ #ifndef FIRST_CELLSEGS
diff --git a/development/tinyscheme/slack-desc b/development/tinyscheme/slack-desc
new file mode 100644
index 0000000000..2c5964129b
--- /dev/null
+++ b/development/tinyscheme/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------------------------------------------------------|
+tinyscheme: tinyscheme (Scheme R5RS implementation)
+tinyscheme:
+tinyscheme: TinyScheme is a lightweight Scheme interpreter that implements as
+tinyscheme: large a subset of R5RS as was possible without getting very large
+tinyscheme: and complicated. It is meant to be used as an embedded scripting
+tinyscheme: interpreter for other programs.
+tinyscheme:
+tinyscheme: Homepage: https://tinyscheme.sourceforge.net/
+tinyscheme:
+tinyscheme:
+tinyscheme:
diff --git a/development/tinyscheme/tinyscheme.SlackBuild b/development/tinyscheme/tinyscheme.SlackBuild
new file mode 100644
index 0000000000..fac508e66c
--- /dev/null
+++ b/development/tinyscheme/tinyscheme.SlackBuild
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+# Slackware build script for tinyscheme
+
+# Copyright 2023 rc-05 <rc_o5@protonmail.com>
+# 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.
+
+cd $(dirname $0); CWD=$(pwd)
+
+PRGNAM=tinyscheme
+VERSION=${VERSION:-1.42}
+BUILD=${BUILD:-2}
+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 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 {} \;
+
+
+patch < $CWD/scheme.c.patch
+CC=${CC:-gcc}
+SLKCFLAGS+=' -DUSE_INTERFACE=1'
+make CC="${CC} ${SLKCFLAGS}"
+
+(
+mkdir -p $PKG/usr/bin $PKG/usr/lib$LIBDIRSUFFIX $PKG/usr/share/tinyscheme $PKG/usr/include/tinyscheme
+
+# Rename the binary to tinyscheme to avoid conflicts with (eventual) other
+# possible Scheme implemenations installed in the system.
+cp scheme $PKG/usr/bin/tinyscheme
+
+cp libtinyscheme.so $PKG/usr/lib$LIBDIRSUFFIX
+cp init.scm $PKG/usr/share/tinyscheme
+cp -t $PKG/usr/include/tinyscheme scheme.h scheme-private.h opdefines.h
+)
+
+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 \
+ CHANGES COPYING Manual.txt MiniSCHEMETribute.txt \
+ $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
diff --git a/development/tinyscheme/tinyscheme.info b/development/tinyscheme/tinyscheme.info
new file mode 100644
index 0000000000..c538a2bf6c
--- /dev/null
+++ b/development/tinyscheme/tinyscheme.info
@@ -0,0 +1,10 @@
+PRGNAM="tinyscheme"
+VERSION="1.42"
+HOMEPAGE="https://tinyscheme.sourceforge.net/"
+DOWNLOAD="https://downloads.sourceforge.net/project/tinyscheme/tinyscheme/tinyscheme-1.42/tinyscheme-1.42.tar.gz"
+MD5SUM="273ac5ffe5305986b329e9045f2aea89"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="rc-05"
+EMAIL="rc_o5@protonmail.com"