Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions development/SmallBASIC/SmallBASIC.SlackBuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Slackware build script for SmallBASIC

# Copyright 2024 Antonio Leal, Porto Salvo, Oeiras, Portugal
# Copyright 2024-2026 Antonio Leal, Porto Salvo, Oeiras, Portugal
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
Expand All @@ -26,7 +26,7 @@
cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=SmallBASIC
VERSION=${VERSION:-12.27}
VERSION=${VERSION:-12.33}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
Expand All @@ -52,29 +52,32 @@ 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 /tmp/$FLTKTARBALL
rm -rf $FLTKTARBALL $PRGNAM-$VERSION
rm -rf $FLTKTARBALL ${PRGNAM}-${VERSION/./_}
rm -rf $TMP/${VERSION/./_}

tar xvfz $CWD/$FLTKTARBALL-source.tar.gz
tar xvfz $CWD/${PRGNAM,,}-$VERSION.tar.gz
unzip $CWD/${PRGNAM,,}_$VERSION.zip "${VERSION/./_}/examples/*"
tar xvfz $CWD/${PRGNAM}-${VERSION/./_}.tar.gz
# Extract submodules
(
cd ${PRGNAM}-${VERSION/./_}/src/lib
tar xvf $CWD/jsmn-25647e692c7906b96ffd2b05ca54c097948e879c.tar.gz --strip-components=1 -C jsmn
tar xvf $CWD/lodepng-17d08dd26cac4d63f43af217ebd70318bfb8189c.tar.gz --strip-components=1 -C lodepng
tar xvf $CWD/miniaudio-350784a9467a79d0fa65802132668e5afbcf3777.tar.gz --strip-components=1 -C miniaudio
tar xvf $CWD/stb-f58f558c120e9b32c217290b80bad1a0729fbb2c.tar.gz --strip-components=1 -C stb
)

