aboutsummaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-09-13 06:23:56 +0900
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-09-14 21:13:31 +0700
commit19ce1d0eb5b5a27d122f63db87200b33d9051b90 (patch)
tree7e9a8b62eb3c1c0f3a5473a73e077c575fcc0370 /development
parent959df34ebc789bbdb316cee29d50beabb682c816 (diff)
development/ieee-pilot: Added (CAI language Pilot impl).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/ieee-pilot/README15
-rw-r--r--development/ieee-pilot/docs.diff66
-rw-r--r--development/ieee-pilot/gencode.diff38
-rw-r--r--development/ieee-pilot/ieee-pilot.SlackBuild104
-rw-r--r--development/ieee-pilot/ieee-pilot.info10
-rw-r--r--development/ieee-pilot/slack-desc19
6 files changed, 252 insertions, 0 deletions
diff --git a/development/ieee-pilot/README b/development/ieee-pilot/README
new file mode 100644
index 000000000000..4242ecd734f1
--- /dev/null
+++ b/development/ieee-pilot/README
@@ -0,0 +1,15 @@
+ieee-pilot (implementation of the PILOT programming language)
+
+Reference implementation of IEEE Pilot, a CAI language. This is an
+implementation of the very old (1962) CAI language Pilot, as described
+by IEEE Std 1154-1991, ISBN 1-55937-151-X.
+
+ieee-pilot can run as an interpreter or compile Pilot programs to
+standalone executables. It supports some extensions to the language,
+taken from the Atari, Apple, and Nevada implementations. Also, an
+ieee-pilotconv utility is included, which converts Capitol Pilot
+programs to standard IEEE Pilot.
+
+To avoid conflicting with Slackware's alpine package (which has a
+/usr/bin/pilot command), the executables and man pages are installed
+as ieee-pilot and ieee-pilotconv.
diff --git a/development/ieee-pilot/docs.diff b/development/ieee-pilot/docs.diff
new file mode 100644
index 000000000000..444e271aa347
--- /dev/null
+++ b/development/ieee-pilot/docs.diff
@@ -0,0 +1,66 @@
+diff --git a/pilot.adoc b/pilot.adoc
+index bdfc926..4303b0f 100644
+--- a/pilot.adoc
++++ b/pilot.adoc
+@@ -1,11 +1,11 @@
+-= pilot(1) =
++= ieee-pilot(1) =
+ :doctype: manpage
+
+ == NAME ==
+-pilot - interpreter and compiler for IEEE Std 1154-1991 PILOT
++ieee-pilot - interpreter and compiler for IEEE Std 1154-1991 PILOT
+
+ == SYNOPSIS ==
+-pilot [-dcmpk] [-v num[y]] [files...]
++ieee-pilot [-dcmpk] [-v num[y]] [files...]
+
+ == DESCRIPTION ==
+ This program is an interpreter/compiler for IEEE PILOT. Details of the
+diff --git a/pilotconv.adoc b/pilotconv.adoc
+index 61e730e..89de566 100644
+--- a/pilotconv.adoc
++++ b/pilotconv.adoc
+@@ -1,11 +1,11 @@
+-= pilotconv(1) =
++= ieee-pilotconv(1) =
+ :doctype: manpage
+
+ == NAME ==
+-pilotconv - convert source to IEEE Std 1154-1991 PILOT
++ieee-pilotconv - convert source to IEEE Std 1154-1991 PILOT
+
+ == SYNOPSIS ==
+-pilotconv
++ieee-pilotconv
+
+ == DESCRIPTION ==
+ This program does some conformance checking for IEEE PILOT, and
+@@ -26,8 +26,8 @@ are written to standard error and should be self-explanatory.
+
+ == NOTE ==
+ For a better (but slower) conformance test, compile the program using
+-pilot's -c option. For a much stricter test, disallowing extensions
+-present in the this reference implentation but not described in the
++ieee-pilot's -c option. For a much stricter test, disallowing extensions
++present in the this reference implementation but not described in the
+ standard, add the -p (pedantic) option.
+
+ == AUTHOR ==
+diff --git a/tour.adoc b/tour.adoc
+index 2152bd8..0ef9095 100644
+--- a/tour.adoc
++++ b/tour.adoc
+@@ -90,10 +90,10 @@ PILOT library primitive is the MATCH operation.
+ == Portability considerations
+
+ This PILOT is written in ANSI C99, YACC, and LEX. It will make and
+-run correctly on any modern Unix carring Bison and Flex.
++run correctly on any modern Unix carrying Bison and Flex.
+
+ The only serious problem is the call to the C compiler to bash
+-generated C code into executable bits (this is in gencode.c:execfile().
++generated C code into executable bits (this is in gencode.c:execfile()).
+ This should work on any UNIX system, provided you have your pilot
+ directory variable PILOTDIR set up properly and put a copy of pilot.h
+ there. If you're porting this to MS-DOS or whatever, string together
diff --git a/development/ieee-pilot/gencode.diff b/development/ieee-pilot/gencode.diff
new file mode 100644
index 000000000000..0f9943678963
--- /dev/null
+++ b/development/ieee-pilot/gencode.diff
@@ -0,0 +1,38 @@
+diff --git a/gencode.c b/gencode.c
+index 0909641..4d4ec8b 100644
+--- a/gencode.c
++++ b/gencode.c
+@@ -529,8 +529,11 @@ void solhook(char *s) {
+ vp->v.label.addr <= ftell(yyin) &&
+ vp->v.label.addr >=
+ ftell(yyin) - (int)strlen(s)) {
+- (void)fprintf(yyout, "plt_%s:\n",
+- vp->name);
++ static char *last_emitted;
++ if(last_emitted != vp->name) {
++ (void)fprintf(yyout, "plt_%s:\n", vp->name);
++ last_emitted = vp->name;
++ }
+ }
+ }
+
+@@ -1227,6 +1230,10 @@ int execfile(char *t) {
+ (void)fprintf(yyout, "/* %s -- generated C code for %s */\n",
+ outfile, source);
+ (void)fputs("#include <stdio.h>\n", yyout);
++ (void)fputs("#include <string.h>\n", yyout);
++ (void)fputs("#include <unistd.h>\n", yyout);
++ (void)fputs("#include <stdlib.h>\n", yyout);
++ (void)fputs("extern char *gets(char *s);\n", yyout);
+ (void)fputs("#include \"pilot.h\"\n", yyout);
+
+ /* generate declarations for all non-system variables */
+@@ -1256,7 +1263,7 @@ int execfile(char *t) {
+ (void)fputs(PASS2, stderr);
+ }
+
+- (void)fputs("\nmain()\n{\n do_scrinit();\n", yyout);
++ (void)fputs("\nint main(int argc, char **argv)\n{\n do_scrinit();\n", yyout);
+ indent = 1;
+ }
+
diff --git a/development/ieee-pilot/ieee-pilot.SlackBuild b/development/ieee-pilot/ieee-pilot.SlackBuild
new file mode 100644
index 000000000000..62350251f3ed
--- /dev/null
+++ b/development/ieee-pilot/ieee-pilot.SlackBuild
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+# Slackware build script for ieee-pilot
+
+# Written by B. Watson (urchlay@slackware.uk)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=ieee-pilot
+VERSION=${VERSION:-1.11}
+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 $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+# Fix man pages so they refer to ieee-pilot and ieee-pilotconv.
+# Also, fix a couple of typos in the docs.
+patch -p1 < $CWD/docs.diff
+
+# Fix error in generated C code: a comment (R) followed by label
+# results in the label being emitted twice (which fails to compile
+# in modern gcc or clang). This affects the speaknum.p example.
+# The fix is a "band-aid", but effective.
+# Also, fix warnings in generated C code (-c option).
+patch -p1 < $CWD/gencode.diff
+
+LIBDIR=/usr/lib$LIBDIRSUFFIX/$PRGNAM
+PKGLIB=$PKG$LIBDIR
+PKGBIN=$PKG/usr/bin
+PKGMAN1=$PKG/usr/man/man1
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+CONV=${PRGNAM}conv
+
+sed -i "/PILOTDIR/s,/usr/lib/pilot/,$LIBDIR," pilot.h
+
+# The -j1 is needed. Parallel makes don't speed this up much
+# anyway, because it's a tiny project.
+make -j1 all man html OPTFLAGS="$SLKCFLAGS" PILOTDIR=$LIBDIR
+
+mkdir -p $PKGLIB $PKGBIN $PKGMAN1 $PKGDOC/examples
+install -m0644 libpilot.a pilot.h $PKGLIB
+install -m0755 -s pilot $PKGBIN/$PRGNAM
+install -m0755 -s pilotconv $PKGBIN/$CONV
+gzip -9 < $PRGNAM.1 > $PKGMAN1/$PRGNAM.1.gz
+gzip -9 < $CONV.1 > $PKGMAN1/$CONV.1.gz
+
+cp -a COPYING NEWS README TODO *.html *.jpg $PKGDOC
+cp -a *.p $PKGDOC/examples
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+
+find usr/man -type f -a -name '*.gz' \
+ -printf "chroot . /usr/bin/mandb -f '/%p' &> /dev/null\n" \
+ >> install/doinst.sh
+
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/ieee-pilot/ieee-pilot.info b/development/ieee-pilot/ieee-pilot.info
new file mode 100644
index 000000000000..4621070cb911
--- /dev/null
+++ b/development/ieee-pilot/ieee-pilot.info
@@ -0,0 +1,10 @@
+PRGNAM="ieee-pilot"
+VERSION="1.11"
+HOMEPAGE="http://www.catb.org/esr/ieee-pilot/"
+DOWNLOAD="https://gitlab.com/esr/ieee-pilot/-/archive/1.11/ieee-pilot-1.11.tar.gz"
+MD5SUM="049697a58411dce4ee1282ab190d6efa"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="urchlay@slackware.uk"
diff --git a/development/ieee-pilot/slack-desc b/development/ieee-pilot/slack-desc
new file mode 100644
index 000000000000..fa2960df30f8
--- /dev/null
+++ b/development/ieee-pilot/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------------------------------------------------------|
+ieee-pilot: ieee-pilot (implementation of the PILOT programming language)
+ieee-pilot:
+ieee-pilot: Reference implementation of IEEE Pilot, a CAI language. This is an
+ieee-pilot: implementation of the very old (1962) CAI language Pilot, as described
+ieee-pilot: by IEEE Std 1154-1991, ISBN 1-55937-151-X.
+ieee-pilot:
+ieee-pilot: ieee-pilot can run as an interpreter or compile Pilot programs to
+ieee-pilot: standalone executables. It supports some extensions to the language,
+ieee-pilot: taken from the Atari, Apple, and Nevada implementations.
+ieee-pilot:
+ieee-pilot: