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-12-31 09:00:24 +0100
commit1029f0a5b6a91b0969dffec8fee64a24ca52e88e (patch)
treea38df6af0f3c8fce31ba5234261e8741aaf0187c
parentb89d335e2c218fc2ddf53622fb784413e3633237 (diff)
Include static library in the packageHEADpackages/packages/openmp
-rw-r--r--trunk/PKGBUILD35
1 files changed, 29 insertions, 6 deletions
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index efc1023..5ff13d0 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -1,12 +1,15 @@
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
-pkgname=openmp
+pkgname=openmp-static
+_pkgname=openmp
pkgver=9.0.1
pkgrel=1
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')
@@ -15,35 +18,55 @@ if [[ ${pkgver##*.} != 0 ]]; then
_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
fi
-source=($_source_base/$pkgname-$pkgver.src.tar.xz{,.sig})
+source=($_source_base/$_pkgname-$pkgver.src.tar.xz{,.sig})
sha256sums=('5c94060f846f965698574d9ce22975c0e9f04c9b14088c3af5f03870af75cace'
'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: