aboutsummaryrefslogtreecommitdiff
path: root/development/zxbasic
diff options
context:
space:
mode:
Diffstat (limited to 'development/zxbasic')
-rw-r--r--development/zxbasic/README27
-rw-r--r--development/zxbasic/slack-desc19
-rw-r--r--development/zxbasic/zxbasic.SlackBuild127
-rw-r--r--development/zxbasic/zxbasic.info12
-rw-r--r--development/zxbasic/zxbasm3
-rw-r--r--development/zxbasic/zxbc3
-rw-r--r--development/zxbasic/zxbpp3
7 files changed, 194 insertions, 0 deletions
diff --git a/development/zxbasic/README b/development/zxbasic/README
new file mode 100644
index 0000000000..dc1a475b58
--- /dev/null
+++ b/development/zxbasic/README
@@ -0,0 +1,27 @@
+ZX BASIC is a BASIC "cross compiler". It will compile BASIC
+programs (in your PC) for your ZX Spectrum. ZX BASIC is an
+SDK entirely written in python. The SDK is implemented using
+the PLY (Python Lex/Yacc) compiler tool. It translates BASIC
+to Z80 assembler code, so it is easily portable to other Z80
+platforms (Amstrad, MSX). Other non Z80 targets could also
+be available in the future.
+
+ZX BASIC syntax tries to maintain compatibility as much as
+possible with Sinclair BASIC, it also have many new features,
+mostly taken from FreeBASIC dialect.
+
+ZX Basic is also know as "Boriel Basic" in reference to its
+creator, Jose Rodriguez "Boriel".
+
+This Slackware package provides the following commands
+
+- zxbc
+- zxbpp
+- zxbasm
+
+usage example:
+zxbc -taB zxbc /usr/doc/zxbasic-1.18.1/examples/pong.bas
+
+generates the file pong.tap which is a ZXSpectrum tape.
+Now use the fuse-emulator (available at SlackBuilds.org) for
+example, to play the pong game.
diff --git a/development/zxbasic/slack-desc b/development/zxbasic/slack-desc
new file mode 100644
index 0000000000..9b0eaaee3e
--- /dev/null
+++ b/development/zxbasic/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------------------------------------------------------|
+zxbasic: zxbasic (basic compiler for ZXSpectrum)
+zxbasic:
+zxbasic: ZX BASIC is a BASIC "cross compiler". It will compile BASIC
+zxbasic: programs (in your PC) for your ZX Spectrum. ZX BASIC is an
+zxbasic: SDK entirely written in python. The SDK is implemented using
+zxbasic: the PLY (Python Lex/Yacc) compiler tool. It translates BASIC
+zxbasic: to Z80 assembler code, so it is easily portable to other Z80
+zxbasic: platforms (Amstrad, MSX). Other non Z80 targets could also
+zxbasic: be available in the future.
+zxbasic:
+zxbasic:
diff --git a/development/zxbasic/zxbasic.SlackBuild b/development/zxbasic/zxbasic.SlackBuild
new file mode 100644
index 0000000000..164c0eb823
--- /dev/null
+++ b/development/zxbasic/zxbasic.SlackBuild
@@ -0,0 +1,127 @@
+#!/bin/bash
+
+# Slackware build script for zxbasic
+
+# 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=zxbasic
+VERSION=${VERSION:-1.18.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+PYTHONTARBALL=Python-3.13.3
+
+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 $PYTHONTARBALL
+tar xfz $CWD/$PYTHONTARBALL.tgz
+tar xfz $CWD/$PRGNAM-$VERSION.tar.gz
+
+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 {} \;
+
+cd $PYTHONTARBALL
+./configure --prefix=/opt/zxbasic/python --with-ensurepip=no
+CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" make -j8
+make install DESTDIR=$PKG
+rm -rf $PKG/opt/zxbasic/python/lib/python3.13/site-packages/pip
+rm -rf $PKG/opt/zxbasic/python/share
+rm -rf $PKG/opt/zxbasic/python/include
+
+cd ../$PRGNAM-$VERSION
+mkdir -p $PKG/opt/zxbasic/python
+cp -avxu CNAME \
+ benchmarks \
+ img \
+ mkdocs.yml \
+ poetry.lock \
+ pyproject.toml \
+ src \
+ tests \
+ tools \
+ zxbasm.py \
+ zxbc.py \
+ zxbpp.py \
+ $PKG/opt/zxbasic
+
+mkdir -p $PKG/usr/bin
+install -T -m0755 $CWD/zxbc $PKG/usr/bin/zxbc
+install -T -m0755 $CWD/zxbpp $PKG/usr/bin/zxbpp
+install -T -m0755 $CWD/zxbasm $PKG/usr/bin/zxbasm
+
+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
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cp -axvu CHANGELOG.md \
+ CODE_OF_CONDUCT.md \
+ LICENSE.txt \
+ README.md \
+ docs \
+ examples \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+
+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/zxbasic/zxbasic.info b/development/zxbasic/zxbasic.info
new file mode 100644
index 0000000000..f0d1859057
--- /dev/null
+++ b/development/zxbasic/zxbasic.info
@@ -0,0 +1,12 @@
+PRGNAM="zxbasic"
+VERSION="1.18.1"
+HOMEPAGE="https://zxbasic.readthedocs.io"
+DOWNLOAD="https://github.com/boriel-basic/zxbasic/archive/v1.18.1/zxbasic-1.18.1.tar.gz \
+ https://www.python.org/ftp/python/3.13.3/Python-3.13.3.tgz"
+MD5SUM="8fec927af0cc03027b0a6d3898e991fb \
+ b3d8c043dcdd52d55d48769a95c8e7d1"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Antonio Leal"
+EMAIL="antonioleal@yahoo.com"
diff --git a/development/zxbasic/zxbasm b/development/zxbasic/zxbasm
new file mode 100644
index 0000000000..5221cc826e
--- /dev/null
+++ b/development/zxbasic/zxbasm
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/opt/zxbasic/python/bin/python3.13 /opt/zxbasic/zxbasm.py "$@"
diff --git a/development/zxbasic/zxbc b/development/zxbasic/zxbc
new file mode 100644
index 0000000000..4434a4fe9e
--- /dev/null
+++ b/development/zxbasic/zxbc
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/opt/zxbasic/python/bin/python3.13 /opt/zxbasic/zxbc.py "$@"
diff --git a/development/zxbasic/zxbpp b/development/zxbasic/zxbpp
new file mode 100644
index 0000000000..e4994befd6
--- /dev/null
+++ b/development/zxbasic/zxbpp
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+/opt/zxbasic/python/bin/python3.13 /opt/zxbasic/zxbpp.py "$@"