diff options
Diffstat (limited to 'development/bbcsdl')
-rw-r--r-- | development/bbcsdl/README | 30 | ||||
-rw-r--r-- | development/bbcsdl/bbc256x.png | bin | 0 -> 2172 bytes | |||
-rw-r--r-- | development/bbcsdl/bbcsdl.SlackBuild | 142 | ||||
-rw-r--r-- | development/bbcsdl/bbcsdl.desktop | 10 | ||||
-rw-r--r-- | development/bbcsdl/bbcsdl.info | 14 | ||||
-rw-r--r-- | development/bbcsdl/doinst.sh | 13 | ||||
-rw-r--r-- | development/bbcsdl/makefile-console-32.patch | 13 | ||||
-rw-r--r-- | development/bbcsdl/makefile-console-64.patch | 13 | ||||
-rw-r--r-- | development/bbcsdl/makefile-sdl-32.patch | 50 | ||||
-rw-r--r-- | development/bbcsdl/slack-desc | 19 |
10 files changed, 304 insertions, 0 deletions
diff --git a/development/bbcsdl/README b/development/bbcsdl/README new file mode 100644 index 0000000000..98664a7629 --- /dev/null +++ b/development/bbcsdl/README @@ -0,0 +1,30 @@ +BBC BASIC for SDL 2.0 (BBCSDL) is an entirely free and Open Source +cross-platform implementation of BBC BASIC for Windows, MacOS, +Linux (x86 CPU only), Raspberry Pi OS (RPi3 or later), Android, +iOS or for running in a browser. +It combines the simplicity of BASIC with the sophistication of a +structured language, allowing you to write utilities and games, +use sound and graphics, and perform calculations. +The Desktop editions (Windows, MacOS, Linux, Raspberry Pi) +include a BASIC program editor with syntax colouring, live +indentation, search & replace and many other features. +Built-in diagnostic aids such as run-time trace, listing of +variables, single-step execution and a profiler make debugging +even the most complex programs straightforward. + +This package installs to /opt/bbcsdl and is a rebuild of the open +sources available at https://github.com/rtrussell/BBCSDL + +The Box2D (Box2D321.so) libraries: +- 64 bits md5 215bbda5d9a92a5cc99534de4e1235aa and +- 32 bits md5 f079027b8e2589a10fd17eca77e644f7 +are bundled with the original release by R.T.Russell available +at https://www.bbcbasic.co.uk/bbcsdl/bbclinux.zip. +This SlackBuild includes it as a separate download from the +package maintainer github account as it is not packaged with +program sources. If you do not need it you can exclude the +library by passing BOX2D=no like this: + +BOX2D=no ./bbcsdl.SlackBuild + +Many program examples are installed at /opt/bbcsdl/examples/ diff --git a/development/bbcsdl/bbc256x.png b/development/bbcsdl/bbc256x.png Binary files differnew file mode 100644 index 0000000000..2c2cd13d9e --- /dev/null +++ b/development/bbcsdl/bbc256x.png diff --git a/development/bbcsdl/bbcsdl.SlackBuild b/development/bbcsdl/bbcsdl.SlackBuild new file mode 100644 index 0000000000..b874c8460b --- /dev/null +++ b/development/bbcsdl/bbcsdl.SlackBuild @@ -0,0 +1,142 @@ +#!/bin/bash + +# Slackware build script for bbcsdl + +# Copyright 2024 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=bbcsdl +VERSION=${VERSION:-1.39a} +BUILD=${BUILD:-3} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} +TARBALL=${TARBALL:-BBCSDL-9518dca38626288a9035936bf0742e9d811e72e8} + +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 xvfz $CWD/$TARBALL.tar.gz +mv $TARBALL $PRGNAM-$VERSION +cd $PRGNAM-$VERSION + +# Patch makefiles +if [ "$ARCH" = "x86_64" ]; then + patch console/linux/makefile $CWD/makefile-console-64.patch +fi +if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then + patch console/linux/makefile $CWD/makefile-console-32.patch + patch bin/linux/makefile $CWD/makefile-sdl-32.patch +fi + +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 {} \; + +# Build sdl and console versions +cd bin/linux +make +cd ../../console/linux +make +cd ../.. + +# Setup package files +mkdir -p $PKG/usr/bin $PKG/opt/$PRGNAM $PKG/usr/share/pixmaps $PKG/usr/share/applications + +install -D -m0755 bbcsdl $PKG/opt/$PRGNAM/bbcsdl +install -D -m0755 libstb.so $PKG/opt/$PRGNAM/libstb.so +install -D -m0755 bbcbasic $PKG/opt/$PRGNAM/bbcbasic +cp bbcsdl.bbc $PKG/opt/$PRGNAM/ +cp -avxu lib $PKG/opt/$PRGNAM/ +cp -avxu examples $PKG/opt/$PRGNAM/ + +# Optionally exclude the Box2D library +if [ "${BOX2D:-yes}" = "yes" ]; then + if [ "$ARCH" = "x86_64" ]; then + #MD5 215bbda5d9a92a5cc99534de4e1235aa + tar xvfz $CWD/Box2D231_64.tar.gz + fi + if [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then + #MD5 f079027b8e2589a10fd17eca77e644f7 + tar xvfz $CWD/Box2D231_32.tar.gz + fi + install -D -m0755 Box2D231.so $PKG/opt/$PRGNAM/Box2D231.so +fi + +cp $CWD/bbc256x.png $PKG/usr/share/pixmaps +cp $CWD/bbcsdl.desktop $PKG/usr/share/applications + +( cd $PKG/usr/bin ; rm -rf bbcsdl ) +( cd $PKG/usr/bin ; ln -s /opt/bbcsdl/bbcsdl bbcsdl ) +( cd $PKG/usr/bin ; rm -rf bbcbasic ) +( cd $PKG/usr/bin ; ln -s /opt/bbcsdl/bbcbasic bbcbasic ) + +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 licence.txt $PKG/usr/doc/$PRGNAM-$VERSION +cp README.md $PKG/usr/doc/$PRGNAM-$VERSION + +mkdir -p $PKG/install +cat $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 diff --git a/development/bbcsdl/bbcsdl.desktop b/development/bbcsdl/bbcsdl.desktop new file mode 100644 index 0000000000..6f1ee9f081 --- /dev/null +++ b/development/bbcsdl/bbcsdl.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=BBC BASIC +GenericName=BBC BASIC +Comment=BBC BASIC for Linux +Icon=bbc256x +Exec=bbcsdl +Type=Application +Terminal=false +Categories=Development +StartupNotify=false diff --git a/development/bbcsdl/bbcsdl.info b/development/bbcsdl/bbcsdl.info new file mode 100644 index 0000000000..3837a91667 --- /dev/null +++ b/development/bbcsdl/bbcsdl.info @@ -0,0 +1,14 @@ +PRGNAM="bbcsdl" +VERSION="1.39a" +HOMEPAGE="https://www.bbcbasic.co.uk/bbcsdl" +DOWNLOAD="https://github.com/rtrussell/BBCSDL/archive/9518dca/BBCSDL-9518dca38626288a9035936bf0742e9d811e72e8.tar.gz \ + https://github.com/antonioleal/myslackbuilds/raw/main/development/bbcsdl/Box2D231_32.tar.gz" +MD5SUM="9e1403aa4716c9860215639482dfe572 \ + ccfb8ab5f63f0d3a8cec047005061a88" +DOWNLOAD_x86_64="https://github.com/rtrussell/BBCSDL/archive/9518dca/BBCSDL-9518dca38626288a9035936bf0742e9d811e72e8.tar.gz \ + https://github.com/antonioleal/myslackbuilds/raw/main/development/bbcsdl/Box2D231_64.tar.gz" +MD5SUM_x86_64="9e1403aa4716c9860215639482dfe572 \ + 3d6e27b4b1214432a43244a7bc3e615b" +REQUIRES="" +MAINTAINER="Antonio Leal" +EMAIL="antonioleal@yahoo.com" diff --git a/development/bbcsdl/doinst.sh b/development/bbcsdl/doinst.sh new file mode 100644 index 0000000000..aea0f894eb --- /dev/null +++ b/development/bbcsdl/doinst.sh @@ -0,0 +1,13 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -x /usr/bin/update-mime-database ]; then + /usr/bin/update-mime-database usr/share/mime >/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 -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/development/bbcsdl/makefile-console-32.patch b/development/bbcsdl/makefile-console-32.patch new file mode 100644 index 0000000000..43d2735d4d --- /dev/null +++ b/development/bbcsdl/makefile-console-32.patch @@ -0,0 +1,13 @@ +--- makefile 2023-11-17 22:37:21.787892000 +0000 ++++ makefile.new 2023-11-17 23:05:02.368574413 +0000 +@@ -23,8 +23,8 @@ + bbccon.o: bbccon.c bbccon.h + $(CXX) -Wno-array-bounds -Wno-unused-result -c -Os $< -o $@ + +-bbdata.o: ../../../BBCSDL/src/bbdata_x86_64.nas +- nasm -f elf64 -s ../../../BBCSDL/src/bbdata_x86_64.nas -o bbdata.o ++bbdata.o: ../../src/bbdata_x86_32.nas ++ nasm -f elf32 -s ../../src/bbdata_x86_32.nas -o bbdata.o + + bbcbasic: $(OBJ) + $(CXX) $(OBJ) -L . -L/usr/include -ldl -lm -lrt -pthread \ diff --git a/development/bbcsdl/makefile-console-64.patch b/development/bbcsdl/makefile-console-64.patch new file mode 100644 index 0000000000..1d518bfd25 --- /dev/null +++ b/development/bbcsdl/makefile-console-64.patch @@ -0,0 +1,13 @@ +--- makefile~ 2023-09-01 18:03:56.000000000 +0100 ++++ makefile 2023-09-05 20:30:45.191115440 +0100 +@@ -23,8 +23,8 @@ + bbccon.o: bbccon.c bbccon.h + $(CXX) -Wno-array-bounds -Wno-unused-result -c -Os $< -o $@ + +-bbdata.o: ../../../BBCSDL/src/bbdata_x86_64.nas +- nasm -f elf64 -s ../../../BBCSDL/src/bbdata_x86_64.nas -o bbdata.o ++bbdata.o: ../../src/bbdata_x86_64.nas ++ nasm -f elf64 -s ../../src/bbdata_x86_64.nas -o bbdata.o + + bbcbasic: $(OBJ) + $(CXX) $(OBJ) -L . -L/usr/include -ldl -lm -lrt -pthread \ diff --git a/development/bbcsdl/makefile-sdl-32.patch b/development/bbcsdl/makefile-sdl-32.patch new file mode 100644 index 0000000000..ee49430ac0 --- /dev/null +++ b/development/bbcsdl/makefile-sdl-32.patch @@ -0,0 +1,50 @@ +--- makefile.ori 2023-11-18 16:05:00.344034123 +0000 ++++ makefile 2023-11-18 18:10:30.536390339 +0000 +@@ -20,19 +20,19 @@ + all: bbcsdl + + bbmain.o: bbmain.c BBC.h +- $(CXX) -c -O2 -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ ++ $(CXX) -c -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ + + bbexec.o: bbexec.c BBC.h +- $(CXX) -c -O2 -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ ++ $(CXX) -c -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ + + bbeval.o: bbeval.c BBC.h +- $(CXX) -Wno-array-bounds -c -O2 -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ ++ $(CXX) -Wno-array-bounds -c -freg-struct-return -ffast-math -fno-finite-math-only $< -o $@ + + bbasmb.o: bbasmb_x86_64.c BBC.h + $(CXX) -c -Os $< -o $@ + + bbcmos.o: bbcmos.c bbcsdl.h +- $(CXX) -Wno-unused-result -Wno-array-bounds -c -msse2 -O2 $< -o $@ ++ $(CXX) -Wno-unused-result -Wno-array-bounds -c -msse2 $< -o $@ + + bbccli.o: bbccli.c bbcsdl.h + $(CXX) -Wno-unused-result -c -Os $< -o $@ +@@ -41,19 +41,19 @@ + $(CXX) -c -Os $< -o $@ + + bbcvtx.o: bbcvtx.c bbcsdl.h +- $(CXX) -c -O3 $< -o $@ ++ $(CXX) -c $< -o $@ + + bbcsdl.o: bbcsdl.c bbcsdl.h version.h +- $(CXX) -Wno-unused-result -c -O2 $< -o $@ ++ $(CXX) -Wno-unused-result -c $< -o $@ + + SDL2_gfxPrimitives.o: SDL2_gfxPrimitives.c SDL2_gfxPrimitives.h +- $(CXX) -c -O2 $< -o $@ ++ $(CXX) -c $< -o $@ + + SDL2_rotozoom.o: SDL2_rotozoom.c SDL2_rotozoom.h SDL2_gfxPrimitives.h SDL_stbimage.h stb_image.h dr_mp3.h + $(CXX) -c -Os -fPIC $< -o $@ + + flood.o: flood.c +- $(CXX) -c -O3 $< -o $@ ++ $(CXX) -c $< -o $@ + + ifeq ($(LBITS),64) + bbdata.o: ../../src/bbdata_x86_64.nas diff --git a/development/bbcsdl/slack-desc b/development/bbcsdl/slack-desc new file mode 100644 index 0000000000..fab52415b5 --- /dev/null +++ b/development/bbcsdl/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------------------------------------------------------| +bbcsdl: bbcsdl (BBC BASIC for linux) +bbcsdl: +bbcsdl: BBC BASIC for SDL 2.0 (BBCSDL) is an entirely free and Open Source +bbcsdl: cross-platform implementation of BBC BASIC for Windows, MacOS, +bbcsdl: Linux (x86 CPU only), Raspberry Pi OS (RPi3 or later), Android, +bbcsdl: iOS or for running in a browser. +bbcsdl: +bbcsdl: BBC BASIC is very well documented. +bbcsdl: +bbcsdl: Homepage at https://www.bbcbasic.co.uk/bbcsdl +bbcsdl: |