diff options
author | zfo | 2016-05-30 04:02:59 +0200 |
---|---|---|
committer | zfo | 2016-05-30 04:02:59 +0200 |
commit | 054bfad355bf2e975604f31740cc8cd016f7e487 (patch) | |
tree | b9387d5688fcd8f83bb97a3c6af2827f9e2005aa | |
parent | 613e4314b75ee0173b7908d435d8cea7d738fba0 (diff) | |
download | aur-054bfad355bf2e975604f31740cc8cd016f7e487.tar.gz |
use dmd to bootstrap ldc
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 77 | ||||
-rw-r--r-- | ldc2.conf | 8 |
3 files changed, 59 insertions, 42 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Sun May 29 23:36:38 UTC 2016 +# Mon May 30 00:30:59 UTC 2016 pkgbase = ldc-git pkgdesc = A D Compiler based on the LLVM Compiler Infrastructure including D runtime and libphobos2 pkgver = v1.0.0.beta1.146.ge058ab7 @@ -14,27 +14,23 @@ pkgbase = ldc-git makedepends = git makedepends = cmake makedepends = llvm + makedepends = sed depends = libconfig - provides = ldc - conflicts = ldc + depends = liblphobos source = git://github.com/ldc-developers/ldc.git source = ldc2.conf sha256sums = SKIP - sha256sums = d7b1d3450801eb1603f682c0904f8377496c57f7ed6d94a6fecfac0b90ead11d + sha256sums = 3e3b275f8c04d427b67c989cee591bff96f6701b118f29bb928fc9e3794b1dd7 pkgname = ldc-git depends = liblphobos-git depends = libconfig + depends = liblphobos provides = d-compiler - backup = etc/ldc2.conf + backup = etc/ldc2-git.conf pkgname = liblphobos-git depends = curl provides = d-runtime provides = d-stdlib - conflicts = liblphobos-devel - conflicts = liblphobos - conflicts = ldc - replaces = liblphobos-devel - replaces = liblphobos @@ -3,6 +3,7 @@ # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com> pkgname=('ldc-git' 'liblphobos-git') _gitname=ldc +_pkgname=ldc-git groups=('dlang' 'dlang-ldc') pkgver=v1.0.0.beta1.146.ge058ab7 epoch=1 @@ -12,67 +13,87 @@ arch=('i686' 'x86_64') url="https://github.com/ldc-developers/ldc" license=('BSD') depends=('libconfig') -conflicts=('ldc') -provides=('ldc') -makedepends=('git' 'cmake' 'llvm') +#conflicts=('ldc') +#provides=('ldc') +makedepends=('git' 'cmake' 'llvm' 'sed' 'dmd') source=("git://github.com/ldc-developers/ldc.git" + "git://github.com/ldc-developers/druntime.git" + "git://github.com/ldc-developers/phobos.git" + "git://github.com/ldc-developers/dmd-testsuite.git" "ldc2.conf" ) sha256sums=('SKIP' - 'd7b1d3450801eb1603f682c0904f8377496c57f7ed6d94a6fecfac0b90ead11d') + 'SKIP' + 'SKIP' + 'SKIP' + '3e3b275f8c04d427b67c989cee591bff96f6701b118f29bb928fc9e3794b1dd7') pkgver() { - cd "${srcdir}/${_gitname}" - git describe --tags HEAD | sed 's/-/./g' + cd "${srcdir}/${_gitname}" + git describe --tags HEAD | sed 's/-/./g' } build() { mkdir -p $srcdir/tmp_install_dir cd $srcdir/ldc - git submodule update --init --recursive + git submodule init + git config submodule.druntime.url $srcdir/druntime + git config submodule.phobos.url $srcdir/phobos + git config "submodule.tests/d2/dmd-testsuite.url" $srcdir/tests/d2/dmd-testsuite + git submodule update + + # only touch file if necessary + if grep -q 'ldc[.]conf' driver/configfile.cpp ; then + # patch the config file to be /etc/ldc2-git.conf + sed 's/ldc2[.]conf/ldc2-git.conf/' -i driver/configfile.cpp + fi + + # compilation with ldc links phobos and runtime as shared libraries + # dmd does static linking to the rescue! + sed 's/"ldmd2" "dmd"/"dmd"/' -i cmake/Modules/FindDCompiler.cmake mkdir -p build && cd build - # don't use ArchLinux LDFLAGS + # don't use ArchLinux LDFLAGS (#1494) LDFLAGS="" cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_SKIP_RPATH=ON \ - -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc \ - -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXE_LINKER_FLAGS='-static-libstdc++ -Wl,-rpath,\$ORIGIN' \ + -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc \ + -DBUILD_SHARED_LIBS=ON \ .. - make -j $(nproc) + + #-DCMAKE_SKIP_RPATH=ON \ + make -j $(nproc) make install DESTDIR=$srcdir/tmp_install_dir } package_ldc-git() { depends=('liblphobos-git' 'libconfig') - backup=("etc/ldc2.conf") + backup=("etc/ldc2-git.conf") provides=("d-compiler") cd $srcdir/tmp_install_dir # binaries - install -D -m755 ./usr/bin/ldmd2 $pkgdir/usr/bin/ldmd - ln -s /usr/bin/ldmd $pkgdir/usr/bin/ldmd2 - install -D -m755 ./usr/bin/ldc2 $pkgdir/usr/bin/ldc - ln -s /usr/bin/ldc $pkgdir/usr/bin/ldc2 + install -D -m755 ./usr/bin/ldmd2 $pkgdir/usr/bin/ldmd-git + install -D -m755 ./usr/bin/ldc2 $pkgdir/usr/bin/ldc-git # supplementaries - install -D -m644 $srcdir/ldc/bash_completion.d/ldc2 $pkgdir/usr/share/bash-completion/completions/ldc + install -D -m644 $srcdir/ldc/bash_completion.d/ldc2 $pkgdir/usr/share/bash-completion/completions/ldc-git # licenses install -D -m644 $srcdir/ldc/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE # default configuration files - install -D -m644 $srcdir/ldc2.conf $pkgdir/etc/ldc2.conf + install -D -m644 $srcdir/ldc2.conf $pkgdir/etc/ldc2-git.conf } package_liblphobos-git() { provides=("d-runtime" "d-stdlib") - replaces=("liblphobos-devel" "liblphobos") - conflicts=("liblphobos-devel" "liblphobos" "ldc") + #replaces=("liblphobos-devel" "liblphobos") + #conflicts=("liblphobos-devel" "liblphobos" "ldc") depends=("curl") # licenses @@ -81,12 +102,12 @@ package_liblphobos-git() { cd $srcdir/tmp_install_dir # libraries - install -D -m644 ./usr/lib/libphobos2-ldc.so $pkgdir/usr/lib/liblphobos2.so - install -D -m644 ./usr/lib/libdruntime-ldc.so $pkgdir/usr/lib/libldruntime.so - install -D -m644 ./usr/lib/libphobos2-ldc-debug.so $pkgdir/usr/lib/liblphobos2-debug.so - install -D -m644 ./usr/lib/libdruntime-ldc-debug.so $pkgdir/usr/lib/libldruntime-debug.so + install -D -m644 ./usr/lib/libphobos2-ldc.so $pkgdir/usr/lib/liblphobos2-git.so + install -D -m644 ./usr/lib/libdruntime-ldc.so $pkgdir/usr/lib/libldruntime-git.so + install -D -m644 ./usr/lib/libphobos2-ldc-debug.so $pkgdir/usr/lib/liblphobos2-debug-git.so + install -D -m644 ./usr/lib/libdruntime-ldc-debug.so $pkgdir/usr/lib/libldruntime-debug-git.so # imports mkdir -p $pkgdir/usr/include/dlang - cp -r ./usr/include/dlang/ldc $pkgdir/usr/include/dlang/ldc + cp -r ./usr/include/dlang/ldc $pkgdir/usr/include/dlang/ldc-git } diff --git a/ldc2.conf b/ldc2.conf index 5b5cff10d4cd..efbb7df7818e 100644 --- a/ldc2.conf +++ b/ldc2.conf @@ -7,12 +7,12 @@ default: // 'switches' holds array of string that are appends to the command line // arguments before they are parsed. switches = [ - "-I/usr/include/dlang/ldc/ldc", - "-I/usr/include/dlang/ldc", + "-I/usr/include/dlang/ldc-git/ldc", + "-I/usr/include/dlang/ldc-git", "-L-L/usr/lib", "-L-L/usr/lib32", "-L--no-warn-search-mismatch", - "-defaultlib=lphobos2,ldruntime", - "-debuglib=lphobos2-debug,ldruntime-debug" + "-defaultlib=lphobos2-git,ldruntime-git", + "-debuglib=lphobos2-git-debug,ldruntime-git-debug" ]; }; |