summaryrefslogtreecommitdiff
path: root/repo/devel/llvm-libunwind.xibuild
blob: 9c61c31a6755aa3d52f0bc967528983aacfb8325 (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
#!/bin/sh

NAME="llvm-libunwind"
DESC="LLVM version of libunwind library"

MAKEDEPS="cmake "
DEPS="musl "

PKG_VER=13.0.0
SOURCE="https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/libunwind-$PKG_VER.src.tar.xz"

ADDITIONAL="
    https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/llvm-$PKG_VER.src.tar.xz
	https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/libcxx-$PKG_VER.src.tar.xz
    libunwind-link-libssp.patch 
    libcxx-musl.patch 
"

prepare () {
    tar xvf libunwind-$PKG_VER.src.tar.xz
    tar xvf llvm-$PKG_VER.src.tar.xz
    tar xvf libcxx-$PKG_VER.src.tar.xz
    mv libunwind-$PKG_VER.src libunwind
    mv llvm-$PKG_VER.src llvm
    mv libcxx-$PKG_VER.src libcxx

    apply_patches
}

build () {
	cmake -B build -G Ninja -S libunwind \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_C_FLAGS_MINSIZEREL_INIT="$CFLAGS" \
		-DCMAKE_CXX_FLAGS_MINSIZEREL_INIT="$CXXFLAGS" \
		-DCMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT="$LDFLAGS" \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLIBUNWIND_HAS_NODEFAULTLIBS_FLAG=OFF \
		-DLIBUNWIND_STANDALONE_BUILD=ON 
	cmake --build build
}

package () {
	DESTDIR="$PKG_DEST" cmake --install build
    mkdir -p "$PKG_DEST"/usr/include/mach-o
	cp libunwind/include/*.h "$PKG_DEST"/usr/include/
	cp libunwind/include/mach-o/*.h "$PKG_DEST"/usr/include/mach-o/

}