aboutsummaryrefslogtreecommitdiff
path: root/development/JAForth
diff options
context:
space:
mode:
Diffstat (limited to 'development/JAForth')
-rw-r--r--development/JAForth/JAForth.SlackBuild127
-rw-r--r--development/JAForth/JAForth.info12
-rw-r--r--development/JAForth/README41
-rw-r--r--development/JAForth/slack-desc19
4 files changed, 199 insertions, 0 deletions
diff --git a/development/JAForth/JAForth.SlackBuild b/development/JAForth/JAForth.SlackBuild
new file mode 100644
index 0000000000..e35059bb02
--- /dev/null
+++ b/development/JAForth/JAForth.SlackBuild
@@ -0,0 +1,127 @@
+#!/bin/bash
+
+# Slackware build script for JAForth
+
+# Copyright 2025 Antonio Leal, Porto Salvo, Oeiras, Portugal
+# 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=JAForth
+VERSION=${VERSION:-20250115_bfedbd4}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+TARBALL=bfedbd4263e5df4e79bd8b897c00e235da3f3319
+
+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"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+else
+ SLKCFLAGS="-O2"
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf ${PRGNAM}-${VERSION}
+
+for f in $(ls -1 $CWD/*.tar.gz)
+do
+ tar xvfz $f
+done
+
+mv jaforth ${PRGNAM}-${VERSION}
+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 {} \;
+
+make CCFLAGS="$SLKCFLAGS"
+
+mkdir -p $PKG/opt/$PRGNAM
+install -D -m0755 JAForth.py $PKG/opt/$PRGNAM/JAForth.py
+install -D -m0755 JADecompile.py $PKG/opt/$PRGNAM/JADecompile.py
+install -D -m0755 jforth $PKG/opt/$PRGNAM/jforth
+cp -avxu tests $PKG/opt/$PRGNAM
+mv $TMP/ace.rom $PKG/opt/$PRGNAM
+
+mkdir -p $PKG/usr/bin
+cat << EOF > $PKG/usr/bin/JAForth
+#!/bin/bash
+
+cd /opt/JAForth
+python3 JAForth.py
+EOF
+chmod +x $PKG/usr/bin/JAForth
+cat << EOF > $PKG/usr/bin/JADecompile
+#!/bin/bash
+
+cd /opt/JAForth
+python3 JADecompile.py
+EOF
+chmod +x $PKG/usr/bin/JADecompile
+cat << EOF > $PKG/usr/bin/jforth
+#!/bin/bash
+
+cd /opt/JAForth
+./jforth
+EOF
+chmod +x $PKG/usr/bin/jforth
+
+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 \
+ README.md z80.h z80.c \
+ $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/JAForth/JAForth.info b/development/JAForth/JAForth.info
new file mode 100644
index 0000000000..68c0e7eec7
--- /dev/null
+++ b/development/JAForth/JAForth.info
@@ -0,0 +1,12 @@
+PRGNAM="JAForth"
+VERSION="20250115_bfedbd4"
+HOMEPAGE="https://codeberg.org/pgimeno/JAForth"
+DOWNLOAD="https://codeberg.org/pgimeno/JAForth/archive/bfedbd4263e5df4e79bd8b897c00e235da3f3319.tar.gz \
+ https://raw.githubusercontent.com/antonioleal/myslackbuilds/main/development/JAForth/ace.rom.tar.gz"
+MD5SUM="8df88292d166e6f10ba275140b80e8bd \
+ 93882b96ba1d9f0420f4fb46fea928e5"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Antonio Leal"
+EMAIL="antonioleal@yahoo.com"
diff --git a/development/JAForth/README b/development/JAForth/README
new file mode 100644
index 0000000000..420130a39e
--- /dev/null
+++ b/development/JAForth/README
@@ -0,0 +1,41 @@
+A set of programs written Pedro Gimeno, and offered under the Expat
+license (one of the many MIT licenses).
+
+This package contains three command-line programs:
+
+- JAForth: An interpreter for the Jupiter ACE Forth, written in
+Python, that can also compile to a Jupiter-format or Spectrum-format
+.TAP tape file.
+- jforth: A headless Jupiter ACE emulator which runs the Jupiter ACE
+Forth, reading the input from a file and writing the output to
+standard output.
+- JADecompile: A Jupiter ACE Forth .TAP decompiler.
+
+The first two do more or less the same. While the second was written
+with the sole purpose of validating the first, it turned out to cover
+almost the same functionality as the Python version.
+
+Which one do you need? Well, the Python version is autonomous - you
+only need a Python interpreter in your machine (2.7 or 3); you don't
+even need the ACE ROM. Python interpreters come bundled by default
+in most systems nowadays, including Linux, Windows, OSX, BSD and
+whatnot; if yours is one of these rare cases where there isn't one,
+you can grab a pre-built binary or even compile it from source.
+
+On the other hand, the headless emulator (jforth) requires a ROM
+(named ace.rom and present in the current directory), a C compiler,
+and GNU make to build. The accuracy is of course guaranteed, but
+since it was used to test the accuracy of the Python interpreter,
+I'd say the Python version is on par in accuracy.
+
+JAForth.py can't run Z80 code because it's not an emulator, while
+jforth can. Not that there's much need for that in a tool that is
+aimed at compiling, anyway.
+
+JADecompile.py is a simple Forth decompiler. It's not very accurate
+but it more or less does the job. Unlike the LIST command, it can
+list (to an extent) words defined with VARIABLE, CONSTANT, CREATE
+and VOCABULARY, and it can handle multiple vocabularies. It can
+detect words created with DEFINER but it doesn't know how to write
+them properly (e.g. if they invoke WORD), so it just lists their
+parameter field if there's one.
diff --git a/development/JAForth/slack-desc b/development/JAForth/slack-desc
new file mode 100644
index 0000000000..8ce1b441b7
--- /dev/null
+++ b/development/JAForth/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------------------------------------------------------|
+JAForth: JAForth (An interpreter for the Jupiter ACE Forth)
+JAForth:
+JAForth: This package contains three command-line programs:
+JAForth: - JAForth: An interpreter for the Jupiter ACE Forth, written in
+JAForth: Python, that can also compile to a Jupiter-format or Spectrum-format
+JAForth: .TAP tape file.
+JAForth: - jforth: A headless Jupiter ACE emulator which runs the Jupiter ACE
+JAForth: Forth, reading the input from a file and writing the output to
+JAForth: standard output.
+JAForth: - JADecompile: A Jupiter ACE Forth .TAP decompiler.
+JAForth: