diff options
author | Vladimir Panteleev | 2017-12-12 00:48:50 +0000 |
---|---|---|
committer | Vladimir Panteleev | 2017-12-12 01:00:00 +0000 |
commit | 9308f0f38f968f994026d909243cce4d406e0977 (patch) | |
tree | d34712f4f9808630098b9f27f756c76fa2a8a3c8 | |
parent | 2abad9d36683158a906e70b45324131a05ddd5fd (diff) | |
download | aur-9308f0f38f968f994026d909243cce4d406e0977.tar.gz |
Update against community ldc package
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 203 | ||||
-rw-r--r-- | ldc2.conf | 17 |
4 files changed, 160 insertions, 98 deletions
@@ -1,8 +1,8 @@ # Generated by mksrcinfo v8 -# Mon Jun 6 20:15:32 UTC 2016 +# Tue Dec 12 00:48:37 UTC 2017 pkgbase = ldc-git pkgdesc = A D Compiler based on the LLVM Compiler Infrastructure including D runtime and libphobos2 - pkgver = v1.0.0.beta1.167.gd9b012b + pkgver = v1.7.0.beta1.2.g3a6d93b8 pkgrel = 1 epoch = 1 url = https://github.com/ldc-developers/ldc @@ -14,24 +14,26 @@ pkgbase = ldc-git makedepends = git makedepends = cmake makedepends = llvm - makedepends = sed makedepends = dmd - depends = libconfig - depends = curl - provides = d-compiler d-runtime - provides = d-stdlib - conflicts = liblphobos-git - backup = etc/ldc2-git.conf - source = git://github.com/ldc-developers/ldc.git - source = git://github.com/ldc-developers/druntime.git - source = git://github.com/ldc-developers/phobos.git - source = git://github.com/ldc-developers/dmd-testsuite.git + source = git+https://github.com/ldc-developers/ldc.git + source = git+https://github.com/ldc-developers/druntime.git + source = git+https://github.com/ldc-developers/phobos.git + source = git+https://github.com/ldc-developers/dmd-testsuite.git source = ldc2.conf sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP - sha256sums = 3e3b275f8c04d427b67c989cee591bff96f6701b118f29bb928fc9e3794b1dd7 + sha256sums = 7f7eea41e730175ea52993f82bef5bdea6d6fc628344cda9488c04bf4b430024 pkgname = ldc-git + depends = liblphobos-git + depends = llvm-libs + provides = d-compiler= + backup = etc/ldc2-git.conf + +pkgname = liblphobos-git + depends = curl + provides = d-runtime + provides = d-stdlib diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..9421e4f983c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +/*.pkg.tar.xz +/pkg/ +/src/ + +/ldc/ +/dmd-testsuite/ +/druntime/ +/phobos/ @@ -1,106 +1,157 @@ -# Maintainer: zfo <zfoofz1@gmail.com> +# Maintainer: Vladimir Panteleev <arch-pkg at thecybershadow.net> +# Contributor: zfo <zfoofz1@gmail.com> # Contributor: Mihails Strasuns <public@dicebot.lv> # Contributor: Sven-Hendrik Haase <sh@lutzhaase.com> -pkgname=('ldc-git') -_gitname=ldc -_pkgname=ldc-git + +_pkgname=ldc +pkgname=("${_pkgname}-git" 'liblphobos-git') groups=('dlang' 'dlang-ldc') -pkgver=v1.0.0.beta1.167.gd9b012b +pkgver=v1.7.0.beta1.2.g3a6d93b8 epoch=1 pkgrel=1 pkgdesc="A D Compiler based on the LLVM Compiler Infrastructure including D runtime and libphobos2" arch=('i686' 'x86_64') url="https://github.com/ldc-developers/ldc" license=('BSD') -depends=('libconfig' 'curl') -backup=("etc/ldc2-git.conf") -provides=("d-compiler d-runtime" "d-stdlib") -conflicts=('liblphobos-git') -#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" - ) +makedepends=('git' 'cmake' 'llvm' 'dmd') + +source=("git+https://github.com/ldc-developers/ldc.git" + "git+https://github.com/ldc-developers/druntime.git" + "git+https://github.com/ldc-developers/phobos.git" + "git+https://github.com/ldc-developers/dmd-testsuite.git" + "ldc2.conf") sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' - '3e3b275f8c04d427b67c989cee591bff96f6701b118f29bb928fc9e3794b1dd7') + '7f7eea41e730175ea52993f82bef5bdea6d6fc628344cda9488c04bf4b430024') pkgver() { - cd "${srcdir}/${_gitname}" - git describe --tags HEAD | sed 's/-/./g' + cd "${srcdir}/${_pkgname}" + git describe --tags HEAD | sed 's/-/./g' +} + +prepare() { + cd "${srcdir}/${_pkgname}" + + 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}/dmd-testsuite" + git submodule update + + # patch the config file to be /etc/ldc2-git.conf + sed 's/ldc2[.]conf/ldc2-git.conf/' -i driver/configfile.cpp + + # patch ldc to properly link to ldc-git (needed for ldmd) + sed 's/LDC_EXE ldc2/LDC_EXE ldc2-git/' -i CMakeLists.txt + sed 's/LDMD_EXE ldmd2/LDMD_EXE ldmd2-git/' -i CMakeLists.txt + + # patch bash-completion + sed 's/\(ldc2\?\)\b/\1-git/g' -i bash_completion.d/ldc2 + + # it's faster just to rename the config files + mv ldc2_phobos.conf.in ldc2-git_phobos.conf.in + mv ldc2_install.conf.in ldc2-git_install.conf.in } build() { - mkdir -p $srcdir/tmp_install_dir - cd $srcdir/ldc - - 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/dmd-testsuite - git submodule update - - # only touch file if necessary - if grep -q 'ldc2[.]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 + cd "${srcdir}/${_pkgname}" + + mkdir -p build && cd build + + # workaround for wrong ld flag format generated by cmake: + # export LDFLAGS="-L-O1 -L--sort-common -L--as-needed -L-z -Lrelro" + + local args=( + env + + # Use host DMD + # This 1) ensures we use the main dmd package, and not something in the user's $PATH; + # and 2) compilation with ldc links Phobos/Druntime as shared libraries; # dmd does static linking to the rescue! - sed 's/"ldmd2" "dmd"/"dmd"/' -i cmake/Modules/FindDCompiler.cmake - - # patch ldc to properly link to ldc-git (needed for ldmd) - sed 's/LDC_EXE ldc2/LDC_EXE ldc-git/' -i CMakeLists.txt - sed 's/LDMD_EXE ldmd2/LDMD_EXE ldmd-git/' -i CMakeLists.txt - # it's faster just to rename the config files - mv ldc2_phobos.conf.in ldc-git_phobos.conf.in - mv ldc2_install.conf.in ldc-git_install.conf.in - - mkdir -p build && cd build - - # this is the git version - static linking by default - # don't use ArchLinux LDFLAGS (#1494) - LDFLAGS="-static-libstdc++ -Wl,-rpath,\$ORIGIN" cmake \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc-git \ - -DBUILD_SHARED_LIBS=OFF \ + DMD=/usr/bin/dmd + + cmake + -DCMAKE_INSTALL_PREFIX=/usr + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_SKIP_RPATH=ON + -DINCLUDE_INSTALL_DIR=/usr/include/dlang/ldc-git + + # This is the git version - use static linking by default + # -DBUILD_SHARED_LIBS=ON + # -DLDC_WITH_LLD=OFF + -DBUILD_SHARED_LIBS=OFF + .. + ) + "${args[@]}" - #-DCMAKE_SKIP_RPATH=ON \ - make -j $(nproc) - make install DESTDIR=$srcdir/tmp_install_dir + make } -package() { - cd $srcdir/tmp_install_dir +package_ldc-git() { + local dmd_fe_ver + dmd_fe_ver=$(sed -n 's/^.*dmd_version = "v\(.*\)";$/\1/p' \ + "${srcdir}/${_pkgname}/build/driver/ldc-version.cpp") - # binaries - install -D -m755 ./usr/bin/ldmd-git $pkgdir/usr/bin/ldmd-git - install -D -m755 ./usr/bin/ldc-git $pkgdir/usr/bin/ldc-git + depends=('liblphobos-git' 'llvm-libs') + backup=('etc/ldc2-git.conf') + provides=("d-compiler=${dmd_fe_ver}") - # supplementaries - install -D -m644 $srcdir/ldc/bash_completion.d/ldc2 $pkgdir/usr/share/bash-completion/completions/ldc-git + cd "${srcdir}/${_pkgname}/build" + make install DESTDIR="${pkgdir}" - # licenses - install -D -m644 $srcdir/ldc/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE + # rename binaries + for f in profdata prune-cache; do + mv "${pkgdir}/usr/bin/ldc-$f" \ + "${pkgdir}/usr/bin/ldc-git-$f" + done - # default configuration files - install -D -m644 $srcdir/ldc2.conf $pkgdir/etc/ldc2-git.conf + # rename bash-completion + mv "${pkgdir}/usr/share/bash-completion/completions/ldc2" \ + "${pkgdir}/usr/share/bash-completion/completions/ldc2-git" - # libraries - install -D -m644 ./usr/lib/libphobos2-ldc.a $pkgdir/usr/lib/liblphobos2-git.a - install -D -m644 ./usr/lib/libdruntime-ldc.a $pkgdir/usr/lib/libldruntime-git.a - install -D -m644 ./usr/lib/libphobos2-ldc-debug.a $pkgdir/usr/lib/liblphobos2-debug-git.a - install -D -m644 ./usr/lib/libdruntime-ldc-debug.a $pkgdir/usr/lib/libldruntime-debug-git.a + # remove liblphobos files + rm -rf "${pkgdir}/usr/include" + rm -rf "${pkgdir}/usr/lib" + + # remove misc + rm -rf "${pkgdir}/usr/bin/ldc-build-runtime" + + # symlinks + ln -s ldc2-git "${pkgdir}/usr/share/bash-completion/completions/ldc-git" + ln -s ldc2-git "${pkgdir}/usr/bin/ldc-git" + ln -s ldmd2-git "${pkgdir}/usr/bin/ldmd-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-git.conf" +} - # imports - mkdir -p $pkgdir/usr/include/dlang - cp -r ./usr/include/dlang/ldc-git $pkgdir/usr/include/dlang/ldc-git +package_liblphobos-git() { + provides=('d-runtime' 'd-stdlib') + depends=('curl') + + cd "${srcdir}/ldc/build" + make install DESTDIR="${pkgdir}" + + # remove ldc files + rm -rf "${pkgdir}/usr/bin/" + rm -rf "${pkgdir}/etc/" + rm -rf "${pkgdir}/usr/share/bash-completion/" + + # rename libraries + for f in libphobos2-ldc libdruntime-ldc libphobos2-ldc-debug libdruntime-ldc-debug \ + libldc-jit libldc-jit-rt libldc-profile-rt; do + for ext in a so; do + test -e "${pkgdir}/usr/lib/$f.$ext" && \ + mv "${pkgdir}/usr/lib/$f.$ext" "${pkgdir}/usr/lib/$f-git.$ext" + done + done + + # licenses + install -D -m644 "${srcdir}/ldc/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/ldc2.conf b/ldc2.conf index efbb7df7818e..c97cc4783b21 100644 --- a/ldc2.conf +++ b/ldc2.conf @@ -1,18 +1,19 @@ -// This configuration file uses libconfig. -// See http://www.hyperrealm.com/libconfig/ for syntax details. +// See comments in driver/config.d in ldc source tree for grammar description of +// this config file. // The default group is required default: { - // 'switches' holds array of string that are appends to the command line - // arguments before they are parsed. + // default switches injected before all explicit command-line switches switches = [ "-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-git,ldruntime-git", - "-debuglib=lphobos2-git-debug,ldruntime-git-debug" + "-defaultlib=phobos2-ldc-git,druntime-ldc-git", + "-debuglib=phobos2-ldc-git-debug,druntime-ldc-git-debug" + ]; + // default switches appended after all explicit command-line switches + post-switches = [ + "-L-L/usr/lib", ]; }; |