Browse Source

development/MinForth: Added (Transpile Forth to C)

Signed-off-by: bedlam <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
pull/198/head
Antonio Leal 3 years ago
committed by Willy Sudiarto Raharjo
parent
commit
6e2b28a435
No known key found for this signature in database GPG Key ID: 3F617144D7238786
  1. 119
      development/MinForth/MinForth.SlackBuild
  2. 9
      development/MinForth/MinForth.desktop
  3. 10
      development/MinForth/MinForth.info
  4. BIN
      development/MinForth/MinForth.png
  5. 52
      development/MinForth/README
  6. 13
      development/MinForth/doinst.sh
  7. 19
      development/MinForth/slack-desc

119
development/MinForth/MinForth.SlackBuild

@ -0,0 +1,119 @@
#!/bin/bash
# Slackware build script for MinForth
# Copyright 2023 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=MinForth
VERSION=${VERSION:-3.4.8}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
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 MF348
tar xvf $CWD/MF348_Linux_211105.tgz
cd MF348
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 src
cc mf2c.c -o mf2c -Wall -funsigned-char -lm
./mf2c
cc mf3.c -o mf3 -Wall -funsigned-char -lm
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
install -Dsv -m 0755 mf2c $PKG/usr/bin/mf2c
rm mf2c
install -Dsv -m 0755 mf3 $PKG/usr/bin/mf3
rm mf3
cd ..
mkdir -p $PKG/usr/src/$PRGNAM-$VERSION
mv src/* $PKG/usr/src/$PRGNAM-$VERSION
rmdir src
mkdir -p $PKG/usr/share/MinForth
cp -avxu demo $PKG/usr/share/MinForth
cp -avxu ecore $PKG/usr/share/MinForth
cp -avxu fsl $PKG/usr/share/MinForth
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp change.log $PKG/usr/doc/$PRGNAM-$VERSION
cp mflicense.txt $PKG/usr/doc/$PRGNAM-$VERSION
cp MFREADME.txt $PKG/usr/doc/$PRGNAM-$VERSION
cp -avxu doc/* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/usr/share/pixmaps
cp $CWD/MinForth.png $PKG/usr/share/pixmaps
mkdir -p $PKG/usr/share/applications
cp $CWD/MinForth.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

9
development/MinForth/MinForth.desktop

@ -0,0 +1,9 @@
[Desktop Entry]
Name=MinForth
Comment=MinForth is a Forth that generates C code
Exec=/usr/bin/mf3
Icon=/usr/share/pixmaps/MinForth.png
Terminal=true
Type=Application
Categories=System;Development;

10
development/MinForth/MinForth.info

@ -0,0 +1,10 @@
PRGNAM="MinForth"
VERSION="3.4.8"
HOMEPAGE="https://sourceforge.net/projects/minforth/"
DOWNLOAD="https://sourceforge.net/projects/minforth/files/MF348_Linux_211105.tgz"
MD5SUM="ca03d063bf9f199e065e9777fe34f26f"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Antonio Leal"
EMAIL="antonio.leal@yahoo.com"

BIN
development/MinForth/MinForth.png

After

Width: 135  |  Height: 135  |  Size: 3.5 KiB

52
development/MinForth/README

@ -0,0 +1,52 @@
----------------------------------------------------------------------
Welcome to MinForth V3.4
----------------------------------------------------------------------
MinForth V3.4 is a classic Forth compiler in C and Forth. Development
resource requirements are minimal, hence the name MinForth. A text
editor and a C compiler are sufficient; by design no toolchain is
required to adapt or rebuild MinForth. A complete rebuild takes only
few seconds.
Some features:
- Windows or Linux (or DOS) versions build from the same source
- 64-bit or 32-bit versions build from the same source
- 128-bit double integer numbers (in 64-bit versions)
- complex numbers
- comfortable locals for all number types and with output locals
- NEW arbitrary length floating-point numbers
- turnkey applications with overlays
- comfortable block-file screen editor.
MinForth comprises a Forth-to-C transpiler to generate C code from
word or function definitions in mixed Forth and/or C language.
Transpiled code can be compiled by many modern C99 compilers to fast
and compact executable
application programs. Main but not exclusive application for the
transpiler is to build the MinForth V3.4 Forth compiler.
MinForth V3.4 is widely conformant to the Forth-2012 draft standard
(see enclosed file forth-2012.pdf) including all wordsets
(but for xchars).
It passes the standard test suite (and more), but it is still
'in beta'. Feedback and bug reports are welcome by
- posting in the old Usenet forum comp.lang.forth
- email to minforth@gmx.net
MinForth V3.4 is free software under an MIT license per enclosed file
mflicense.txt.
Have fun and stay healthy!
Heidelberg, Germany
Andreas Kochenburger
----------------------------------------------------------------------
This Slackware package places complementary files in:
/usr/src/MinForth-3.4.8
/usr/doc/MinForth-3.4.8
/usr/share/MinForth

13
development/MinForth/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

19
development/MinForth/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------------------------------------------------------|
MinForth: MinForth (A Forth System that can transpile Forth to C)
MinForth:
MinForth: MinForth V3.4 is a classic Forth system with command-line interface.
MinForth: Development resource requirements are minimal. A source text editor
MinForth: and a C compiler are sufficient. By design no toolchain is required
MinForth: to adapt or rebuild MinForth. A complete rebuild takes only few
MinForth: seconds.
MinForth: Current sources are for Windows and Linux (32-bit or 64-bit).
MinForth:
MinForth:
MinForth:
Loading…
Cancel
Save