2022-03-20 13:34:07 +01:00
|
|
|
#!/usr/bin/bash
|
|
|
|
# JOBoRun : Jwm OpenBox Obarun RUNit
|
|
|
|
# Maintainer : Joe Bo Run <joborun@disroot.org>
|
|
|
|
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
|
|
|
|
# Website : https://pozol.eu
|
|
|
|
#-----------------------------------------| DESCRIPTION |---------------------------------------
|
|
|
|
|
2022-07-28 22:40:01 +02:00
|
|
|
pkgname=('llvm' 'llvm-libs')
|
2022-06-28 08:12:23 +02:00
|
|
|
pkgver=14.0.6
|
2022-07-28 22:40:01 +02:00
|
|
|
pkgrel=02
|
2022-03-20 13:34:07 +01:00
|
|
|
arch=('x86_64')
|
|
|
|
url="https://llvm.org/"
|
|
|
|
makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2'
|
2022-07-28 22:40:01 +02:00
|
|
|
'python-setuptools' 'python-psutil' 'python-sphinx'
|
|
|
|
'python-recommonmark')
|
2022-03-20 13:34:07 +01:00
|
|
|
options=('staticlibs' '!lto') # Getting thousands of test failures with LTO
|
|
|
|
_source_base=https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver
|
|
|
|
source=($_source_base/$pkgname-$pkgver.src.tar.xz{,.sig}
|
2022-06-28 08:12:23 +02:00
|
|
|
# don-t-accept-nullptr-as-GEP-element-type.patch
|
|
|
|
# don-t-override-__attribute__-no_stack_protector.patch
|
|
|
|
# don-t-move-DBG_VALUE-instructions.patch
|
|
|
|
# no-strict-aliasing-DwarfCompileUnit.patch
|
|
|
|
# disable-A-B-A-B-and-BSWAP-in-InstCombine.patch
|
|
|
|
# disable-DIArgList-in-SPIR-V.patch
|
2022-03-20 13:34:07 +01:00
|
|
|
llvm-config.h)
|
|
|
|
|
|
|
|
prepare() {
|
2022-06-28 08:12:23 +02:00
|
|
|
cd llvm-$pkgver.src
|
2022-03-20 13:34:07 +01:00
|
|
|
mkdir build
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2022-06-28 08:12:23 +02:00
|
|
|
cd llvm-$pkgver.src/build
|
|
|
|
|
|
|
|
local cmake_args=(
|
|
|
|
-G Ninja
|
|
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
-DCMAKE_INSTALL_DOCDIR=share/doc
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr
|
|
|
|
-DCMAKE_SKIP_RPATH=ON
|
2022-03-20 13:34:07 +01:00
|
|
|
-DLLVM_BINUTILS_INCDIR=/usr/include
|
2022-06-28 08:12:23 +02:00
|
|
|
-DLLVM_BUILD_DOCS=ON
|
|
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON
|
|
|
|
-DLLVM_BUILD_TESTS=ON
|
|
|
|
-DLLVM_ENABLE_BINDINGS=OFF
|
|
|
|
-DLLVM_ENABLE_FFI=ON
|
|
|
|
-DLLVM_ENABLE_RTTI=ON
|
|
|
|
-DLLVM_ENABLE_SPHINX=ON
|
|
|
|
-DLLVM_HOST_TRIPLE=$CHOST
|
|
|
|
-DLLVM_INCLUDE_BENCHMARKS=OFF
|
|
|
|
-DLLVM_INSTALL_UTILS=ON
|
|
|
|
-DLLVM_LINK_LLVM_DYLIB=ON
|
2022-07-28 22:40:01 +02:00
|
|
|
-DLLVM_USE_PERF=ON
|
2022-06-28 08:12:23 +02:00
|
|
|
-DSPHINX_WARNINGS_AS_ERRORS=OFF
|
|
|
|
)
|
|
|
|
cmake .. "${cmake_args[@]}"
|
|
|
|
ninja
|
2022-03-20 13:34:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
## almost at the end before last couple of checks it sticks and does not proceed - so skipped at this time
|
|
|
|
## the above with 13.0.0 let's see how the 13.0.1 does with the altered ninja check
|
2022-06-28 08:12:23 +02:00
|
|
|
## it did the same Same story with 14.0.6
|
2022-03-20 13:34:07 +01:00
|
|
|
#check() {
|
2022-06-28 08:12:23 +02:00
|
|
|
# cd llvm-$pkgver.src/build
|
2022-03-20 13:34:07 +01:00
|
|
|
# LD_LIBRARY_PATH=$PWD/lib ninja check
|
|
|
|
#}
|
|
|
|
|
|
|
|
package_llvm() {
|
|
|
|
pkgdesc="Collection of modular and reusable compiler and toolchain technologies"
|
|
|
|
depends=('llvm-libs' 'perl')
|
|
|
|
|
2022-06-28 08:12:23 +02:00
|
|
|
cd llvm-$pkgver.src/build
|
2022-03-20 13:34:07 +01:00
|
|
|
|
|
|
|
DESTDIR="$pkgdir" ninja install
|
|
|
|
|
|
|
|
# Include lit for running lit-based tests in other projects
|
|
|
|
pushd ../utils/lit
|
|
|
|
python3 setup.py install --root="$pkgdir" -O1
|
|
|
|
popd
|
|
|
|
|
|
|
|
# The runtime libraries go into llvm-libs
|
|
|
|
mv -f "$pkgdir"/usr/lib/lib{LLVM,LTO,Remarks}*.so* "$srcdir"
|
|
|
|
mv -f "$pkgdir"/usr/lib/LLVMgold.so "$srcdir"
|
|
|
|
|
|
|
|
if [[ $CARCH == x86_64 ]]; then
|
|
|
|
# Needed for multilib (https://bugs.archlinux.org/task/29951)
|
|
|
|
# Header stub is taken from Fedora
|
|
|
|
mv "$pkgdir/usr/include/llvm/Config/llvm-config"{,-64}.h
|
|
|
|
cp "$srcdir/llvm-config.h" "$pkgdir/usr/include/llvm/Config/llvm-config.h"
|
|
|
|
fi
|
2022-06-28 08:12:23 +02:00
|
|
|
|
|
|
|
# Remove documentation sources
|
|
|
|
rm -r "$pkgdir"/usr/share/doc/llvm/html/{_sources,.buildinfo}
|
2022-03-20 13:34:07 +01:00
|
|
|
|
|
|
|
install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_llvm-libs() {
|
|
|
|
pkgdesc="LLVM runtime libraries"
|
|
|
|
depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2')
|
|
|
|
|
|
|
|
install -d "$pkgdir/usr/lib"
|
|
|
|
cp -P \
|
|
|
|
"$srcdir"/lib{LLVM,LTO,Remarks}*.so* \
|
|
|
|
"$srcdir"/LLVMgold.so \
|
|
|
|
"$pkgdir/usr/lib/"
|
|
|
|
|
|
|
|
# Symlink LLVMgold.so from /usr/lib/bfd-plugins
|
|
|
|
# https://bugs.archlinux.org/task/28479
|
|
|
|
install -d "$pkgdir/usr/lib/bfd-plugins"
|
|
|
|
ln -s ../LLVMgold.so "$pkgdir/usr/lib/bfd-plugins/LLVMgold.so"
|
|
|
|
|
|
|
|
install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \
|
|
|
|
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#---- license gpg-key sha256sums ----
|
|
|
|
|
|
|
|
license=('custom:Apache 2.0 with LLVM Exception')
|
|
|
|
|
2022-07-28 22:40:01 +02:00
|
|
|
validpgpkeys=(474E22316ABF4785A88C6E8EA2C794A986419D8A) # Tom Stellard <tstellar@redhat.com>
|
2022-03-20 13:34:07 +01:00
|
|
|
|
2022-06-28 08:12:23 +02:00
|
|
|
sha256sums=(050922ecaaca5781fdf6631ea92bc715183f202f9d2f15147226f023414f619a # llvm-14.0.6.src.tar.xz
|
|
|
|
98fee8942d6f8c508760d76197018b3ceb0542bcf58d061c768a3e03ceeaa6e2 # llvm-14.0.6.src.tar.xz.sig
|
2022-03-20 13:34:07 +01:00
|
|
|
597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48) # llvm-config.h
|
2022-05-24 13:01:48 +02:00
|
|
|
|