development/s9fes: Added (interpreter for R4RS Scheme).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
rc_05 2024-06-17 07:15:42 +07:00 committed by Willy Sudiarto Raharjo
parent 7d70e521c5
commit e59a69a76e
No known key found for this signature in database
GPG key ID: 3F617144D7238786
6 changed files with 198 additions and 0 deletions

3
development/s9fes/README Normal file
View file

@ -0,0 +1,3 @@
S9fES is a mature, portable, and comprehensible interpreter for R4RS Scheme.
The core interpreter is written in pure ANSI C (C89), so it runs on all
platforms offering a C compiler.

View file

@ -0,0 +1,15 @@
--- Makefile 2021-06-15 19:09:02.000000000 +0200
+++ Makefile.new 2024-06-15 22:59:28.311511715 +0200
@@ -3,8 +3,11 @@
# By Nils M Holm, 2007-2018
# In the public domain
+# Destination directory for installation.
+DESTDIR=
+
# Change at least this line:
-PREFIX= /u
+PREFIX= $(DESTDIR)/usr
# Base version and Release
BASE= 20181115

View file

@ -0,0 +1,41 @@
--- s9core.c 2019-04-02 10:45:31.000000000 +0200
+++ s9core.c.new 2024-06-15 22:39:10.836498069 +0200
@@ -2642,10 +2642,12 @@
int s9_open_input_port(char *path) {
int i = s9_new_port();
+ char *res_path = realpath(path, NULL);
if (i < 0)
return -1;
- Ports[i] = fopen(path, "r");
+ Ports[i] = fopen(res_path, "r");
+ free(res_path);
if (Ports[i] == NULL)
return -1;
return i;
@@ -2653,10 +2655,12 @@
int s9_open_output_port(char *path, int append) {
int i = s9_new_port();
+ char *res_path = realpath(path, NULL);
if (i < 0)
return -1;
Ports[i] = fopen(path, append? "a": "w");
+ free(res_path);
if (Ports[i] == NULL)
return -1;
return i;
@@ -2924,8 +2928,10 @@
struct magic m;
int image_nodes, image_vcells;
char *s;
+ char *res_path = realpath(path, NULL);
- f = fopen(path, "rb");
+ f = fopen(res_path, "rb");
+ free(res_path);
if (f == NULL)
return "could not open file";
if ((s = xfread(&m, sizeof(m), 1, f)) != NULL)

View file

@ -0,0 +1,110 @@
#!/bin/bash
# Slackware build script for s9fes
# Copyright 2024 rc_05 <contact@rc-05.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=s9fes
VERSION=${VERSION:-20181205}
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"
elif [ "$ARCH" = "aarch64" ]; 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 s9
tar xvf $CWD/$PRGNAM-$VERSION.tgz
cd s9
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 {} \;
# For this oneliner a patch is not needed.
sed -i "s_:/usr/local/share/s9fes_:/usr/share/s9fes_" s9.c
for p in `ls $CWD/patches`; do
patch < $CWD/patches/$p
done
make all
make install-s9 DESTDIR=$PKG
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
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
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
HISTORY LICENSE MASCOT.png PREHISTORY README README.s9core TODO \
$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

View file

@ -0,0 +1,10 @@
PRGNAM="s9fes"
VERSION="20181205"
HOMEPAGE="https://t3x.org/s9fes/"
DOWNLOAD="https://t3x.org/s9fes/s9fes-20181205.tgz"
MD5SUM="1a9c137c40e3c74cf892e24366ea2d93"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="%README%"
MAINTAINER="rc_05"
EMAIL="contact@rc-05.com"

View file

@ -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------------------------------------------------------|
s9fes: s9fes (Scheme 9 from Outer Space)
s9fes:
s9fes: S9fES is a mature, portable, and comprehensible interpreter for
s9fes: R4RS Scheme.
s9fes:
s9fes: The core interpreter is written in pure ANSI C (C89),
s9fes: so it runs on all platforms offering a C compiler.
s9fes:
s9fes: Homepage: https://t3x.org/s9fes/
s9fes:
s9fes: