-
Notifications
You must be signed in to change notification settings - Fork 16
/
PKGBUILD
55 lines (45 loc) · 2.13 KB
/
PKGBUILD
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
pkgbase="llvm-project"
pkgname='llvm'
pkgver=19.1.3
pkgrel=1
pkgdesc="The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs."
arch=('x86_64')
url="https://llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
depends=('perl' 'libffi')
makedepends=('gcc-libs' 'python3' 'ocaml' 'gcc' 'groff' 'swig' 'cmake') # 'ocaml-ctypes' 'findlib' needed to have CMake build find ocaml
source=("https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver}/${pkgbase}-${pkgver}.src.tar.xz")
md5sums=('ec2e698a03ceb4a12d35f2e0dfa208ce')
prepare() {
cd ${pkgbase}-${pkgver}.src
# http://llvm.org/bugs/show_bug.cgi?id=22742
#chmod -R u=rwX,go=rX ${srcdir}/llvm-${pkgver}.src
# https://www.mail-archive.com/blfs-dev@lists.linuxfromscratch.org/msg09727.html
#sed -i "/ipc_perm, mode/s@^C@//C@" projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
}
build() {
_ffi_include_flags=$(pkg-config --cflags-only-I libffi)
_ffi_libs_flags=$(pkg-config --libs-only-L libffi)
cmake -B build -S ${pkgbase}-${pkgver}.src/llvm \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DLLVM_ENABLE_PROJECTS="lld" \
-DLLVM_APPEND_VC_REV:BOOL=ON \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_ENABLE_FFI:BOOL=ON \
-DFFI_INCLUDE_DIR:PATH="${_ffi_include_flags#-I}" \
-DFFI_LIBRARY_DIR:PATH="${_ffi_libs_flags#-L}" \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DLLVM_BINUTILS_INCDIR:PATH=/usr/include \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DBUG_REPORT_URL="https://kaosx.us/docs/bugs/"
#-DLLVM_COMMON_CMAKE_UTILS=${CMAKE_CURRENT_SOURCE_DIR}/../cmake-${pkgver}.src
cmake --build build
}
package() {
DESTDIR=${pkgdir} cmake --install build
# Fix permissions of static libs
chmod -x ${pkgdir}/usr/lib/*.a
install -D -m644 llvm-project-${pkgver}.src/llvm/LICENSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}