summaryrefslogtreecommitdiff
path: root/repo/devel
diff options
context:
space:
mode:
Diffstat (limited to 'repo/devel')
-rw-r--r--repo/devel/clang.xibuild54
-rw-r--r--repo/devel/llvm.xibuild24
2 files changed, 71 insertions, 7 deletions
diff --git a/repo/devel/clang.xibuild b/repo/devel/clang.xibuild
new file mode 100644
index 0000000..fa4430f
--- /dev/null
+++ b/repo/devel/clang.xibuild
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+MAKEDEPS="cmake llvm libxml2 ninja python3"
+DEPS="curl gcc libssh2 openssl"
+
+PKG_VER=13.0.1
+SOURCE=https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/clang-$PKG_VER.src.tar.xz
+DESC="Systems programming language focused on safety, speed and concurrency"
+
+ADDITIONAL="
+ patches/clang/30-Enable-stack-protector-by-default-for-Alpine-Linux.patch
+ patches/clang/10-add-musl-triples.patch
+ "
+
+prepare () {
+ apply_patches
+}
+
+build () {
+ mkdir build
+ cd build
+
+ python_version=$(python3 -V | sed 's/.*\([0-9]\{1,\}\.[0-9]\{1,\}\)\..*/\1/')
+
+
+ cmake .. -G Ninja -Wno-dev \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_C_FLAGS_RELEASE_INIT="$CFLAGS -O2" \
+ -DCMAKE_CXX_FLAGS_RELEASE_INIT="$CXXFLAGS" \
+ -DCMAKE_EXE_LINKER_FLAGS_RELEASE_INIT="$LDFLAGS -Wl,-z,stack-size=2097152" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_VERBOSE_MAKEFILE=OFF \
+ -DCLANG_VENDOR=Alpine \
+ -DLLVM_EXTERNAL_LIT=/usr/bin/lit \
+ -DCLANG_BUILD_EXAMPLES=OFF \
+ -DCLANG_INCLUDE_DOCS=ON \
+ -DCLANG_PYTHON_BINDINGS_VERSIONS="$python_version" \
+ -DLLVM_BUILD_DOCS=ON \
+ -DLLVM_ENABLE_SPHINX=ON \
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF \
+ -DCLANG_INCLUDE_TESTS=ON \
+ -DCLANG_PLUGIN_SUPPORT=ON \
+ -DLIBCLANG_BUILD_STATIC=ON \
+ -DLLVM_ENABLE_EH=ON \
+ -DLLVM_ENABLE_RTTI=ON
+
+ ninja clang-tblgen
+ ninja
+}
+
+package () {
+ DESTDIR=$PKG_DEST ninja -C build install
+ install -m 644 build/lib/libclang.a $PKG_DEST/usr/lib
+}
diff --git a/repo/devel/llvm.xibuild b/repo/devel/llvm.xibuild
index 134a994..aa18732 100644
--- a/repo/devel/llvm.xibuild
+++ b/repo/devel/llvm.xibuild
@@ -1,6 +1,6 @@
#!/bin/sh
-MAKEDEPS="make ninja cmake libedit libffi libxml2 ncurses python"
+MAKEDEPS="make ninja cmake libedit libffi libxml2 ncurses python-setuptools python-sphinx"
DEPS="perl zlib libffi libedit ncurses"
PKG_VER=13.0.0
@@ -12,11 +12,11 @@ package () {
}
build () {
- mkdir build &&
- cd build &&
-
+ mkdir build
+ cd build
CC=gcc CXX=g++ \
- cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
@@ -25,11 +25,21 @@ build () {
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU;BPF" \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_INSTALL_UTILS=ON \
+ -DLLVM_ENABLE_SPHINX=ON \
+ -DLLVM_ENABLE_TERMINFO=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-Wno-dev -G Ninja .. &&
- ninja
+ ninja llvm-tblgen &&
+ ninja &&
+ cd ..
+
+ python3 utils/lit/setup.py build
}
package () {
- DESTDIR=$PKG_DEST ninja install
+ DESTDIR=$PKG_DEST ninja -C build install
+
+ cd build
+ python3 ../utils/lit/setup.py install --prefix=/usr --root=$PKG_DEST
+
}