diff options
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | Makefile | 20 | ||||
-rw-r--r-- | PKGBUILD | 72 |
4 files changed, 122 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a0f4f231e994 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = cling + pkgdesc = Interactive C++ interpreter, built on the top of LLVM and Clang libraries + pkgver = 0.6 + pkgrel = 1 + url = https://root.cern.ch/cling + arch = i686 + arch = x86_64 + license = custom:Cling Release License + depends = libxml2 + depends = libffi + optdepends = python2: support for scan-view and Jupyter + optdepends = perl: support for scan-build, ccc-analyzer and c++-analyzer + provides = cling + conflicts = cling + source = llvm::git+http://root.cern.ch/git/llvm.git#branch=cling-patches + source = clang::git+http://root.cern.ch/git/clang.git#branch=cling-patches + source = cling::git+http://root.cern.ch/git/cling.git#tag=v0.6 + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + +pkgname = cling + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..6ab777fff14d --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/build +/clang/ +/cling/ +/llvm/ +/pkg/ +/src/ +*.tar.xz diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..89311c2f9c3a --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.DEFAULT_GOAL := .SRCINFO +.PHONY: all install check clean + +.SRCINFO: PKGBUILD + makepkg --printsrcinfo > .SRCINFO + +all: build install + +build: PKGBUILD .SRCINFO + makepkg -f + touch build + +install: build + makepkg -i + +check: build + namcap *.tar.xz + +clean: + rm -rf build clang cling llvm pkg src *.tar.* diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6503cc532b81 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,72 @@ +# Maintainer: archibald869 <archibald869 at web dot de> + +pkgname=cling +pkgver=0.6 +pkgrel=1 +pkgdesc="Interactive C++ interpreter, built on the top of LLVM and Clang libraries" +arch=("i686" "x86_64") +url="https://root.cern.ch/cling" +license=("custom:Cling Release License") +provides=("cling") +conflicts=("cling") +depends=("libxml2" "libffi") +optdepends=( + "python2: support for scan-view and Jupyter" + "perl: support for scan-build, ccc-analyzer and c++-analyzer" +) +source=( + "llvm::git+http://root.cern.ch/git/llvm.git#branch=cling-patches" + "clang::git+http://root.cern.ch/git/clang.git#branch=cling-patches" + "cling::git+http://root.cern.ch/git/cling.git#tag=v$pkgver" +) +sha256sums=( + "SKIP" + "SKIP" + "SKIP" +) +_num_cores=$(getconf _NPROCESSORS_ONLN) + + +prepare() { + if [ ! -h "$srcdir/llvm/tools/clang" ]; then + ln -s "$srcdir/clang" "$srcdir/llvm/tools/clang" + fi + + if [ ! -h "$srcdir/llvm/tools/cling" ]; then + ln -s "$srcdir/cling" "$srcdir/llvm/tools/cling" + fi +} + +build() { + mkdir -p "$srcdir/build" + cd "$srcdir/build" + + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="/opt/cling" \ + -DLLVM_TARGETS_TO_BUILD="host" \ + -DLLVM_BUILD_LLVM_DYLIB=OFF \ + -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 --cflags-only-I libffi | cut -c3-) \ + "$srcdir/llvm" + + make -C tools/clang -j$_num_cores + make -C tools/cling -j$_num_cores +} + +package() { + cd "$srcdir/build" + + make -C tools/clang -j$_num_cores DESTDIR="$pkgdir" install + make -C tools/cling -j$_num_cores DESTDIR="$pkgdir" install + + install -d "$pkgdir/usr/bin" + ln -s "/opt/cling/bin/cling" "$pkgdir/usr/bin/cling" + + install -Dm644 "$srcdir/llvm/tools/cling/LICENSE.TXT" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} |