aboutsummaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorAntonio Leal <antonio.leal@yahoo.com>2023-12-01 08:30:52 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2023-12-01 09:45:15 +0700
commite3bf01d80335deb5cc8fff5b8d20a00ef7c52e11 (patch)
tree9a441dc8173df0337fb78c38307d1d401f327262 /development
parent5da56c5b38e376576f0e4f6ffe0b671c81fb2115 (diff)
development/kforth: Updated for version 1.8.0.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/kforth/ForthVM.diff78
-rw-r--r--development/kforth/Makefile.diff48
-rw-r--r--development/kforth/README6
-rw-r--r--development/kforth/doinst.sh13
-rw-r--r--development/kforth/kforth.SlackBuild106
-rw-r--r--development/kforth/kforth.desktop9
-rw-r--r--development/kforth/kforth.info14
-rw-r--r--development/kforth/slack-desc2
8 files changed, 102 insertions, 174 deletions
diff --git a/development/kforth/ForthVM.diff b/development/kforth/ForthVM.diff
deleted file mode 100644
index 494b515fc4bb6..0000000000000
--- a/development/kforth/ForthVM.diff
+++ /dev/null
@@ -1,78 +0,0 @@
-Index: ForthVM.cpp
-===================================================================
---- ForthVM.cpp (revision 7)
-+++ ForthVM.cpp (working copy)
-@@ -155,6 +155,14 @@
- // PUSH_IVAL and PUSH_ADDR
- // 2011-02-06 km fixed problem with FS. not restoring original precision.
- // 2011-03-05 km removed commented out code which was replaced by macros.
-+// 2011-03-10 km added global string dir_env_var to allow default directory
-+// environment variable to be specified externally, in the
-+// Makefile.
-+// 2011-11-01 km revised CPP_allot to ensure all created words which have
-+// ALLOTed memory also have appropriate execution code;
-+// This change also allows removal of common code from
-+// CPP_variable and CPP_fvariable.
-+const char* dir_env_var=DIR_ENV_VAR;
-
- #include <string.h>
- #include <stdlib.h>
-@@ -1550,6 +1558,13 @@
- {
- id->Pfa = new byte[n];
- if (id->Pfa) memset (id->Pfa, 0, n);
-+
-+ // Provide execution code to the word to return its Pfa
-+ byte *bp = new byte[6];
-+ id->Cfa = bp;
-+ bp[0] = OP_ADDR;
-+ *((int*) &bp[1]) = (int) id->Pfa;
-+ bp[5] = OP_RET;
- }
- else
- return E_V_REALLOT;
-@@ -1642,14 +1657,7 @@
- DEC_DSP
- STD_IVAL
- int e = CPP_allot();
-- if (e) return e;
-- WordIndex id = pCompilationWL->end() - 1;
-- byte *bp = new byte[6];
-- id->Cfa = bp;
-- bp[0] = OP_ADDR;
-- *((int*) &bp[1]) = (int) id->Pfa;
-- bp[5] = OP_RET;
-- return 0;
-+ return e;
- }
- //-----------------------------------------------------------------
-
-@@ -1662,14 +1670,7 @@
- DEC_DSP
- STD_IVAL
- int e = CPP_allot();
-- if (e) return e;
-- WordIndex id = pCompilationWL->end() - 1;
-- byte *bp = new byte[6];
-- id->Cfa = bp;
-- bp[0] = OP_ADDR;
-- *((int*) &bp[1]) = (int) id->Pfa;
-- bp[5] = OP_RET;
-- return 0;
-+ return e;
- }
- //------------------------------------------------------------------
-
-@@ -2464,10 +2465,10 @@
- ifstream f(filename);
- if (!f)
- {
-- if (getenv("KFORTH_DIR"))
-+ if (getenv(dir_env_var))
- {
- char temp[256];
-- strcpy(temp, getenv("KFORTH_DIR"));
-+ strcpy(temp, getenv(dir_env_var));
- strcat(temp, "/");
- strcat(temp, filename);
- strcpy(filename, temp);
diff --git a/development/kforth/Makefile.diff b/development/kforth/Makefile.diff
deleted file mode 100644
index 8223cc7742386..0000000000000
--- a/development/kforth/Makefile.diff
+++ /dev/null
@@ -1,48 +0,0 @@
-Index: Makefile
-===================================================================
---- Makefile (revision 7)
-+++ Makefile (working copy)
-@@ -31,6 +31,9 @@
- # 2011-03-05 km; revised archive and snapshot rules to exclude version
- # control subdirectories in the archive files (since we
- # now using Subversion for source control)
-+# 2011-03-10 km; define name of environment variable containing default
-+# Forth source directory, and pass to compiler.
-+# 2011-11-01 km; updated version to 1.5.2p1
- #
- # Possible invocations:
- #
-@@ -50,7 +53,8 @@
- # Invoke "make debug" if you want to create an executable
- # that contains debugging information for the GNU debugger (gdb).
-
--VERSION = 1.5.2
-+VERSION = 1.5.2p1
-+DEF_DIR_VAR=KFORTH_DIR
- BUILD_DATE=`date +%F`
- DEBUG =
- TARGET_CPU = x86
-@@ -64,7 +68,7 @@
-
- CPP = ${GCCDIR}/g++
- CC = ${GCCDIR}/gcc
--CPPFLAGS = -c -m32
-+CPPFLAGS = -c -m32
- CFLAGS = -c -m32
- FAST = -D__FAST__
- OBJS = kforth.o ForthVM.o ForthCompiler.o vm.o vmc.o
-@@ -118,10 +122,12 @@
- ${CPP} ${CPPFLAGS} ${DEBUG} ForthCompiler.cpp
-
- ForthVM.o: ForthVM.cpp ForthVM.h fbc.h ForthCompiler.h kfmacros.h
-- ${CPP} ${CPPFLAGS} ${DEBUG} ForthVM.cpp
-+ ${CPP} ${CPPFLAGS} -DDIR_ENV_VAR=\"${DEF_DIR_VAR}\" \
-+ ${DEBUG} ForthVM.cpp
-
- ForthVM-fast.o: ForthVM.cpp ForthVM.h fbc.h ForthCompiler.h kfmacros.h
-- ${CPP} ${CPPFLAGS} ${DEBUG} ${FAST} -o ForthVM-fast.o ForthVM.cpp
-+ ${CPP} ${CPPFLAGS} -DDIR_ENV_VAR=\"${DEF_DIR_VAR}\" \
-+ ${DEBUG} ${FAST} -o ForthVM-fast.o ForthVM.cpp
-
- vmc.o: vmc.c kfmacros.h
- ${CC} ${CFLAGS} ${DEBUG} vmc.c
diff --git a/development/kforth/README b/development/kforth/README
index 55d7c3e0369c8..31702b1d02e4e 100644
--- a/development/kforth/README
+++ b/development/kforth/README
@@ -8,3 +8,9 @@ define individual words.
kForth is designed to be installed on a 32-bit linux operating system.
It will not install on 64-bit Slackware unless multilib support is
installed.
+
+This package contains the updates made to the branch 1.x originally
+available at ccreweb.org (now only acessible through archive.org as
+http://ccreweb.org/software/kforth/kforth.html). It provided for
+legacy purposes, as the kForth-32 branch 2.x is more actievly
+maintained.
diff --git a/development/kforth/doinst.sh b/development/kforth/doinst.sh
new file mode 100644
index 0000000000000..aea0f894eb32b
--- /dev/null
+++ b/development/kforth/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/kforth/kforth.SlackBuild b/development/kforth/kforth.SlackBuild
index 3f09147be67fb..28eb6780f0a16 100644
--- a/development/kforth/kforth.SlackBuild
+++ b/development/kforth/kforth.SlackBuild
@@ -1,25 +1,37 @@
#!/bin/bash
-# Slackware build script for kforth
-
-# Written by G. Schoenmakers <gschoen@iinet.net.au>
-
-# 20220318 bkw: Modified by SlackBuilds.org:
-# - fix build on 15.0.
-# - use SLKCFLAGS.
-# - strip the binaries.
-# - check ARCH and exit if unsupported.
+# Slackware build script for kForth-32 branch 1.x.x
+
+# Copyright 2023 Antonio Leal, Porto Salvo, Oeiras, Portugal
+# Modified by SlackBuilds.org on 2022/03/18
+# Copyright 2022 G. Schoenmakers <gschoen@iinet.net.au>
+# 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=kforth
-VERSION=${VERSION:-1.5.2p1}
-SRCVER="$( echo $VERSION | cut -dp -f1 )"
+VERSION=${VERSION:-1.8.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-
-MODEL=${MODEL:-x86-linux}
+TARBALL=${TARBALL:-kForth-32-$VERSION}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -40,58 +52,70 @@ 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
-case "$ARCH" in
- i?86) ;; # OK
- *) echo "Unsupported ARCH '$ARCH'"; exit 1 ;;
-esac
-
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$SRCVER
-tar xvf $CWD/$PRGNAM-$MODEL-$SRCVER.tar.gz
-cd $PRGNAM-$SRCVER
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$TARBALL.tar.gz
+mv $TARBALL $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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \+
-
-patch ForthVM.cpp $CWD/ForthVM.diff
-patch Makefile $CWD/Makefile.diff
+ \( -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 {} \+
-# 20220318 bkw: pow10() is deprecated, according to its man
-# page. and apparently it's also a macro, since taking its address
-# fails. exp10() performs exactly the same, and is a real function...
-sed -i 's,\<pow10\>,exp10,g' vmc.c
+cd src
+make
-# 20220318 bkw: sneak our CFLAGS in...
-make CC="gcc $SLKCFLAGS" CPP="g++ $SLKCFLAGS"
-
-# There is no "make install" so the following instructions are used to copy
-# the relevant files into the $PKG directory.
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
mkdir -p $PKG/usr/bin
-install -s -m0755 $PRGNAM $PRGNAM-fast $PKG/usr/bin
+install -Dsv -m 0755 kforth32 $PKG/usr/bin/kforth
+install -Dsv -m 0755 kforth32-fast $PKG/usr/bin/kforth-fast
-mkdir -p $PKG/usr/share/pixmaps
-cp -a kforth.xpm $PKG/usr/share/pixmaps
+mkdir -p $PKG/usr/share/kforth
+cd ../forth-src
+cp -avxu * $PKG/usr/share/kforth
+cd ../doc
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a ChangeLog README examples $PKG/usr/doc/$PRGNAM-$VERSION
+cp *.* $PKG/usr/doc/$PRGNAM-$VERSION
+cp $CWD/dpans94.pdf $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+mkdir -p $PKG/etc/profile.d
+cat <<EOF >$PKG/etc/profile.d/kforth.sh
+#!/bin/sh
+export KFORTH_DIR=/usr/share/kforth
+EOF
+chmod 0755 $PKG/etc/profile.d/kforth.sh
+
+mkdir -p $PKG/usr/share/pixmaps
+cp $TMP/$PRGNAM-$VERSION/kforth.xpm $PKG/usr/share/pixmaps
+
+mkdir -p $PKG/usr/share/applications
+cp $CWD/kforth.desktop $PKG/usr/share/applications
+
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/kforth/kforth.desktop b/development/kforth/kforth.desktop
new file mode 100644
index 0000000000000..030fb1cc5f71c
--- /dev/null
+++ b/development/kforth/kforth.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=kforth
+Comment=kforth (1.x) is a 32-bit Forth System for x86
+Exec=/usr/bin/kforth
+Icon=/usr/share/pixmaps/kforth.xpm
+Terminal=true
+Type=Application
+Categories=Development;
+
diff --git a/development/kforth/kforth.info b/development/kforth/kforth.info
index 34754b33b603e..879e3990e54f5 100644
--- a/development/kforth/kforth.info
+++ b/development/kforth/kforth.info
@@ -1,10 +1,12 @@
PRGNAM="kforth"
-VERSION="1.5.2p1"
-HOMEPAGE="https://web.archive.org/web/20180109141744/http://ccreweb.org/software/kforth/kforth.html"
-DOWNLOAD="http://ponce.cc/slackware/sources/repo/kforth-x86-linux-1.5.2.tar.gz"
-MD5SUM="8def6b906289fc2f2b404a7be8e8d9ce"
+VERSION="1.8.0"
+HOMEPAGE="https://github.com/mynenik/kForth-32"
+DOWNLOAD="https://github.com/mynenik/kForth-32/archive/refs/tags/v1.8.0/kForth-32-1.8.0.tar.gz \
+ https://github.com/antonioleal/slackbuilds/raw/main/kforth/dpans94.pdf"
+MD5SUM="5d5b822ad399b0261eee68ba1761219c \
+ 9ec4c6ae1f460415ecab6051f4e278b5"
DOWNLOAD_x86_64="UNTESTED"
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="G. Schoenmakers"
-EMAIL="gschoen@iinet.net.au"
+MAINTAINER="Antonio Leal"
+EMAIL="antonio.leal@yahoo.com"
diff --git a/development/kforth/slack-desc b/development/kforth/slack-desc
index 05cf44557fcd0..76144d6624262 100644
--- a/development/kforth/slack-desc
+++ b/development/kforth/slack-desc
@@ -15,5 +15,5 @@ kforth: other implementations of Forth, provides an interactive environment,
kforth: allowing the user to examine or define variables and execute or
kforth: define individual words.
kforth:
-kforth:
+kforth: This package contains the branch 1.x of kforth for legacy systems.
kforth: