summaryrefslogtreecommitdiffstats
path: root/development/f2c
diff options
context:
space:
mode:
author Judah Milgram <milgram / cgpp / com>2024-05-28 22:59:22 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2024-05-28 23:09:10 +0700
commit2b19444e406ee33d84c68b6253882320493ae58a (patch)
tree33318224904976a492351770280dd448e5572c95 /development/f2c
parent8ff6bd82e0cf996c1b71f90799d2ca2589df9739 (diff)
downloadslackbuilds-2b19444e406ee33d84c68b6253882320493ae58a.tar.gz
slackbuilds-2b19444e406ee33d84c68b6253882320493ae58a.tar.xz
development/f2c: Updated for version 20240504.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to '')
-rw-r--r--development/f2c/README15
-rw-r--r--development/f2c/f2c.SlackBuild79
-rw-r--r--development/f2c/f2c.info12
-rw-r--r--development/f2c/slack-desc2
4 files changed, 47 insertions, 61 deletions
diff --git a/development/f2c/README b/development/f2c/README
index 61f28bde6f..20c7be39ba 100644
--- a/development/f2c/README
+++ b/development/f2c/README
@@ -4,19 +4,22 @@ f2c is a Fortran-to-C converter.
This package includes libf2c, which must be linked to the resulting C
code.
-Thus the general idea is: f2c foo.f; gcc foo.c -lf2c
+The general idea is: f2c foo.f; gcc foo.c -lf2c -lm
Or use the fc script provided in the docs directory. Beware, fc is
also an (unrelated) bash builtin.
-f2c used to use two separate libraries, libi77 and libf77. These are
-now rolled together into libf2c. NB libf2c carries a separate version
-number from f2c itself. The version number associated with the
+f2c once used two separate libraries, libi77 and libf77. These are
+now rolled together into libf2c. NB libf2c carries separate version
+numbers from f2c itself. The version number associated with the
SlackBuilds package is the f2c version number.
If combining with gfortran, you may want to use gfortran -ff2c. See
the gfortran man page.
-Multiple files must be downloaded because netlib doesn't provide a
-convenient single tarball.
+The official Netlib repository provides only the most recent version,
+with no renaming of files on update. To avoid checksum errors
+following each f2c update, the .info file points to a unofficial,
+version-specific tarball maintained at a third-party site.
+This SlackBuild builds only the shared library.
diff --git a/development/f2c/f2c.SlackBuild b/development/f2c/f2c.SlackBuild
index ca3b3d691d..e7812be1ca 100644
--- a/development/f2c/f2c.SlackBuild
+++ b/development/f2c/f2c.SlackBuild
@@ -2,9 +2,11 @@
# Slackware build script for f2c
-# Copyright 2017-2023, Judah Milgram, Washington DC
+# Copyright 2017-2024, Judah Milgram, Washington DC
# All rights reserved.
#
+# Assistance of Moritz Schaefer gratefully acknowledged.
+#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
@@ -22,10 +24,11 @@
# 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=f2c
-VERSION=${VERSION:-20240130} # f2c version, not libf2c.
+VERSION=${VERSION:-20240504}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -48,16 +51,19 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -fPIC -DNON_UNIX_STDIO -march=i586 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -fPIC -DNON_UNIX_STDIO -march=i686 -mtune=i686"
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC -DNON_UNIX_STDIO"
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "aarch64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
- SLKCFLAGS="-O2 -fPIC -DNON_UNIX_STDIO"
+ SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
@@ -67,13 +73,10 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION
-mkdir -p $PRGNAM-$VERSION/libf2c
-cd $PRGNAM-$VERSION/libf2c
-unzip $CWD/libf2c.zip
-
-cd $TMP/$PRGNAM-$VERSION
-tar xfvz $CWD/src.tgz
+unzip -d libf2c libf2c.zip
chown -R root:root .
find -L . \
@@ -82,49 +85,35 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# make libf2c:
-cd $TMP/$PRGNAM-$VERSION/libf2c
-make CFLAGS="${SLKCFLAGS}" -f makefile.u
+# libf2c
+make CFLAGS="${SLKCFLAGS} -DNON_UNIX_STDIO -fPIC" -C libf2c -f makefile.u \
+ signal1.h f2c.h libf2c.so
+install -D -t $PKG/usr/lib${LIBDIRSUFFIX} libf2c/libf2c.so
-# install libf2c:
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
-make -f makefile.u LIBDIR=$PKG/usr/lib${LIBDIRSUFFIX} install
+# f2c
+make CFLAGS="${SLKCFLAGS} -DNON_UNIX_STDIO -fPIC" -C src -f makefile.u
+install -D -t $PKG/usr/bin src/f2c
+install -m 644 -D -t $PKG/usr/include src/f2c.h
-# make f2c:
-cd $TMP/$PRGNAM-$VERSION/src
-make CFLAGS="${SLKCFLAGS}" -f makefile.u
+# strip
+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
-# install f2c:
-mkdir -p $PKG/usr/bin
-mkdir -p $PKG/usr/include
-install -s f2c $PKG/usr/bin
-install -m 644 f2c.h $PKG/usr/include
-
-# strip binaries:
-strip --strip-unneeded $PKG/usr/lib${LIBDIRSUFFIX}/libf2c.a
-strip --strip-unneeded $PKG/usr/bin/f2c
-
-# install f2c man page:
-cd $TMP
+# man pages
mkdir -p $PKG/usr/man/man1
-install -m 644 $PRGNAM-$VERSION/src/f2c.1t $PKG/usr/man/man1/f2c.1
-gzip -9 $PKG/usr/man/man1/f2c.1
+gzip -9 -c src/f2c.1t > $PKG/usr/man/man1/f2c.1.gz
-# install docs:
-cd $TMP
+# docs:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $PRGNAM-$VERSION/src/Notice $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $PRGNAM-$VERSION/src/README $PKG/usr/doc/$PRGNAM-$VERSION/README.f2c
-cp -a $PRGNAM-$VERSION/src/changes $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $PRGNAM-$VERSION/libf2c/README $PKG/usr/doc/$PRGNAM-$VERSION/README.libf2c
-cat $CWD/fc > $PKG/usr/doc/$PRGNAM-$VERSION/fc
-cat $CWD/f2c.pdf > $PKG/usr/doc/$PRGNAM-$VERSION/f2c.pdf
+cp -a \
+ 00lastchange README changes f2c.pdf fc index.html src/Notice \
+ $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-# Copy the slack-desc into ./install
+# slack-desc
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-# Make the package
+# Make package
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/development/f2c/f2c.info b/development/f2c/f2c.info
index 3871d4eb70..078ce0a21d 100644
--- a/development/f2c/f2c.info
+++ b/development/f2c/f2c.info
@@ -1,14 +1,8 @@
PRGNAM="f2c"
-VERSION="20240130"
+VERSION="20240504"
HOMEPAGE="https://netlib.org/f2c/"
-DOWNLOAD="https://netlib.org/f2c/libf2c.zip \
- https://netlib.org/f2c/src.tgz \
- https://netlib.org/f2c/fc \
- https://netlib.org/f2c/f2c.pdf"
-MD5SUM="651b3d9cbfc9ae659166332785ac3b6e \
- 3a292e0c25dbb65bf0273959a3f18bf5 \
- dcdf6afbd96204662bf10594b744cb44 \
- 2a84d6d2f74412d7a288e721070d62b8"
+DOWNLOAD="https://github.com/dcjud/f2c/archive/v20240504/f2c-20240504.tar.gz"
+MD5SUM="886eb706af2333c8e078561e6e2bc505"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/development/f2c/slack-desc b/development/f2c/slack-desc
index b1f3476557..c60cc9c91b 100644
--- a/development/f2c/slack-desc
+++ b/development/f2c/slack-desc
@@ -12,7 +12,7 @@ f2c: by S. I. Feldman, David M. Gay, Mark W. Maimone, and N. L. Schryer
f2c:
f2c: From netlib. Includes libf2c.
f2c:
-f2c: The general idea: f2c foo.f; gcc foo.c -lf2c
+f2c: The general idea: f2c foo.f; gcc foo.c -lf2c -lm
f2c:
f2c: If combining with gfortran, see the -ff2c option in the gfortran man
f2c: page.