diff options
author | soloturn | 2020-10-05 18:40:39 +0200 |
---|---|---|
committer | soloturn | 2020-10-05 19:27:31 +0200 |
commit | f771f811346f69fa85605142d2f258aa8efe8300 (patch) | |
tree | ccc846a1a5dd7b0f87ac87fcc3206d15fa86b6fc | |
download | aur-f771f811346f69fa85605142d2f258aa8efe8300.tar.gz |
initial
-rw-r--r-- | .SRCINFO | 50 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 136 |
3 files changed, 187 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..82c7de362273 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,50 @@ +pkgbase = swift-llvm-git + pkgver = 10.0.1 + pkgrel = 3 + url = https://github.com/apple/swift-llvm + arch = x86_64 + license = custom:Apache 2.0 with LLVM Exception + makedepends = cmake + makedepends = ninja + makedepends = libffi + makedepends = libedit + makedepends = ncurses + makedepends = libxml2 + makedepends = ocaml>=4.11.1 + makedepends = ocaml-ctypes + makedepends = ocaml-findlib + makedepends = python-sphinx + makedepends = python-recommonmark + options = staticlibs + source = git+https://github.com/apple/llvm-project#branch=swift/main + validpgpkeys = B6C8F98282B944E3B0D5C2530FC3042E345AD05D + validpgpkeys = 474E22316ABF4785A88C6E8EA2C794A986419D8A + sha256sums = SKIP + +pkgname = swift-llvm-git + pkgdesc = Collection of modular and reusable compiler and toolchain technologies + depends = swift-llvm-libs + depends = perl + optdepends = python-setuptools: for using lit (LLVM Integrated Tester) + provides = swift-llvm + conflicts = swift-llvm + +pkgname = swift-llvm-libs-git + pkgdesc = LLVM runtime libraries + depends = gcc-libs + depends = zlib + depends = libffi + depends = libedit + depends = ncurses + depends = libxml2 + provides = swift-llvm-libs + conflicts = swift-llvm-libs + +pkgname = swift-llvm-ocaml-git + pkgdesc = OCaml bindings for LLVM + depends = swift-llvm + depends = ocaml=4.11.1 + depends = ocaml-ctypes + provides = swift-llvm-ocaml + conflicts = swift-llvm-ocaml + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..4f00cd9a7367 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/src/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..3fc3f4fefa66 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,136 @@ +# Maintainer: soloturn@gmail.com +# Contributor: Evangelos Foutras <evangelos@foutrelis.com> +# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com> + +pkgname=('swift-llvm-git' 'swift-llvm-libs-git' 'swift-llvm-ocaml-git') +instprefix="usr/lib/swift-git" +pkgver=10.0.1 +pkgrel=3 +_ocaml_ver=4.11.1 +arch=('x86_64') +url="https://github.com/apple/swift-llvm" +license=('custom:Apache 2.0 with LLVM Exception') +makedepends=('cmake' 'ninja' 'libffi' 'libedit' 'ncurses' 'libxml2' + "ocaml>=$_ocaml_ver" 'ocaml-ctypes' 'ocaml-findlib' + 'python-sphinx' 'python-recommonmark') +options=('staticlibs') +source=( + git+https://github.com/apple/llvm-project#branch=swift/main +# do not do in a first version until somebody reports a bug +# llvm-config.h +) +sha256sums=( + 'SKIP' +) +validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <hans@chromium.org> +validpgpkeys+=('474E22316ABF4785A88C6E8EA2C794A986419D8A') # Tom Stellard <tstellar@redhat.com> + +prepare() { + cd "$srcdir/llvm-project/llvm" + mkdir -p build +} + +build() { + cd "$srcdir/llvm-project/llvm/build" + + ls -l .. + cmake .. -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/$instprefix\ + -DLLVM_HOST_TRIPLE=$CHOST \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_INSTALL_UTILS=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_FFI=ON \ + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR \ + -DLLVM_BUILD_TESTS=ON \ + -DLLVM_BUILD_DOCS=ON \ + -DLLVM_ENABLE_SPHINX=ON \ + -DLLVM_ENABLE_DOXYGEN=OFF \ + -DSPHINX_WARNINGS_AS_ERRORS=OFF \ + -DLLVM_BINUTILS_INCDIR=/usr/include + ninja all ocaml_doc +} + +check() { + cd "$srcdir/llvm-project/llvm/build" + ninja check +} + +package_swift-llvm-git() { + pkgdesc="Collection of modular and reusable compiler and toolchain technologies" + depends=('swift-llvm-libs' 'perl') + optdepends=('python-setuptools: for using lit (LLVM Integrated Tester)') + conflicts=(swift-llvm) + provides=(swift-llvm) + + cd "$srcdir/llvm-project/llvm/build" + + 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 + + # Remove documentation sources + rm -r "$pkgdir"/$instprefix/share/doc/$pkgname/html/{_sources,.buildinfo} + + # The runtime libraries go into llvm-libs + mv -f "$pkgdir"/$instprefix/lib/lib{LLVM,LTO,Remarks}*.so* "$srcdir" + mv -f "$pkgdir"/$instprefix/lib/LLVMgold.so "$srcdir" + + # OCaml bindings go to a separate package + rm -rf "$srcdir"/ocaml.{lib,doc} + mv "$pkgdir/$instprefix/lib/ocaml" "$srcdir/ocaml.lib" + mv "$pkgdir/$instprefix/share/doc/$pkgname/ocaml-html" "$srcdir/ocaml.doc" + +# do not do in a first version until somebody reports a bug +# if [[ $CARCH == x86_64 ]]; then +# # Needed for multilib (https://bugs.archlinux.org/task/29951) +# # Header stub is taken from Fedora +# mv "$pkgdir/$instprefix/include/llvm/Config/llvm-config"{,-64}.h +# cp "$srcdir/llvm-config.h" "$pkgdir/$instprefix/include/llvm/Config/llvm-config.h" +# fi + + install -Dm644 ../LICENSE.TXT "$pkgdir/$instprefix/share/licenses/$pkgname/LICENSE" +} + +package_swift-llvm-libs-git() { + pkgdesc="LLVM runtime libraries" + depends=('gcc-libs' 'zlib' 'libffi' 'libedit' 'ncurses' 'libxml2') + conflicts=(swift-llvm-libs) + provides=(swift-llvm-libs) + + install -d "$pkgdir/$instprefix/lib" + cp -P \ + "$srcdir"/lib{LLVM,LTO,Remarks}*.so* \ + "$srcdir"/LLVMgold.so \ + "$pkgdir/$instprefix/lib/" + + # Symlink LLVMgold.so from /$instprefix/lib/bfd-plugins + # https://bugs.archlinux.org/task/28479 + install -d "$pkgdir/$instprefix/lib/bfd-plugins" + ln -s ../LLVMgold.so "$pkgdir/$instprefix/lib/bfd-plugins/LLVMgold.so" + + install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \ + "$pkgdir/$instprefix/share/licenses/$pkgname/LICENSE" +} + +package_swift-llvm-ocaml-git() { + pkgdesc="OCaml bindings for LLVM" + depends=('swift-llvm' "ocaml=$_ocaml_ver" 'ocaml-ctypes') + conflicts=(swift-llvm-ocaml) + provides=(swift-llvm-ocaml) + + install -d "$pkgdir"/$instprefix/lib,$instprefix/share/doc/$pkgname} + cp -a "$srcdir/ocaml.lib" "$pkgdir/$instprefix/lib/ocaml" + cp -a "$srcdir/ocaml.doc" "$pkgdir/$instprefix/share/doc/$pkgname/html" + + install -Dm644 "$srcdir/llvm-$pkgver.src/LICENSE.TXT" \ + "$pkgdir/$instprefix/share/licenses/$pkgname/LICENSE" +} + +# vim:set ts=2 sw=2 et + |