diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-17 03:08:02 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-05-17 03:10:01 +0200 |
commit | 735529259257a8cb168e4e4305f8bec0bcb2d6de (patch) | |
tree | b2291a8d1f6a2c80e7916272e06bb97f31dc3fa1 /main | |
parent | 24bd280a18ce673ba4f4f22601c9d5aa949895d6 (diff) | |
download | aports-735529259257a8cb168e4e4305f8bec0bcb2d6de.tar.bz2 aports-735529259257a8cb168e4e4305f8bec0bcb2d6de.tar.xz |
main/llvm4: improve abuild's support for non-default LLVM usage
And also fix "replaces", it's inherited to subpackages, so all
subpackages had replaces="llvm".
Diffstat (limited to 'main')
-rw-r--r-- | main/llvm4/APKBUILD | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/main/llvm4/APKBUILD b/main/llvm4/APKBUILD index d28d7f03b7..70840f0722 100644 --- a/main/llvm4/APKBUILD +++ b/main/llvm4/APKBUILD @@ -7,12 +7,10 @@ pkgver=4.0.0 _majorver=${pkgver%%.*} pkgname=$_pkgname$_majorver pkgrel=4 -pkgdesc="Low Level Virtual Machine compiler system (version $_majorver)" +pkgdesc="Low Level Virtual Machine compiler system, version $_majorver" arch="all" url="http://llvm.org/" license="UOI-NCSA" -provides="llvm=$pkgver-r$pkgrel" -replaces="llvm" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends="binutils-dev chrpath cmake file libffi-dev paxmark python2 py-setuptools zlib-dev" subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-test-utils:_test_utils" @@ -32,6 +30,14 @@ case "$CARCH" in arm*) options="!check";; esac +# Whether is this package the default (latest) LLVM version. +_default_llvm="yes" + +if [ "$_default_llvm" = yes ]; then + provides="llvm=$pkgver-r$pkgrel" + replaces="llvm" +fi + # 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 @@ -126,12 +132,6 @@ package() { make DESTDIR="$pkgdir" install - # This tool is needed e.g. for running codegen tests in Rust package. - install -D -m 755 bin/FileCheck "$pkgdir"/$_prefix/bin/FileCheck - - # This tool is required for the lit testing tool. - install -D -m 755 bin/not "$pkgdir"/$_prefix/bin/not - cd "$pkgdir"/$_prefix # Remove RPATHs. @@ -151,7 +151,7 @@ package() { esac # If this package provides=llvm (i.e. it's the default/latest # llvm package), omit version infix/suffix. - if [ -n "$provides" ]; then + if [ "$_default_llvm" = yes ]; then newname=$name fi case "$name" in @@ -175,16 +175,16 @@ package() { static() { pkgdesc="LLVM $_majorver static libraries" - provides="llvm-static=$pkgver-r$pkgrel" + _common_subpkg _mv "$pkgdir"/$_prefix/lib/*.a "$subpkgdir"/$_prefix/lib/ } libs() { pkgdesc="LLVM $_majorver runtime library" - provides="llvm-libs=$pkgver-r$pkgrel" local soname="libLLVM-$_majorver.0.so" local soname2="libLLVM-$pkgver.so" + _common_subpkg mkdir -p "$subpkgdir" cd "$subpkgdir" @@ -201,7 +201,7 @@ libs() { } dev() { - provides="llvm-dev=$pkgver-r$pkgrel" + _common_subpkg default_dev cd "$subpkgdir" @@ -213,8 +213,9 @@ dev() { _test_utils() { pkgdesc="LLVM $_majorver utilities for executing LLVM and Clang style test suites" - provides="llvm-test-utils=$pkgver-r$pkgrel" depends="python2" + _common_subpkg + replaces="" local litver=$(python2 "$builddir"/utils/lit/setup.py --version 2>/dev/null \ | sed 's/\.dev.*$//') @@ -222,11 +223,19 @@ _test_utils() { provides="$provides lit=$litver-r$pkgrel" cd "$builddir"/build + + install -D -m 755 bin/FileCheck "$subpkgdir"/$_prefix/bin/FileCheck + install -D -m 755 bin/not "$subpkgdir"/$_prefix/bin/not + python2 ../utils/lit/setup.py install --prefix=/usr --root="$subpkgdir" + ln -s ../../../bin/lit "$subpkgdir"/$_prefix/bin/lit +} - cd "$subpkgdir" - _mv "$pkgdir"/$_prefix/bin/FileCheck $_prefix/bin/ - _mv "$pkgdir"/$_prefix/bin/not $_prefix/bin/ +_common_subpkg() { + if [ "$_default_llvm" = yes ]; then + replaces="llvm${subpkgname#$pkgname}" + provides="$replaces=$pkgver-r$pkgrel" + fi } _mv() { |