contrib/gcc-fortran/Pkgfile
2014-08-20 17:54:43 +10:00

84 lines
2.1 KiB
Plaintext

# URL: http://gcc.gnu.org/fortran
# Description: Fortran (f95) add-on for GNU GCC compiler.
# Maintainer: Danny Rawlins, monster dot romster at gmail dot com
# Packager: acrux, acrux at linuxmail dot org
# Depends on: libmpfr
name=gcc-fortran
version=4.8.3
release=1
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.bz2
gcc-nocheck-fixincludes.patch)
build() {
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
mkdir build
cd build
../gcc-$version/configure \
--prefix=/usr \
--mandir=/usr/man \
--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 \
--disable-multilib \
--disable-sjlj-exceptions \
--with-pkgversion="CRUX"
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
make -j 1 DESTDIR=$PKG install
ln -fs gfortran $PKG/usr/bin/f90
ln -fs gfortran $PKG/usr/bin/f95
ln -fs gfortran $PKG/usr/bin/g77
# pure 64-bit has lib64 symlink to lib
mv $PKG/usr/lib64/* $PKG/usr/lib/
rmdir $PKG/usr/lib64
# remove un-needed files
find $PKG -name 'README' -delete
# 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
rm \
$PKG/usr/lib/libstdc++.so.6.0.19-gdb.py \
$PKG/usr/bin/*-linux-gnu-*
rm -r \
$PKG/usr/man/man7 \
$PKG/usr/share/info \
$PKG/usr/share/gcc-4.8.3/python \
$PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
# Remove empty directories
find $PKG -depth -empty -exec rm -r {} \;
# remove build paths from *.la files
for i in $(find $PKG -name '*.la' | sed -e "s|$PKG|/|"); do
sed -i "s|-L$SRC[^ ]* ||g" $PKG/$i
done
}