summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-08-17 06:14:02 -0500
committerZach van Rijn <me@zv.io>2022-10-21 18:34:02 -0500
commit8bf016f47ea68e6a0f0d3d50480da8b0604bfd34 (patch)
tree8bd0a6bc8eed45188cb877a987d65eae1a3d7737 /user
parentb278ecb00a550e957ef534f4ed3de8aeffd914ec (diff)
downloadpackages-8bf016f47ea68e6a0f0d3d50480da8b0604bfd34.tar.gz
packages-8bf016f47ea68e6a0f0d3d50480da8b0604bfd34.tar.bz2
packages-8bf016f47ea68e6a0f0d3d50480da8b0604bfd34.tar.xz
packages-8bf016f47ea68e6a0f0d3d50480da8b0604bfd34.zip
user/llvm14: strip 'libLLVM-*.so' as may be too large for 32-bit systems. fixes #797.
Diffstat (limited to 'user')
-rw-r--r--user/llvm14/APKBUILD63
1 files changed, 29 insertions, 34 deletions
diff --git a/user/llvm14/APKBUILD b/user/llvm14/APKBUILD
index 185990987..10fb0a493 100644
--- a/user/llvm14/APKBUILD
+++ b/user/llvm14/APKBUILD
@@ -85,7 +85,7 @@ prepare() {
build() {
# Auto-detect it by guessing either.
- local ffi_include_dir="$(pkg-config --cflags-only-I libffi | sed 's|^-I||g')"
+ ffi_include_dir="$(pkg-config --cflags-only-I libffi | sed 's|^-I||g')"
cmake -G "Unix Makefiles" -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
@@ -145,28 +145,28 @@ package() {
# Symlink files from /usr/lib/llvm*/bin to /usr/bin.
mkdir -p "$pkgdir"/usr/bin
- local name newname path
- for path in bin/*; do
- name=${path##*/}
- # Add version infix/suffix to the executable name.
- case "$name" in
- llvm-*) newname="llvm$_majorver-${name#llvm-}";;
- *) newname="$name$_majorver";;
- esac
+ for full_name in bin/*; do
+ bin_name=${full_name##*/}
# If this package provides=llvm (i.e. it's the default/latest
# llvm package), omit version infix/suffix.
if [ "$_default_llvm" = yes ]; then
- newname=$name
+ link_name=$bin_name
+ # ..otherwise, add version infix/suffix to the executable name.
+ else case "$bin_name" in
+ llvm-*) link_name="llvm$_majorver-${bin_name#llvm-}";;
+ *) link_name="$bin_name$_majorver";;
+ esac
fi
case "$name" in
FileCheck | obj2yaml | yaml2obj) continue;;
esac
- ln -s ../lib/llvm$_majorver/bin/$name "$pkgdir"/usr/bin/$newname
+ ln -s ../lib/llvm$_majorver/bin/$bin_name "$pkgdir"/usr/bin/$link_name
done
# Move /usr/lib/$pkgname/include/ into /usr/include/$pkgname/
# and symlink it back.
- _mv include/* "$pkgdir"/usr/include/$pkgname/
+ mkdir -p "$pkgdir"/usr/include/$pkgname
+ mv include/* "$pkgdir"/usr/include/$pkgname/
rmdir include
ln -s ../../include/$pkgname include
@@ -177,39 +177,40 @@ static() {
pkgdesc="LLVM $_majorver static libraries"
_common_subpkg
- _mv "$pkgdir"/$_prefix/lib/*.a "$subpkgdir"/$_prefix/lib/
+ mkdir -p "$subpkgdir"/$_prefix/lib
+ mv "$pkgdir"/$_prefix/lib/*.a "$subpkgdir"/$_prefix/lib/
strip -d "$subpkgdir"/$_prefix/lib/*.a
}
libs() {
pkgdesc="LLVM $_majorver runtime library"
- local soname="libLLVM-$_majorver.so"
- local soname2="libLLVM-$pkgver.so"
+ main_soname="libLLVM-$_majorver.so"
+ ver_soname="libLLVM-$pkgver.so"
_common_subpkg
- mkdir -p "$subpkgdir"
- cd "$subpkgdir"
-
# 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/$soname2
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/$_prefix/lib/$main_soname "$subpkgdir"/usr/lib/
+ ln -s $main_soname "$subpkgdir"/usr/lib/$ver_soname
+ strip "$subpkgdir"/usr/lib/$ver_soname #797
# And also symlink it back to the LLVM prefix.
- mkdir -p $_prefix/lib
- ln -s ../../$soname $_prefix/lib/$soname
- ln -s ../../$soname $_prefix/lib/$soname2
+ mkdir -p "$subpkgdir"/$_prefix/lib
+ ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/$main_soname
+ ln -s ../../$main_soname "$subpkgdir"/$_prefix/lib/$ver_soname
}
dev() {
_common_subpkg
default_dev
- cd "$subpkgdir"
- _mv "$pkgdir"/$_prefix/lib $_prefix/
- _mv "$pkgdir"/$_prefix/include $_prefix/
+ mkdir -p "$subpkgdir"/$_prefix/bin
- _mv "$pkgdir"/$_prefix/bin/llvm-config $_prefix/bin/
+ mv "$pkgdir"/$_prefix/lib "$subpkgdir"/$_prefix/
+ mv "$pkgdir"/$_prefix/include "$subpkgdir"/$_prefix/
+
+ mv "$pkgdir"/$_prefix/bin/llvm-config "$subpkgdir"/$_prefix/bin/
}
_test_utils() {
@@ -218,7 +219,7 @@ _test_utils() {
_common_subpkg
replaces=""
- local litver="$(python3 "$builddir"/utils/lit/setup.py --version 2>/dev/null \
+ litver="$(python3 "$builddir"/utils/lit/setup.py --version 2>/dev/null \
| sed 's/\.dev.*$//')"
test -n "$litver" || return 1
provides="$provides lit=$litver-r$pkgrel"
@@ -240,12 +241,6 @@ _common_subpkg() {
fi
}
-_mv() {
- local dest; for dest; do true; done # get last argument
- mkdir -p "$dest"
- mv $@
-}
-
sha512sums="6461bdde27aac17fa44c3e99a85ec47ffb181d0d4e5c3ef1c4286a59583e3b0c51af3c8081a300f45b99524340773a3011380059e3b3a571c3b0a8733e96fc1d llvm-14.0.6.src.tar.xz
f84cd65d7042e89826ba6e8d48c4c302bf4980da369d7f19a55f217e51c00ca8ed178d453df3a3cee76598a7cecb94aed0775a6d24fe73266f82749913fc3e71 llvm-fix-build-with-musl-libc.patch
49c47f125014b60d0ea7870f981a2c1708ad705793f89287ed846ee881a837a4dc0170bf467e03f2ef56177473128945287749ac80dc2d13cfabcf8b929ba58a disable-FileSystemTest.CreateDir-perms-assert.patch