contrib/gcc-fortran/Pkgfile

73 lines
1.9 KiB
Plaintext
Raw Normal View History

# URL: http://gcc.gnu.org/fortran
# Description: Fortran (f95) add-on for GNU GCC compiler.
2014-11-10 13:28:07 +01:00
# Maintainer: Danny Rawlins, crux at romster dot me
# Packager: acrux, acrux at linuxmail dot org
2008-12-05 08:07:45 +01:00
# Depends on: libmpfr
name=gcc-fortran
2017-03-18 14:29:17 +01:00
version=6.3.0
2014-08-20 09:54:43 +02:00
release=1
2013-08-02 15:02:08 +02:00
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.bz2
2015-11-13 02:45:34 +01:00
gcc-nocheck-fixincludes.patch gcc-4.7.3-multilib-dirs.patch)
build() {
2009-11-22 09:52:10 +01:00
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
2016-06-10 15:56:39 +02:00
patch -d gcc-$version -p 1 -i $SRC/gcc-4.7.3-multilib-dirs.patch
2007-03-31 02:04:40 +02:00
2017-03-18 14:29:17 +01:00
# Do not run fixincludes
sed -i -e 's|\./fixinc\.sh|-c true|' gcc-$version/gcc/Makefile.in
2016-06-10 15:56:39 +02:00
install -d build
cd build
2016-06-10 15:56:39 +02:00
2007-03-31 02:04:40 +02:00
../gcc-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
2009-11-22 09:52:10 +01:00
--enable-languages=fortran \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--disable-nls \
2013-08-02 15:02:08 +02:00
--with-x=no \
--with-system-zlib \
2015-11-13 02:45:34 +01:00
--enable-multilib \
2014-01-09 12:34:07 +01:00
--disable-sjlj-exceptions \
2017-03-18 14:29:17 +01:00
--with-pkgversion="CRUX-x86_64-multilib"
2014-01-09 12:34:07 +01: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
2008-03-22 16:10:19 +01:00
make -j 1 DESTDIR=$PKG install
2007-03-31 02:04:40 +02:00
ln -fs gfortran $PKG/usr/bin/f90
ln -fs gfortran $PKG/usr/bin/f95
2014-01-09 12:34:07 +01:00
ln -fs gfortran $PKG/usr/bin/g77
# remove files already on the system out of the port
2014-01-09 12:34:07 +01:00
for i in $(pkginfo -l gcc | sed -e "s|^|/|") $(pkginfo -l binutils | sed -e "s|^|/|"); do
2008-01-04 09:21:30 +01:00
if [ -e "$i" ] && [ ! -d "$i" ]; then
if [ -e "$PKG$i" ]; then
rm "$PKG$i"
fi
2014-01-09 12:34:07 +01:00
# check for compressed manpages
if [ -e "$PKG${i%%.gz}" ]; then
rm "$PKG${i%%.gz}"
fi
fi
done
2017-03-18 14:29:17 +01: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
# Remove empty directories
find $PKG -depth -empty -exec rm -r {} \;
2007-02-15 06:00:38 +01:00
# remove build paths from *.la files
2017-03-18 14:29:17 +01:00
sed -i -e "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/libgfortran.la
}