contrib/gcc-fortran/Pkgfile

77 lines
2.1 KiB
Plaintext
Raw Normal View History

# URL: http://gcc.gnu.org/fortran
# Description: Fortran (f95) add-on for GNU GCC compiler.
2023-07-09 00:48:08 +02:00
# Maintainer: Tim Biermann, tbier at posteo dot de
2008-12-05 08:07:45 +01:00
# Depends on: libmpfr
name=gcc-fortran
2023-05-13 21:59:24 +02:00
version=12.3.0
2014-08-20 09:54:43 +02:00
release=1
2017-07-10 14:11:53 +02:00
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.xz
2023-07-09 00:48:08 +02:00
gcc-nocheck-fixincludes.patch gcc-4.7.3-multilib-dirs.patch)
build() {
2023-07-09 00:48:08 +02:00
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
patch -d gcc-$version -p 1 -i $SRC/gcc-4.7.3-multilib-dirs.patch
2007-03-31 02:04:40 +02:00
2023-07-09 00:48:08 +02:00
# Do not run fixincludes
sed -i -e 's|\./fixinc\.sh|-c true|' gcc-$version/gcc/Makefile.in
2017-03-18 14:29:17 +01:00
2023-07-09 00:48:08 +02:00
install -d build
cd build
2016-06-10 15:56:39 +02:00
2023-07-09 00:48:08 +02:00
../gcc-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--enable-languages=fortran \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--disable-nls \
--with-x=no \
--with-system-zlib \
--enable-multilib \
--disable-sjlj-exceptions \
--with-pkgversion="CRUX-x86_64-multilib"
2014-01-09 12:34:07 +01:00
2023-07-09 00:48:08 +02:00
if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
make STAGE_CC_WRAPPER='/usr/bin/ccache' BOOT_CFLAGS="$CFLAGS" bootstrap
else
make BOOT_CFLAGS="$CFLAGS" bootstrap
fi
2023-07-09 00:48:08 +02:00
make -j 1 DESTDIR=$PKG install
2023-07-09 00:48:08 +02:00
ln -fs gfortran $PKG/usr/bin/f90
ln -fs gfortran $PKG/usr/bin/f95
ln -fs gfortran $PKG/usr/bin/g77
2014-01-09 12:34:07 +01:00
2023-07-09 00:48:08 +02:00
for D in lib{,32}; do
install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D}
mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D}
done
2018-04-06 10:29:59 +02:00
2023-07-09 00:48:08 +02:00
# remove files already on the system out of the port
for i in $(pkginfo -l gcc | sed -e "s|^|/|") $(pkginfo -l binutils | sed -e "s|^|/|"); do
if [ -e "$i" ] && [ ! -d "$i" ]; then
if [ -e "$PKG$i" ]; then
rm "$PKG$i"
fi
# check for compressed manpages
if [ -e "$PKG${i%%.gz}" ]; then
rm "$PKG${i%%.gz}"
fi
fi
done
2023-07-09 00:48:08 +02:00
rm $PKG/usr/bin/*-linux-gnu-*
rm -r $PKG/usr/share/{info,gcc-$version}
rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
2014-01-09 12:34:07 +01:00
2023-07-09 00:48:08 +02:00
# Remove empty directories
find $PKG -depth -empty -exec rm -r {} \;
2023-07-09 00:48:08 +02:00
# remove build paths from *.la files
sed -i -e "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/libgfortran.la
}