contrib/gdc/Pkgfile
2007-04-01 09:41:57 +10:00

92 lines
2.3 KiB
Plaintext

# Description: GDC is a D language front end for the GNU Compiler Collection.
# URL: http://dgcc.sourceforge.net/
# Maintainer: Danny Rawlins, romster at shortcircuit dot net dot au
# Packager: Danny Rawlins, romster at shortcircuit dot net dot au
# Depends on:
name=gdc
version=0.23
gcc_version=4.1.2
release=1
source=(http://dl.sourceforge.net/sourceforge/dgcc/gdc-$version-src.tar.bz2 \
ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$gcc_version/gcc-{core,g++}-$gcc_version.tar.bz2 \
gdc-$gcc_version-nocheck-fixincludes.patch \
gdc-$gcc_version-fixinc.patch)
build() {
patch -d gcc-$gcc_version -p1 -i $SRC/gdc-$gcc_version-nocheck-fixincludes.patch
patch -d gcc-$gcc_version -p1 -i $SRC/gdc-$gcc_version-fixinc.patch
sed -i -e 's|VERSUFFIX ""|VERSUFFIX " (CRUX)"|' \
gcc-$gcc_version/gcc/version.c
mkdir build
cd build
mv $SRC/d $SRC/gcc-$gcc_version/gcc/d
(
cd ../gcc-$gcc_version
./gcc/d/setup-gcc.sh
)
../gcc-$gcc_version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
--enable-languages=d \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
--disable-nls \
--with-x=no
make bootstrap
make check
make DESTDIR=$PKG install
# remove un-needed files
find $PKG -name 'README' -exec rm {} \;
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/lib/gcc/*/$gcc_version/install-tools \
$PKG/usr/man/man7
# remove files already on the system out of the port
for i in $(find $PKG | sed -e "s|$PKG|/|"); do
if [ -e "$i" ] && [ ! -d "$i" ] ; then
rm $PKG/$i
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
# install distcc symlinks if distcc is installed
if prt-get listinst distcc > /dev/null; then
install -d $PKG/usr/lib/distcc
for c in gdc gdmd; do
cd $PKG/usr/lib/distcc && ln -s ../../bin/distcc $c
done
fi
# install ccache symlinks if ccache is installed
if prt-get listinst ccache > /dev/null; then
install -d $PKG/usr/lib/ccache
for c in gdc gdmd; do
cd $PKG/usr/lib/ccache && ln -s ../../bin/ccache $c
done
fi
}