diff options
-rw-r--r-- | development/fpc/README | 2 | ||||
-rw-r--r-- | development/fpc/doinst.sh | 4 | ||||
-rw-r--r-- | development/fpc/fix-IDE-data-file-location.patch | 69 | ||||
-rw-r--r-- | development/fpc/fpc.SlackBuild | 103 | ||||
-rw-r--r-- | development/fpc/fpc.info | 22 | ||||
-rw-r--r-- | development/fpc/instantfpc.1 | 82 | ||||
-rw-r--r-- | development/fpc/slack-desc | 2 |
7 files changed, 232 insertions, 52 deletions
diff --git a/development/fpc/README b/development/fpc/README index f92e75fa8c..9fba9bf879 100644 --- a/development/fpc/README +++ b/development/fpc/README @@ -1,3 +1,5 @@ +fpc (free pascal compiler) + Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal compiler. It is available for different processors: Intel x86, Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM. The discontinued 1.0 diff --git a/development/fpc/doinst.sh b/development/fpc/doinst.sh index 1b1904e6f4..991be0d368 100644 --- a/development/fpc/doinst.sh +++ b/development/fpc/doinst.sh @@ -1,15 +1,11 @@ config() { NEW="$1" OLD="$(dirname $NEW)/$(basename $NEW .new)" - # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then - # toss the redundant copy rm $NEW fi - # Otherwise, we leave the .new copy for the admin to consider... } config etc/fpc.cfg.new - diff --git a/development/fpc/fix-IDE-data-file-location.patch b/development/fpc/fix-IDE-data-file-location.patch new file mode 100644 index 0000000000..3ab047f40a --- /dev/null +++ b/development/fpc/fix-IDE-data-file-location.patch @@ -0,0 +1,69 @@ +Description: Align fp IDE template file paths with Debian standards + The fp IDE looks for template files in /usr/bin where itself is installed. + However this is not conform with Debian stadard for file locations. + This patch fixes this by making the IDE looking for templates in the base + installation directory. +Author: Abou Al Montacir <abou.almontacir@sfr.fr> +Index: fpc/fpcsrc/packages/ide/fpmake.pp +=================================================================== +--- fpc.orig/fpcsrc/packages/ide/fpmake.pp ++++ fpc/fpcsrc/packages/ide/fpmake.pp +@@ -282,16 +282,16 @@ begin + T.Directory:='compiler'; + T.Install:=false; + +- P.InstallFiles.Add('fp.ans','$(bininstalldir)'); +- P.InstallFiles.Add('gplprog.pt','$(bininstalldir)'); +- P.InstallFiles.Add('gplunit.pt','$(bininstalldir)'); +- P.InstallFiles.Add('program.pt','$(bininstalldir)'); +- P.InstallFiles.Add('unit.pt','$(bininstalldir)'); +- P.InstallFiles.Add('cvsco.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('cvsdiff.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('cvsup.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('grep.tdf','$(bininstalldir)'); +- P.InstallFiles.Add('tpgrep.tdf','$(bininstalldir)'); ++ P.InstallFiles.Add('fp.ans','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('gplprog.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('gplunit.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('program.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('unit.pt','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsco.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsdiff.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('cvsup.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('grep.tdf','$(baseinstalldir)/ide'); ++ P.InstallFiles.Add('tpgrep.tdf','$(baseinstalldir)/ide'); + P.InstallFiles.Add('fp32.ico', [win32, win64], '$(bininstalldir)'); + + with P.Sources do +Index: fpc/fpcsrc/packages/ide/fpini.pas +=================================================================== +--- fpc.orig/fpcsrc/packages/ide/fpini.pas ++++ fpc/fpcsrc/packages/ide/fpini.pas +@@ -178,12 +178,12 @@ begin + end; + {$endif WINDOWS} + {$else} +- SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide/text'); ++ SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib/fpc/'+version_string+'/ide'); + If Not ExistsDir(SystemIDEdir) Then + begin +- SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide/text'); ++ SystemIDEDir:=FExpand(DirOf(system.paramstr(0))+'../lib64/fpc/'+version_string+'/ide'); + If Not ExistsDir(SystemIDEdir) Then +- SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide/text'; ++ SystemIDEDir:='/usr/lib/fpc/'+version_string+'/ide'; + end; + IDEdir:=CompleteDir(FExpand('~/.fp')); + If Not ExistsDir(IDEdir) Then +Index: fpc/fpcsrc/packages/ide/fptemplt.pas +=================================================================== +--- fpc.orig/fpcsrc/packages/ide/fptemplt.pas ++++ fpc/fpcsrc/packages/ide/fptemplt.pas +@@ -280,6 +280,7 @@ begin + New(Templates, Init(10,10)); + ScanDir('.'); + ScanDir(IDEDir); ++ ScanDir(SystemIDEDir); + end; + + diff --git a/development/fpc/fpc.SlackBuild b/development/fpc/fpc.SlackBuild index e893499c9b..a15a542a78 100644 --- a/development/fpc/fpc.SlackBuild +++ b/development/fpc/fpc.SlackBuild @@ -2,7 +2,9 @@ # Slackware build script for Free Pascal -# Written by Andre Barboza <bmg.andre@gmail.com> +# Written by Andre Barboza <email removed>. +# Modified by the SlackBuilds.org project. +# Now maintained by B. Watson <yalhcru@gmail.com>. # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: @@ -20,14 +22,20 @@ # 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. -# -# Modified by the SlackBuilds.org project. + +# 20210904 bkw: +# - take over maintenance. +# - update for v3.2.2. +# - install the IDE's data files to fpc base dir, not /usr/bin (ugh). +# - include man page for instantfpc/ifpc. +# - TODO: find out why exiting fp (the IDE) leaves the cursor blinking. +# It's *very* annoying but not a showstopper. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=fpc -VERSION=${VERSION:-3.0.4} -BINVERSION=${BINVERSION:-3.0.4} +VERSION=${VERSION:-3.2.2} +BINVER=${BINVER:-3.2.2} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +48,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -69,35 +74,50 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$BINVERSION ${PRGNAM}build-$VERSION -mkdir $PRGNAM-$BINVERSION ${PRGNAM}build-$VERSION -cd $TMP/$PRGNAM-$BINVERSION -tar xvf $CWD/$PRGNAM-$BINVERSION.$ARCH-linux.tar --strip-components=1 +rm -rf $PRGNAM-$BINVER ${PRGNAM}build-$VERSION +mkdir $PRGNAM-$BINVER ${PRGNAM}build-$VERSION +cd $TMP/$PRGNAM-$BINVER +tar xvf $CWD/$PRGNAM-$BINVER.$ARCH-linux.tar --strip-components=1 cd $TMP/${PRGNAM}build-$VERSION tar xvf $CWD/${PRGNAM}build-$VERSION.tar.gz -# Unpack binary files. +# Unpack binary files. This is the bootstrap compiler; these binaries +# don't get installed as part of the package. ( - mkdir -p $TMP/$PRGNAM-$BINVERSION/binary - cd $TMP/$PRGNAM-$BINVERSION/binary - tar xvf $TMP/$PRGNAM-$BINVERSION/binary.$ARCH-linux.tar + mkdir -p $TMP/$PRGNAM-$BINVER/binary + cd $TMP/$PRGNAM-$BINVER/binary + tar xvf $TMP/$PRGNAM-$BINVER/binary.$ARCH-linux.tar - cd $TMP/$PRGNAM-$BINVERSION - tar xvf $TMP/$PRGNAM-$BINVERSION/binary/base.$ARCH-linux.tar.gz - tar xvf $TMP/$PRGNAM-$BINVERSION/binary/utils.$ARCH-linux.tar.gz + cd $TMP/$PRGNAM-$BINVER + tar xvf $TMP/$PRGNAM-$BINVER/binary/base.$ARCH-linux.tar.gz + tar xvf $TMP/$PRGNAM-$BINVER/binary/utils.$ARCH-linux.tar.gz - cd $TMP/$PRGNAM-$BINVERSION/bin + cd $TMP/$PRGNAM-$BINVER/bin if [ "$ARCH" = "x86_64" ]; then - ln -s ../lib/fpc/$BINVERSION/ppcx64 + ln -s ../lib/fpc/$BINVER/ppcx64 else - ln -s ../lib/fpc/$BINVERSION/ppc386 + ln -s ../lib/fpc/$BINVER/ppc386 fi ) -export PATH="$TMP/$PRGNAM-$BINVERSION/bin":$PATH -echo $PATH +export PATH="$TMP/$PRGNAM-$BINVER/bin":$PATH +echo "=== PATH is $PATH" cd $TMP/${PRGNAM}build-$VERSION/${PRGNAM}build-$VERSION + +# it's => its. It's one of my pet peeves; its occurrence annoys me. +sed -i "s,\\(as\\|control\\) it's,\\1 its," install/man/man?/*.? + +# 20210905 bkw: patch taken from Debian with many thanks. Installs the +# IDE's data files somewhere besides /usr/bin, and patches the IDE to +# look for them there. +patch -p1 < $CWD/fix-IDE-data-file-location.patch + +# 20210905 bkw: don't let the NOGDB=1 scare you. During the compile +# we get this message: +# Compiling IDE with GDB/MI debugger support, LibGDB is not needed +# ...and it appears that the IDE does indeed have its debugging +# support enabled. make build NOGDB=1 make -j1 NOGDB=1 PREFIX=$PKG/usr install @@ -116,10 +136,23 @@ mv $PKG/usr/share/doc $PKG/usr/doc rmdir $PKG/usr/share cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +# 20210905 bkw: fancier than the template, but quite a bit faster and less +# resource-intensive. +find $PKG -type f -a -perm /111 | \ + xargs file -m /etc/file/magic/elf | \ + grep -e "executable" -e "shared object" | grep ELF | \ + cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null || true + +# we include one man page borrowed from Debian and edited for +# grammar and accuracy. +cat $CWD/instantfpc.1 > $PKG/usr/man/man1/instantfpc.1 + +gzip $PKG/usr/man/man?/*.* -find $PKG/usr/man -type f -exec gzip -9 {} \; +# no idea why Debian renames instantfpc => ifpc, so support both names. +ln -s instantfpc.1.gz $PKG/usr/man/man1/ifpc.1.gz +ln -s instantfpc $PKG/usr/bin/ifpc # Create compiler config file. mkdir -p $PKG/etc $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/ide/text @@ -128,10 +161,11 @@ $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/samplecfg \ $PKG/etc # Clean up the configs by removing our package directory. -sed -i -e "s:$PKG::g" $PKG/etc/fpc.cfg -sed -i -e "s:$PKG::g" $PKG/etc/fppkg.cfg -sed -i -e "s:$PKG::g" $PKG/etc/fppkg/default -sed -i -e "s:$PKG::g" $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/ide/text/fp.cfg +sed -i -e "s:$PKG::g" \ + $PKG/etc/fpc.cfg \ + $PKG/etc/fppkg.cfg \ + $PKG/etc/fppkg/default \ + $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/ide/text/fp.cfg mv $PKG/etc/fpc.cfg $PKG/etc/fpc.cfg.new mkdir -p $PKG/install @@ -141,10 +175,7 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG # fix permissions for program docs and demos. 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 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/fpc/fpc.info b/development/fpc/fpc.info index dbe75c3245..55c85b9453 100644 --- a/development/fpc/fpc.info +++ b/development/fpc/fpc.info @@ -1,14 +1,14 @@ PRGNAM="fpc" -VERSION="3.0.4" +VERSION="3.2.2" HOMEPAGE="https://www.freepascal.org/" -DOWNLOAD="https://downloads.sourceforge.net/freepascal/fpc-3.0.4.i386-linux.tar \ - https://downloads.sourceforge.net/freepascal/fpcbuild-3.0.4.tar.gz" -MD5SUM="110522e12522caecfcca3115bd65ca07 \ - 255717e8e6fab4b472f7c7d0d08d2c4f" -DOWNLOAD_x86_64="https://downloads.sourceforge.net/freepascal/fpc-3.0.4.x86_64-linux.tar \ - https://downloads.sourceforge.net/freepascal/fpcbuild-3.0.4.tar.gz" -MD5SUM_x86_64="32f8baf6c89cfed6422b7e2e0f18e7a3\ - 255717e8e6fab4b472f7c7d0d08d2c4f" +DOWNLOAD="https://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2.i386-linux.tar \ + https://downloads.sourceforge.net/project/freepascal/Source/3.2.2/fpcbuild-3.2.2.tar.gz" +MD5SUM="18354e51309a34b0efe7702633568a1e \ + 3681ae4a208be4f64ec65e832a9a702d" +DOWNLOAD_x86_64="https://downloads.sourceforge.net/project/freepascal/Linux/3.2.2/fpc-3.2.2.x86_64-linux.tar \ + https://downloads.sourceforge.net/project/freepascal/Source/3.2.2/fpcbuild-3.2.2.tar.gz" +MD5SUM_x86_64="0186779de0c9caee073fc1394afbee56 \ + 3681ae4a208be4f64ec65e832a9a702d" REQUIRES="" -MAINTAINER="Capi X." -EMAIL="capi_x@haibane.org" +MAINTAINER="B. Watson" +EMAIL="yalhcru@gmail.com" diff --git a/development/fpc/instantfpc.1 b/development/fpc/instantfpc.1 new file mode 100644 index 0000000000..d82eddf644 --- /dev/null +++ b/development/fpc/instantfpc.1 @@ -0,0 +1,82 @@ +.TH instantfpc 1 "5 Sep 2021" "Free Pascal" "Instant pascal code interpreter" +.SH NAME +instantfpc \- The Free Pascal Interpreter. + +.SH SYNOPSIS + +.B instantfpc +[\fI\-h\fR] [\fI\-v\fR] [\fIcompiler options\fR] <\fIsource file\fR> +[\fIprogram arguments\fR] + +.SH DESCRIPTION + +.B instantfpc +is a Pascal code interpreter program. It compiles source and runs the +generated program. It allows Pascal source code to be treated like a script, +by placing +.B #!/usr/bin/env instantfpc +as the 'shebang' line at the top of the Pascal source file. + +To avoid recompiling source when it hasn't changed, +.B instantfpc +keeps a cache (see +.B \-\-set\-cache +option). When +.B instantfpc +is run, +the source is compared with the cache. If the cached source is not valid, then source is +copied to the cache with the shebang line commented out, and the cached source is compiled. +If compilation fails, the \fBfpc\fR output is written to stdout and an exit code of 1 +is returned. + +If compilation is successful, the program is executed. +If \fIprogram arguments\fR were given, they are passed to the compiled program +when it is run. + +If the compiler options contains \fB\-B\fR, the program is always recompiled. + +If the environment variable +.B INSTANTFPCOPTIONS +is set, it is passed to the compiler as +the first argument(s). + +.SH NOTE + +.B instantfpc +is also installed as +.B ifpc +for compatibility with older versions of Free Pascal. + +.SH USAGE + +.B instantfpc +takes the following arguments: +.TP +.B \-h +Prints this help message and exit. +.TP +.B \-v +Prints version and exit. +.TP +.B \-\-get\-cache +Prints current cache directory and exit. +.TP +.B \-\-set\-cache=<path to cache> +Set the cache to be used. Otherwise uses environment variable +.B INSTANTFPCCACHE +if set, or +.B $HOME/.cache/instantfpc/ +otherwise. +.TP +.B \-\-compiler=<path to compiler> +Normally \fBfpc\fR is searched in PATH and used as compiler. +.TP +.B \-\-skip\-run +Do not execute the program. Useful to test if script compiles. +.TP +.B \-B +Always recompile. + +.SH SEE ALSO +.IP +.BR fpc (1) diff --git a/development/fpc/slack-desc b/development/fpc/slack-desc index 63a715ceaa..ac50d2fc16 100644 --- a/development/fpc/slack-desc +++ b/development/fpc/slack-desc @@ -6,7 +6,7 @@ # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| -fpc: fpc (Free Pascal is a Pascal compiler) +fpc: fpc (free pascal compiler) fpc: fpc: Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal fpc: compiler. It is available for different processors: Intel x86, |