aboutsummaryrefslogtreecommitdiff
path: root/development/bbcsdl
diff options
context:
space:
mode:
authorAntonio Leal <antonioleal@yahoo.com>2023-09-11 15:11:23 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-09-11 15:11:23 +0700
commitdb15d0421d57b5c8a287c7e74e56dbfcefefdaab (patch)
treea4219ab1271896a772c199aca1ccbdef38b5648c /development/bbcsdl
parentf2352ec41227dba528c64573fa62ac287a292a58 (diff)
development/bbcsdl: Update script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/bbcsdl')
-rw-r--r--development/bbcsdl/README10
-rw-r--r--development/bbcsdl/bbcsdl.SlackBuild21
-rw-r--r--development/bbcsdl/makefile.patch13
3 files changed, 37 insertions, 7 deletions
diff --git a/development/bbcsdl/README b/development/bbcsdl/README
index 5e05821260c3..3c746a15ce89 100644
--- a/development/bbcsdl/README
+++ b/development/bbcsdl/README
@@ -14,13 +14,17 @@ 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
+In addition to the 'bbcsdl' the 'bbcbasic' linux console version
+of the program is also build.
The Box2D321.so library (md5 215bbda5d9a92a5cc99534de4e1235aa)
is 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. You can safely delete it if you are not
-writing 2D graphics program simulating physics.
+program sources. If you do not need it you can exclude the
+library by passing BOX2D=no like this:
-Many examples at /opt/bbcsdl/examples/
+BOX2D=no ./bbcsdl.SlackBuild
+
+Many program examples are installed at /opt/bbcsdl/examples/
diff --git a/development/bbcsdl/bbcsdl.SlackBuild b/development/bbcsdl/bbcsdl.SlackBuild
index 84e1bc9531ed..820cf9c46638 100644
--- a/development/bbcsdl/bbcsdl.SlackBuild
+++ b/development/bbcsdl/bbcsdl.SlackBuild
@@ -27,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=bbcsdl
VERSION=${VERSION:-1.37a}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
TARBALL=${TARBALL:-BBCSDL-5fbdc964becd87f31a92f87fec29c2f67cf3b908}
@@ -71,7 +71,9 @@ rm -rf $PRGNAM-$VERSION
tar xvfz $CWD/$TARBALL.tar.gz
mv $TARBALL $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
-tar xvfz $CWD/Box2D231.tar.gz
+
+# Correct path in makefile
+patch console/linux/makefile $CWD/makefile.patch
chown -R root:root .
find -L . \
@@ -80,25 +82,36 @@ find -L . \
\( -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 Box2D231.so $PKG/opt/$PRGNAM/Box2D231.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
+ tar xvfz $CWD/Box2D231.tar.gz
+ 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
diff --git a/development/bbcsdl/makefile.patch b/development/bbcsdl/makefile.patch
new file mode 100644
index 000000000000..1d518bfd25ce
--- /dev/null
+++ b/development/bbcsdl/makefile.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 \