blob: ee1048c4f123d4e073b1755001e5b71d982cba6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
# Maintainer: archibald869 <archibald869 at web dot de>
pkgname=cling
pkgver=0.9
pkgrel=5
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")
makedepends=("git" "cmake" "ninja" "python")
optdepends=(
"perl: support for scan-build, ccc-analyzer and c++-analyzer"
"python: support for scan-view and Jupyter"
"python-pygments: support for opt-viewer"
"python-yaml: support for opt-viewer"
)
source=(
"cling-llvm::git+http://root.cern/git/llvm.git#tag=cling-v$pkgver"
"cling-clang::git+http://root.cern/git/clang.git#tag=cling-v$pkgver"
"cling::git+http://root.cern/git/cling.git#tag=v$pkgver"
)
sha256sums=(
"SKIP"
"SKIP"
"SKIP"
)
options=('!lto')
prepare() {
if [ ! -h "$srcdir/cling-llvm/tools/clang" ]; then
ln -s "$srcdir/cling-clang" "$srcdir/cling-llvm/tools/clang"
fi
if [ ! -h "$srcdir/cling-llvm/tools/cling" ]; then
ln -s "$srcdir/cling" "$srcdir/cling-llvm/tools/cling"
fi
# patch missing header file
sed -i '/^#include <vector>$/i #include <limits>' \
"$srcdir/cling-llvm/utils/benchmark/src/benchmark_register.h"
}
build() {
mkdir -p "$srcdir/build"
cd "$srcdir/build"
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/opt/cling" \
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" \
-DLLVM_BUILD_LLVM_DYLIB=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_ENABLE_SPHINX=OFF \
-DLLVM_ENABLE_DOXYGEN=OFF \
-DFFI_INCLUDE_DIR=$(pkg-config --cflags-only-I libffi | cut -c3-) \
"$srcdir/cling-llvm"
ninja
}
package() {
cd "$srcdir/build"
DESTDIR="$pkgdir" ninja install
install -d "$pkgdir/usr/bin"
ln -s "/opt/cling/bin/cling" "$pkgdir/usr/bin/cling"
install -Dm644 "$srcdir/cling-llvm/tools/cling/LICENSE.TXT" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# include CMake target import file so that other packages are able to use
# `find_package(Cling REQUIRED)`
install -Dm644 "$srcdir/build/lib/cmake/cling/ClingTargets.cmake" \
"$pkgdir/opt/cling/lib/cmake/cling"
# adjust cling target locations
sed -Ei 's#(IMPORTED_LOCATION_RELEASE) ".*/([^/]*)"#\1 "/opt/cling/lib/\2"#g' \
"$pkgdir/opt/cling/lib/cmake/cling/ClingTargets.cmake"
# omit man page for clang's scan-build
rm -f "$pkgdir/opt/cling/share/man/man1/scan-build.1"
# remove empty directories
rmdir -p --ignore-fail-on-non-empty "$pkgdir/opt/cling/share/man/man1"
rmdir -p --ignore-fail-on-non-empty "$pkgdir/opt/cling/include/cling/cint"
}
|