fixperms() {
chown -R root:root .
Expand All @@ -85,52 +88,51 @@ fixperms() {
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
}

export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
# Build statical FLTK libraries
(
cd $FLTKTARBALL
fixperms
./autogen.sh
./configure --prefix=/tmp/$FLTKTARBALL
make -j1
make
make install
)

cd ${PRGNAM,,}-$VERSION
cd ${PRGNAM}-${VERSION/./_}
fixperms

# patch lambda by-copy capture default
patch src/ui/textedit.cpp $CWD/textedit.cpp.patch

# Build Console Version
./autogen.sh
./configure
make -j1
make
make install DESTDIR=$PKG

# Build SDL Version
make clean
./configure --enable-sdl
make -j1
make
make install DESTDIR=$PKG
mv $PKG/usr/local/share/applications/io.github.smallbasic.desktop $PKG/usr/local/share/applications/smallbasic-sdl.desktop
sed -i -e "s/SmallBASIC/SmallBASIC (SDL)/" $PKG/usr/local/share/applications/smallbasic-sdl.desktop

# Build FLTK Version
make clean
export PATH=/tmp/$FLTKTARBALL/bin:$PATH
CFLAGS="-I/tmp/$FLTKTARBALL/include" LDFLAGS="-L/tmp/$FLTKTARBALL/lib" ./configure --enable-fltk
make
make install DESTDIR=$PKG
mv $PKG/usr/local/share/applications/io.github.smallbasic.desktop $PKG/usr/local/share/applications/smallbasic-fltk.desktop
sed -i -e "s/SmallBASIC/SmallBASIC (FLTK)/" $PKG/usr/local/share/applications/smallbasic-fltk.desktop

# Place files at the correct locations
mkdir -p $PKG/usr/bin -p $PKG/usr/share/pixmaps $PKG/usr/share/applications $PKG/usr/share/$PRGNAM
mv $PKG/usr/local/bin/* $PKG/usr/bin
mv $PKG/usr/local/share/icons/hicolor/128x128/apps/sb-desktop-128x128.png $PKG/usr/share/pixmaps
mv $PKG/usr/local/share/applications/* $PKG/usr/share/applications
mv $TMP/${VERSION/./_}/examples $PKG/usr/share/$PRGNAM
mkdir -p $PKG/usr/share
mv $PKG/usr/local/bin $PKG/usr
mv $PKG/usr/local/share/icons $PKG/usr/share
mv $PKG/usr/local/share/applications $PKG/usr/share

# Clean-up
rm -rf $PKG/usr/local
rm -rf /tmp/$FLTKTARBALL
rm -rf $TMP/${VERSION/./_}

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
Expand Down
22 changes: 14 additions & 8 deletions development/SmallBASIC/SmallBASIC.info
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
PRGNAM="SmallBASIC"
VERSION="12.27"
VERSION="12.33"
HOMEPAGE="https://smallbasic.github.io"
DOWNLOAD="https://github.com/smallbasic/SmallBASIC/releases/download/12_27/smallbasic-12.27.tar.gz \
DOWNLOAD="UNSUPPORTED"
MD5SUM=""
DOWNLOAD_x86_64="https://github.com/smallbasic/SmallBASIC/archive/v12_33/SmallBASIC-12_33.tar.gz \
https://github.com/fltk/fltk/releases/download/release-1.4.3/fltk-1.4.3-source.tar.gz \
https://github.com/smallbasic/SmallBASIC/releases/download/12_27/smallbasic_12.27.zip"
MD5SUM="ca244c58d4f16e0975eae80eb5f9f0a1 \
https://github.com/zserge/jsmn/archive/25647e692c7906b96ffd2b05ca54c097948e879c/jsmn-25647e692c7906b96ffd2b05ca54c097948e879c.tar.gz \
https://github.com/lvandeve/lodepng/archive/17d08dd26cac4d63f43af217ebd70318bfb8189c/lodepng-17d08dd26cac4d63f43af217ebd70318bfb8189c.tar.gz \
https://github.com/dr-soft/miniaudio/archive/350784a9467a79d0fa65802132668e5afbcf3777/miniaudio-350784a9467a79d0fa65802132668e5afbcf3777.tar.gz \
https://github.com/nothings/stb/archive/f58f558c120e9b32c217290b80bad1a0729fbb2c/stb-f58f558c120e9b32c217290b80bad1a0729fbb2c.tar.gz"
MD5SUM_x86_64="5a1196548c62dbe243293f20b171f8f8 \
766435100c58520ddc3428cfd3a22e8e \
c585ccc6eb7f7038ce2574375132fb9a"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
e5fb6f30a7596a0290dd3849e11270ff \
bdd36d2e9a4ada1e63f0a17026b9bb56 \
a50d7c7e8a33bf1b41621651bd733f5d \
a69d2b9417c1b30a84f4537eb5d868ca"
REQUIRES="SDL3"
MAINTAINER="Antonio Leal"
EMAIL="antonioleal@yahoo.com"
20 changes: 20 additions & 0 deletions development/SmallBASIC/textedit.cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- textedit.cpp 2026-03-05 21:55:00.768394475 +0000
+++ textedit.cpp.new 2026-03-05 21:55:37.520658968 +0000
@@ -2197,7 +2197,7 @@
reset(kHelpKeyword);

if (keyword != nullptr) {
- keywordIterator([=,this](int index, int packageIndex, bool) {
+ keywordIterator([=](int index, int packageIndex, bool) {
bool result = true;
if (strcasecmp(keyword, keyword_help[index].keyword) == 0) {
// found keyword at cursor
@@ -2373,7 +2373,7 @@
int packageIndex = _packageIndex;
bool packageOpen = _packageOpen;

- keywordIterator([=,this](int index, int packageIndex, bool nextPackage) {
+ keywordIterator([=](int index, int packageIndex, bool nextPackage) {
bool result = true;
if (nextPackage) {
const char *package = keyword_help[index].package;