diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-22 18:03:08 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-22 22:16:02 +0200 |
commit | 45667f6db7efacfe1ef62af2b604affc5f6ae521 (patch) | |
tree | aa7c4e4a84037556cda1edc301bc4ff1e02cc720 | |
parent | 54c4185190679c21cb2c69c424330f7b7aad073b (diff) | |
download | aports-45667f6db7efacfe1ef62af2b604affc5f6ae521.tar.bz2 aports-45667f6db7efacfe1ef62af2b604affc5f6ae521.tar.xz |
testing/llvm3.9: refactor abuild according to llvm4 abuild
-rw-r--r-- | testing/llvm3.9/APKBUILD | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/testing/llvm3.9/APKBUILD b/testing/llvm3.9/APKBUILD index 7a645a1bcb..4c476d0bbc 100644 --- a/testing/llvm3.9/APKBUILD +++ b/testing/llvm3.9/APKBUILD @@ -6,11 +6,12 @@ _pkgname=llvm pkgver=3.9.1 _majorver=${pkgver%.*} pkgname=$_pkgname$_majorver -pkgrel=0 -pkgdesc="Low Level Virtual Machine compiler system (version $_majorver.x)" +pkgrel=1 +pkgdesc="Low Level Virtual Machine compiler system (version $_majorver)" arch="all" url="http://llvm.org/" license="UOI-NCSA" +depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends="binutils-dev chrpath cmake file libffi-dev paxmark python2 zlib-dev" subpackages="$pkgname-static $pkgname-libs $pkgname-dev" source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz @@ -27,11 +28,6 @@ source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz " builddir="$srcdir/$_pkgname-$pkgver.src" -# ARM has few failures in test suite that we don't care about currently. -case "$CARCH" in - arm*) options="!check";; -esac - # NOTE: It seems that there's no (sane) way how to change includedir, sharedir # etc. separately, just the CMAKE_INSTALL_PREFIX. Standard CMake variables and # even LLVM-specific variables, that are related to these paths, actually @@ -54,9 +50,7 @@ _prefix="usr/lib/llvm$_majorver" prepare() { default_prepare - cd "$builddir" - mkdir -p "$builddir"/build # https://bugs.llvm.org//show_bug.cgi?id=31870 rm test/tools/llvm-symbolizer/print_context.c @@ -67,6 +61,8 @@ prepare() { # Test added by rust-lang-llvm-pr57.patch, fails for unknown reason. rm test/CodeGen/MIR/AArch64/inst-size-tlsdesc-callseq.mir + + mkdir -p "$builddir"/build } build() { @@ -100,7 +96,7 @@ build() { -DLLVM_HOST_TRIPLE="$CHOST" \ -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_LINK_LLVM_DYLIB=ON \ - -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;AMDGPU;NVPTX;Mips;BPF' \ + -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;SystemZ;AMDGPU;NVPTX;Mips;BPF' \ "$builddir" make llvm-tblgen @@ -118,7 +114,11 @@ build() { check() { cd "$builddir"/build - make check-llvm + # ARM has few failures in test suite that we don't care about currently. + case "$CARCH" in + arm*) make check-llvm || true;; + *) make check-llvm;; + esac } package() { @@ -136,11 +136,15 @@ package() { | awk -F: '$2~/ELF/{print $1}' \ | xargs -r chrpath -d - # Symlink files in bindir to /usr/bin with version suffix. + # Symlink files from /usr/lib/llvm*/bin to /usr/bin. mkdir -p "$pkgdir"/usr/bin - local path; for path in bin/*; do - ln -s ../lib/llvm$_majorver/$path \ - "$pkgdir"/usr/$path-$_majorver + local name path + for path in bin/*; do + name=${path##*/} + case "$name" in + FileCheck | obj2yaml | yaml2obj) continue;; + esac + ln -s ../lib/llvm$_majorver/bin/$name "$pkgdir"/usr/bin/$name-$_majorver done # Move /usr/lib/$pkgname/include/ into /usr/include/$pkgname/ @@ -165,6 +169,7 @@ static() { libs() { pkgdesc="LLVM $_majorver runtime library" local soname="libLLVM-$_majorver.so" + local soname2="libLLVM-$pkgver.so" mkdir -p "$subpkgdir" cd "$subpkgdir" @@ -172,12 +177,12 @@ libs() { # libLLVM should be in /usr/lib. This is needed for binaries that are # dynamically linked with libLLVM, so they can find it on default path. _mv "$pkgdir"/$_prefix/lib/$soname usr/lib/ - ln -s $soname usr/lib/${soname/$_majorver/$pkgver} + ln -s $soname usr/lib/$soname2 # And also symlink it back to the LLVM prefix. mkdir -p $_prefix/lib ln -s ../../$soname $_prefix/lib/$soname - ln -s ../../$soname $_prefix/lib/${soname/$_majorver/$pkgver} + ln -s ../../$soname $_prefix/lib/$soname2 } dev() { |