summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Klinkovsk√Ĺ <j.l.k@gmx.com>2018-03-24 19:25:54 +0100
committerJakub Klinkovsk√Ĺ <j.l.k@gmx.com>2019-10-11 09:02:19 +0200
commit6e7309c7fd7b84a16dfe17f688649d7394663215 (patch)
tree1e8d0cf5c07889e4244386aaf83f6d640fb0cd90
parent76ba2b24c7e2d453764d42de2bdda6bff6f59683 (diff)
Include static library in the package
-rw-r--r--trunk/PKGBUILD35
1 files changed, 29 insertions, 6 deletions
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 9303706..5c1a019 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -1,43 +1,66 @@
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
-pkgname=openmp
+pkgname=openmp-static
+_pkgname=openmp
pkgver=9.0.0
pkgrel=2
pkgdesc="LLVM OpenMP Runtime Library"
arch=('x86_64')
url="https://openmp.llvm.org/"
license=('custom:Apache 2.0 with LLVM Exception')
+conflicts=('openmp')
+provides=('openmp')
depends=('glibc' 'libelf' 'libffi')
makedepends=('cmake' 'ninja')
-source=(https://releases.llvm.org/$pkgver/$pkgname-$pkgver.src.tar.xz{,.sig})
+source=(https://releases.llvm.org/$pkgver/$_pkgname-$pkgver.src.tar.xz{,.sig})
sha256sums=('9979eb1133066376cc0be29d1682bc0b0e7fb541075b391061679111ae4d3b5b'
'SKIP')
validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org>
validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com>
+# preserve static library
+options=('staticlibs')
+
prepare() {
- cd "$pkgname-$pkgver.src"
+ cd "$_pkgname-$pkgver.src"
mkdir build
+ mkdir build_static
}
build() {
- cd "$pkgname-$pkgver.src/build"
+ cd "$_pkgname-$pkgver.src/build"
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
ninja
+
+ cd "../../$_pkgname-$pkgver.src/build_static"
+
+ cmake .. -G Ninja \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIBOMP_ENABLE_SHARED=no
+ ninja
}
package() {
- cd "$pkgname-$pkgver.src/build"
+ cd "$_pkgname-$pkgver.src/build"
DESTDIR="$pkgdir" ninja install
- install -Dm644 ../LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 ../LICENSE.txt "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
# libgomp.so is also provided by gcc-libs; remove it to fix the conflict
rm "$pkgdir/usr/lib/libgomp.so"
+
+ # install static library
+ # (we can't run "ninja install" because cmake insists on removing libomp.a
+ # before installing libomp.so into the same directory)
+ cd "../../$_pkgname-$pkgver.src/build_static"
+
+ install -m644 runtime/src/libomp.a "$pkgdir/usr/lib/libomp.a"
+ ln -s libomp.a "$pkgdir/usr/lib/libiomp5.a"
}
# vim:set ts=2 sw=2 et: