CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
b88e010478133c4c1da102ce4406cbe1e72feebd
[ports/opt-arm.git] / llvm / Pkgfile
1 # Description: LLVM compiler backend
2 # URL: http://llvm.org/
3 # Maintainer: Thomas Penteker, tek at serverop dot de
4 # Depends on: cmake libffi libxml2 ninja
5 # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
6
7 name=llvm
8 version=14.0.0
9 release=1
10 source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/$name-$version.src.tar.xz
11 llvm-config.h)
12
13 build() {
14 cmake -S $name-$version.src -B build -G Ninja \
15 -D CMAKE_INSTALL_PREFIX=/usr \
16 -D CMAKE_BUILD_TYPE=Release \
17 -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
18 -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
19 -D LLVM_TARGETS_TO_BUILD='ARM' \
20 -D LLVM_BUILD_LLVM_DYLIB=ON \
21 -D LLVM_LINK_LLVM_DYLIB=ON \
22 -D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
23 -D LLVM_INCLUDE_EXAMPLES=OFF \
24 -D LLVM_INCLUDE_TESTS=OFF \
25 -D LLVM_ENABLE_FFI=ON \
26 -D LLVM_ENABLE_RTTI=ON \
27 -D LLVM_ENABLE_OCAMLDOC=OFF \
28 -D LLVM_INSTALL_UTILS=1 \
29 -D LLVM_ENABLE_LIBCXX=OFF \
30 -D LLVM_ENABLE_LLD="$(prt-get isinst lld >/dev/null && echo ON || echo OFF)" \
31 -D LLVM_OPTIMIZED_TABLEGEN=ON \
32 -D LLVM_INCLUDE_BENCHMARKS=OFF \
33 -Wno-dev
34
35 cmake --build build
36 DESTDIR=$PKG cmake --install build
37
38 # multilib stub
39 mv $PKG/usr/include/llvm/Config/llvm-config{,-32}.h
40 install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
41
42 install -d $PKG/usr/lib/bfd-plugins
43 ln -s ../LLVMgold.so $PKG/usr/lib/bfd-plugins/
44 ln -s ../libLTO.so $PKG/usr/lib/bfd-plugins/
45
46 /usr/bin/python3 $name-$version.src/utils/lit/setup.py build
47 /usr/bin/python3 $name-$version.src/utils/lit/setup.py install --prefix=/usr --root=$PKG
48 /usr/bin/python3 -m compileall -d $name-$version.src/utils/lit $PKG
49 /usr/bin/python3 -O -m compileall -d $name-$version.src/utils/lit $PKG
50 /usr/bin/python3 -OO -m compileall -d $name-$version.src/utils/lit $PKG
51 }