compat-32/llvm-32/Pkgfile
2018-04-13 08:50:44 +10:00

62 lines
2.0 KiB
Plaintext

# Description: LLVM
# URL: http://llvm.org
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
# Depends on: libffi-32 python-32 llvm
name=llvm-32
version=6.0.0
release=2
source=(https://llvm.org/releases/$version/llvm-$version.src.tar.xz
PR35947-export-LLVMInitializeInstCombine-as-extern-C.patch
PR36417-DebugInfo-discard-invalid-DBG_VALUE-instructions.patch
PR36417-fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
D44420-cmake-fix-a-typo-in-llvm_config-macro.patch)
build() {
cd llvm-$version.src
# https://bugs.llvm.org/show_bug.cgi?id=35947
patch -p1 -i $SRC/PR35947-export-LLVMInitializeInstCombine-as-extern-C.patch
# https://bugs.llvm.org/show_bug.cgi?id=36417
patch -p1 -i $SRC/PR36417-DebugInfo-discard-invalid-DBG_VALUE-instructions.patch
patch -p1 -i $SRC/PR36417-fixup-for-rL326769-RegState-Debug-is-being-truncated.patch
# https://reviews.llvm.org/D44391
patch -p1 -i $SRC/D44391-export-LLVM_DYLIB_COMPONENTS-in-LLVMConfig.cmake.patch
# https://reviews.llvm.org/D44420
patch -p0 -i $SRC/D44420-cmake-fix-a-typo-in-llvm_config-macro.patch
install -d build $SRC/keep
cd build
cmake \
-DLLVM_ENABLE_CXX1Y=1 \
-DLLVM_INCLUDE_EXAMPLES=0 \
-DLLVM_ENABLE_OCAMLDOC=0 \
-DLLVM_INCLUDE_TESTS=0 \
-DLLVM_ENABLE_FFI=1 \
-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
-DLLVM_BUILD_LLVM_DYLIB=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_LIBDIR_SUFFIX=32 \
-DLLVM_TARGET=i686-pc-linux-gnu \
-Wno-dev ..
MAKEFLAGS="$MAKEFLAGS" make
make DESTDIR=$PKG install
# keep 32bit header and config
install -t $SRC/keep $PKG/usr/bin/llvm-config $PKG/usr/include/llvm/Config/llvm-config.h
# remove unneeded files
rm -r $PKG/usr/{bin,include,share/opt-viewer}
# install 32bit header and config
install -m 0755 -D $SRC/keep/llvm-config $PKG/usr/bin/llvm-config-32
install -m 0644 -D $SRC/keep/llvm-config.h $PKG/usr/include/llvm/Config/llvm-config-32.h
}