diff options
author | LW-archlinux | 2019-05-14 21:33:31 +0200 |
---|---|---|
committer | LW-archlinux | 2019-05-14 21:33:31 +0200 |
commit | bd7b54edf60a04bfac1d540f3c79111b567ef129 (patch) | |
tree | 623a51602d3e6105dbd84a2b213836718ed75156 | |
download | aur-bd7b54edf60a04bfac1d540f3c79111b567ef129.tar.gz |
initial upload
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | PKGBUILD | 139 |
2 files changed, 177 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f734de465d7d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +pkgbase = lib32-llvm-minimal-git + pkgver = 9.0.0_r316430.48c4e4fa802 + pkgrel = 1 + url = http://llvm.org/ + arch = x86_64 + license = custom:University of Illinois/NCSA Open Source License + makedepends = git + makedepends = cmake + makedepends = ninja + makedepends = lib32-libffi + makedepends = lib32-zlib + makedepends = python + makedepends = lib32-gcc-libs + makedepends = lib32-libxml2 + source = llvm-project::git+https://github.com/llvm/llvm-project.git + md5sums = SKIP + sha512sums = SKIP + +pkgname = lib32-llvm-minimal-git + pkgdesc = Collection of modular and reusable compiler and toolchain technologies (32-bit) + depends = lib32-llvm-libs-minimal-git=9.0.0_r316430.48c4e4fa802-1 + depends = llvm-minimal-git + provides = lib32-llvm=9.0.0_r316430.48c4e4fa802-1 + provides = lone_wolf-lib32-llvm-git + conflicts = lib32-llvm + replaces = lone_wolf-lib32-llvm-git + +pkgname = lib32-llvm-libs-minimal-git + pkgdesc = Low Level Virtual Machine (runtime library)(32-bit) + depends = lib32-libffi + depends = lib32-zlib + depends = lib32-ncurses + depends = lib32-libxml2 + depends = lib32-gcc-libs + optdepends = lib32-llvm-libs: for LLVMgold linker + provides = lone_wolf-lib32-llvm-libs-git=9.0.0_r316430.48c4e4fa802-1 + replaces = lone_wolf-lib32-llvm-libs-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..78de7da045eb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,139 @@ +# Maintainer: Lone_Wolf <lonewolf@xs4all.nl> +# Contributor: yurikoles <root@yurikoles.com> +# Contributor: bearoso <bearoso@gmail.com> +# Contributor: Luchesar V. ILIEV <luchesar%2eiliev%40gmail%2ecom> +# Contributor: Laurent Carlier <lordheavym@gmail.com> +# Contributor: Anders Bergh <anders@archlinuxppc.org> +# Contributor: Armin K. <krejzi at email dot com> +# Contributor: Christian Babeux <christian.babeux@0x80.ca> +# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> +# Contributor: Evangelos Foutras <evangelos@foutrelis.com> +# Contributor: Hesiod (https://github.com/hesiod) +# Contributor: Roberto Alsina <ralsina@kde.org> +# Contributor: Thomas Dziedzic < gostrc at gmail > +# Contributor: Tomas Lindquist Olsen <tomas@famolsen.dk> +# Contributor: Tomas Wilhelmsson <tomas.wilhelmsson@gmail.com> + + + + +pkgbase=lib32-llvm-minimal-git +pkgname=('lib32-llvm-minimal-git' 'lib32-llvm-libs-minimal-git') +pkgver=9.0.0_r316430.48c4e4fa802 +pkgrel=1 +arch=('x86_64') +url="http://llvm.org/" +license=('custom:University of Illinois/NCSA Open Source License') +makedepends=('git' 'cmake' 'ninja' 'lib32-libffi' 'lib32-zlib' 'python' 'lib32-gcc-libs' + 'lib32-libxml2') +source=("llvm-project::git+https://github.com/llvm/llvm-project.git") +md5sums=('SKIP') +sha512sums=('SKIP') + +pkgver() { + cd llvm-project/llvm + + # This will almost match the output of `llvm-config --version` when the + # LLVM_APPEND_VC_REV cmake flag is turned on. The only difference is + # dash being replaced with underscore because of Pacman requirements. + local _pkgver=$(awk -F 'MAJOR |MINOR |PATCH |)' \ + 'BEGIN { ORS="." ; i=0 } \ + /set\(LLVM_VERSION_/ { print $2 ; i++ ; if (i==2) ORS="" } \ + END { print "\n" }' \ + CMakeLists.txt)_r$(git rev-list --count HEAD).$(git rev-parse --short HEAD) + echo "${_pkgver}" +} + +prepare() { + if [ -d _build ]; then + rm -rf _build + fi + mkdir _build + + cd llvm-project + # remove code parts not needed to build llvm itself + rm -rf clang clang-tools-extra compiler-rt debuginfo-tests libclc libcxx libcxxabi libunwind lld lldb llgo openmp parallel-libs polly pstl +} + +build() { + cd _build + + export PKG_CONFIG_PATH="/usr/lib32/pkgconfig" + + cmake "$srcdir"/llvm-project/llvm -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLLVM_LIBDIR_SUFFIX=32 \ + -DCMAKE_C_FLAGS:STRING=-m32 \ + -DCMAKE_CXX_FLAGS:STRING=-m32 \ + -DLLVM_TARGET_ARCH:STRING=i686 \ + -DLLVM_HOST_TRIPLE=$CHOST \ + -DLLVM_DEFAULT_TARGET_TRIPLE="i686-pc-linux-gnu" \ + -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_ENABLE_SPHINX=OFF \ + -DLLVM_ENABLE_DOXYGEN=OFF \ + -DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \ + -DLLVM_BINUTILS_INCDIR=/usr/include \ + -DLLVM_VERSION_SUFFIX="" \ + -DLLVM_ENABLE_BINDINGS=OFF + + if [[ ! $NINJAFLAGS ]]; then + ninja + else + ninja "$NINJAFLAGS" + fi +} + +package_lib32-llvm-minimal-git() { + pkgdesc="Collection of modular and reusable compiler and toolchain technologies (32-bit)" + depends=(lib32-llvm-libs-minimal-git=$pkgver-$pkgrel llvm-minimal-git) + conflicts=('lib32-llvm') + provides=(lib32-llvm=$pkgver-$pkgrel lone_wolf-lib32-llvm-git) + replaces=(lone_wolf-lib32-llvm-git) + + cd _build + DESTDIR="$pkgdir" ninja install + + # Remove files which conflict with lib32-llvm-libs + rm "$pkgdir"/usr/lib32/{LLVMgold,lib{LLVM,LTO}}.so + + # The runtime library goes into lib32-llvm-libs-git + mv "$pkgdir"/usr/lib32/lib{LLVM,LTO}*.so* "$srcdir" + + mv "$pkgdir"/usr/bin/llvm-config "$pkgdir"/usr/lib32/llvm-config + mv "$pkgdir"/usr/include/llvm/Config/llvm-config.h \ + "$pkgdir"/usr/lib32/llvm-config-32.h + + rm -rf "$pkgdir"/usr/{bin,include,share/{doc,man,llvm,opt-viewer}} + + # Needed for multilib (https://bugs.archlinux.org/task/29951) + # Header stub is taken from Fedora + install -d "$pkgdir"/usr/include/llvm/Config + mv "$pkgdir"/usr/lib32/llvm-config-32.h "$pkgdir"/usr/include/llvm/Config/ + + mkdir "$pkgdir"/usr/bin + mv "$pkgdir"/usr/lib32/llvm-config "$pkgdir"/usr/bin/llvm-config32 + + install -Dm644 "$srcdir"/llvm-project/llvm/LICENSE.TXT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +} + +package_lib32-llvm-libs-minimal-git() { + pkgdesc="Low Level Virtual Machine (runtime library)(32-bit)" + depends=('lib32-libffi' 'lib32-zlib' 'lib32-ncurses' 'lib32-libxml2' 'lib32-gcc-libs') + optdepends=('lib32-llvm-libs: for LLVMgold linker') + provides=(lone_wolf-lib32-llvm-libs-git=$pkgver-$pkgrel) + replaces=(lone_wolf-lib32-llvm-libs-git) + + install -d "$pkgdir"/usr/lib32 + + cp -P \ + "$srcdir"/lib{LLVM,LTO}*.so* \ + "$pkgdir"/usr/lib32/ + + install -Dm644 "$srcdir"/llvm-project/llvm/LICENSE.TXT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE +} |