2016-12-27 01:08:57 +00:00
|
|
|
# $Id$
|
2014-02-23 17:50:30 +00:00
|
|
|
# Maintainer: Mihails Strasuns <public@dicebot.lv>
|
|
|
|
# Contributor: Moritz Maxeiner <moritz@ucworks.org>
|
|
|
|
# Contributor: Jerome Berger <jeberger@free.fr>
|
|
|
|
# Contributor: Jesus Alvarez <jeezusjr@gmail.com>
|
2016-05-10 00:08:49 +00:00
|
|
|
# Contributor: Allan McRae <allan@archlinux.org>
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-05-10 03:48:57 +00:00
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - use GitHub gcc mirror commit archive (order of magnitude size difference)
|
2016-05-11 00:07:02 +00:00
|
|
|
# - --disable-libmpx
|
2016-12-27 01:08:57 +00:00
|
|
|
# - specified build host
|
|
|
|
# - make -j 4
|
2016-05-10 03:48:57 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
pkgname=('gdc' 'libgphobos-devel' 'libgphobos')
|
|
|
|
pkgver=6.2.1
|
2016-05-10 00:08:49 +00:00
|
|
|
pkgrel=1
|
|
|
|
_islver=0.16.1
|
2016-12-27 01:08:57 +00:00
|
|
|
_gcc_commit=c2103c1
|
2014-02-23 17:50:30 +00:00
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
license=('GPL')
|
2016-05-10 00:08:49 +00:00
|
|
|
url="https://github.com/D-Programming-GDC/GDC"
|
2016-12-27 01:08:57 +00:00
|
|
|
makedepends=('binutils>=2.26' 'git')
|
|
|
|
|
2014-03-03 02:02:35 +00:00
|
|
|
source=(
|
2016-12-27 01:08:57 +00:00
|
|
|
https://github.com/gcc-mirror/gcc/archive/${_gcc_commit}.tar.gz
|
|
|
|
http://isl.gforge.inria.fr/isl-$_islver.tar.bz2
|
|
|
|
gdc::git://github.com/D-Programming-GDC/GDC.git#tag=v2.068.2_gcc6
|
2016-05-10 00:08:49 +00:00
|
|
|
git+https://github.com/D-Programming-GDC/GDMD.git
|
2016-12-27 01:08:57 +00:00
|
|
|
paths.diff
|
2016-05-10 00:08:49 +00:00
|
|
|
)
|
2016-12-27 01:08:57 +00:00
|
|
|
sha256sums=('fef2f7ae26641cad4819f8664b03e71060905c337117ec3b703ab72f857a1026'
|
2016-05-10 03:48:57 +00:00
|
|
|
'412538bb65c799ac98e17e8cfcdacbb257a57362acfaaff254b0fcae970126d2'
|
|
|
|
'SKIP'
|
|
|
|
'SKIP'
|
2016-12-27 01:08:57 +00:00
|
|
|
'e04cea391007ebab5d9b0ff33179c1fded0afcf43059b811290472ea52222361')
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
_libdir="usr/lib/gcc/$CHOST/$pkgver"
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-05-10 00:08:49 +00:00
|
|
|
prepare() {
|
2016-12-27 01:08:57 +00:00
|
|
|
mv gcc-${_commit}* gcc
|
|
|
|
cd $srcdir/gcc
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# link isl for in-tree build
|
|
|
|
ln -s ../isl-$_islver isl
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# Do not run fixincludes
|
|
|
|
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# Arch Linux installs x86_64 libraries /lib
|
|
|
|
[[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# Arch Linux ARM installs aarch64 libraries /lib
|
|
|
|
[[ $CARCH == "aarch64" ]] && sed -i '/lp64=/s/lib64/lib/' gcc/config/aarch64/t-aarch64-linux
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
|
|
|
|
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
|
2016-05-10 00:08:49 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# GDC setup
|
|
|
|
cd $srcdir/gdc
|
|
|
|
git apply $srcdir/paths.diff
|
|
|
|
./setup-gcc.sh ../gcc
|
|
|
|
|
|
|
|
mkdir $srcdir/gcc-build
|
2016-05-10 00:08:49 +00:00
|
|
|
}
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2015-07-11 02:15:30 +00:00
|
|
|
build() {
|
2016-12-27 01:08:57 +00:00
|
|
|
cd $srcdir/gcc-build
|
|
|
|
|
|
|
|
# ALARM: Specify build host types, triplet patch
|
|
|
|
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi --with-arch=armv5te --with-float=soft"
|
|
|
|
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf --with-arch=armv6 --with-float=hard --with-fpu=vfp"
|
|
|
|
[[ $CARCH == "armv7h" ]] && CONFIGFLAG="--host=armv7l-unknown-linux-gnueabihf --build=armv7l-unknown-linux-gnueabihf --with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16"
|
|
|
|
[[ $CARCH == "aarch64" ]] && CONFIGFLAG="--host=aarch64-unknown-linux-gnu --build=aarch64-unknown-linux-gnu --with-arch=armv8-a"
|
|
|
|
|
|
|
|
# using -pipe causes spurious test-suite failures
|
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
|
|
|
|
CFLAGS=${CFLAGS/-pipe/}
|
|
|
|
CXXFLAGS=${CXXFLAGS/-pipe/}
|
|
|
|
|
|
|
|
$srcdir/gcc/configure --prefix=/usr \
|
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--with-bugurl=https://archlinuxarm.org/forum \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--enable-threads=posix \
|
|
|
|
--disable-libmpx \
|
|
|
|
--with-system-zlib \
|
|
|
|
--with-isl \
|
|
|
|
--enable-__cxa_atexit \
|
|
|
|
--disable-libunwind-exceptions \
|
|
|
|
--enable-clocale=gnu \
|
|
|
|
--disable-libstdcxx-pch \
|
|
|
|
--disable-libssp \
|
|
|
|
--enable-gnu-unique-object \
|
|
|
|
--enable-linker-build-id \
|
|
|
|
--enable-lto \
|
|
|
|
--enable-plugin \
|
|
|
|
--enable-install-libiberty \
|
|
|
|
--with-linker-hash-style=gnu \
|
|
|
|
--enable-gnu-indirect-function \
|
|
|
|
--enable-default-pie \
|
|
|
|
--disable-multilib \
|
|
|
|
--disable-werror \
|
|
|
|
--enable-languages=d \
|
|
|
|
gdc_include_dir=/usr/include/dlang/gdc $CONFIGFLAG
|
|
|
|
|
|
|
|
make -j 4
|
2014-02-23 17:50:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package_gdc()
|
|
|
|
{
|
2014-03-03 02:02:35 +00:00
|
|
|
depends=('gcc' 'perl' 'binutils' 'libgphobos-devel')
|
2014-02-23 17:50:30 +00:00
|
|
|
provides=("d-compiler")
|
2015-06-04 23:15:41 +00:00
|
|
|
pkgdesc="Compiler for D programming language which uses gcc backend"
|
2016-12-27 01:08:57 +00:00
|
|
|
|
|
|
|
# compiler
|
2014-02-23 17:50:30 +00:00
|
|
|
install -D -m755 $srcdir/gcc-build/gcc/gdc $pkgdir/usr/bin/gdc
|
|
|
|
install -D -m755 $srcdir/gcc-build/gcc/cc1d $pkgdir/usr/lib/gcc/$CHOST/$pkgver/cc1d
|
2014-03-03 02:02:35 +00:00
|
|
|
|
|
|
|
# tools
|
|
|
|
install -D -m755 $srcdir/GDMD/dmd-script $pkgdir/usr/bin/gdmd
|
|
|
|
install -D -m644 $srcdir/GDMD/dmd-script.1 $pkgdir/usr/share/man/man1/gdmd.1
|
2014-02-23 17:50:30 +00:00
|
|
|
}
|
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
|
2014-02-23 17:50:30 +00:00
|
|
|
package_libgphobos-devel()
|
|
|
|
{
|
|
|
|
pkgdesc="Standard library for D programming language, GDC port"
|
|
|
|
provides=("d-runtime" "d-stdlib")
|
|
|
|
options=("staticlibs")
|
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
cd $srcdir/gcc-build
|
|
|
|
make -C $CHOST/libphobos DESTDIR=$pkgdir install
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
# remove shared library bits, they go into own package
|
|
|
|
rm $pkgdir/usr/lib/lib*so*
|
|
|
|
}
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
package_libgphobos()
|
|
|
|
{
|
|
|
|
pkgdesc="Shared standard library for D programming language, GDC port"
|
|
|
|
provides=("d-runtime" "d-stdlib")
|
2014-02-23 17:50:30 +00:00
|
|
|
|
2016-12-27 01:08:57 +00:00
|
|
|
cd $srcdir/gcc-build
|
|
|
|
install -D -m644 $CHOST/libphobos/src/.libs/libgphobos.so $pkgdir/usr/lib/libgphobos.so
|
|
|
|
install -D -m644 $CHOST/libphobos/libdruntime/.libs/libgdruntime.so $pkgdir/usr/lib/libgdruntime.so
|
2014-02-23 17:50:30 +00:00
|
|
|
}
|