78 lines
2.0 KiB
Plaintext
78 lines
2.0 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.4.2
|
|
release=1
|
|
source=(ftp://sources.redhat.com/pub/gcc/releases/gcc-$version/gcc-{core,fortran}-$version.tar.bz2
|
|
gcc-nocheck-fixincludes.patch test-demangle.c.diff)
|
|
|
|
build() {
|
|
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
|
|
patch -d gcc-$version -p 0 -i $SRC/test-demangle.c.diff
|
|
|
|
mkdir build
|
|
cd build
|
|
|
|
../gcc-$version/configure \
|
|
--with-pkgversion="(CRUX)" \
|
|
--prefix=/usr \
|
|
--libexecdir=/usr/lib \
|
|
--enable-languages=fortran \
|
|
--enable-threads=posix \
|
|
--enable-__cxa_atexit \
|
|
--enable-clocale=gnu \
|
|
--enable-shared \
|
|
--disable-nls \
|
|
--with-x=no
|
|
|
|
if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
|
|
make STAGE_CC_WRAPPER='/usr/bin/ccache' BOOT_CFLAGS="$CFLAGS" bootstrap
|
|
elif [ -n "$(pkginfo -i | grep '^distcc ')" ]; then
|
|
make STAGE_CC_WRAPPER='/usr/bin/distcc' BOOT_CFLAGS="$CFLAGS" bootstrap
|
|
else
|
|
make BOOT_CFLAGS="$CFLAGS" bootstrap
|
|
fi
|
|
|
|
make -j 1 check
|
|
make -j 1 DESTDIR=$PKG install
|
|
|
|
ln -fs gfortran $PKG/usr/bin/f90
|
|
ln -fs gfortran $PKG/usr/bin/f95
|
|
|
|
# remove un-needed files
|
|
find $PKG -name 'README' -delete
|
|
|
|
rm \
|
|
$PKG/usr/lib/libiberty.a \
|
|
$PKG/usr/bin/*-linux-gnu-* \
|
|
$PKG/usr/man/man1/{cpp,gcc,gcov}.1
|
|
|
|
rm -r \
|
|
$PKG/usr/info \
|
|
$PKG/usr/man/man7 \
|
|
$PKG/usr/lib/gcc/*/$version/install-tools \
|
|
$PKG/usr/lib/gcc/*/$version/include-fixed \
|
|
$PKG/usr/lib/gcc/*/$version/include
|
|
|
|
# remove files already on the system out of the port
|
|
for i in $(pkginfo -l gcc | sed -e "s|^|/|"); do
|
|
if [ -e "$i" ] && [ ! -d "$i" ]; then
|
|
if [ -e "$PKG$i" ]; then
|
|
rm "$PKG$i"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# 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
|
|
}
|