diff --git a/pkg.info b/pkg.info index 615e12f..1fa24df 100644 --- a/pkg.info +++ b/pkg.info @@ -1,6 +1,7 @@ name: llvm description: A collection of modular and reusable compiler and toolchain technologies version: 20.1.8 +revision: 2 url: https://llvm.org license: Apache2-with-llvm-exception architecture: any @@ -8,7 +9,9 @@ make_depends: ["cmake","libffi","ncurses","ninja","python3","zlib","zstd"] type: source split_packages: - name: llvm - depends: ["libedit","perl"] + depends: ["llvm-libs","perl"] + - name: llvm-libs + depends: ["gcc-libs","libedit","libffi","libxml2","zlib","zstd"] - name: clang description: C language family frontend for LLVM url: https://clang.llvm.org/ diff --git a/source.sh b/source.sh index f2b78d5..562a29d 100644 --- a/source.sh +++ b/source.sh @@ -55,8 +55,8 @@ package_llvm() { DESTDIR="$BPM_OUTPUT" ninja install cp bin/FileCheck "$BPM_OUTPUT"/usr/bin - # Move clang files to another temporary directory - CLANG="$BPM_WORKDIR"/clang-output + # Move clang files to clang package + CLANG="$BPM_SOURCE"/output-clang mkdir -p "$CLANG"/{usr/bin,usr/lib,usr/lib/cmake/,usr/include,usr/share,usr/share/man/man1} mv "$BPM_OUTPUT"/usr/bin/{amdgpu-arch,analyze-build,c-index-test,diagtool,git-clang-format,hmaptool,intercept-build,nvptx-arch,scan-build,scan-build-py,scan-view} "$CLANG"/usr/bin mv "$BPM_OUTPUT"/usr/bin/clang* -t "$CLANG"/usr/bin @@ -70,15 +70,30 @@ package_llvm() { mv "$BPM_OUTPUT"/usr/share/scan-build -t "$CLANG"/usr/share mv "$BPM_OUTPUT"/usr/share/scan-view -t "$CLANG"/usr/share + # Move runtime libraries to llvm-libs package + LLVM_LIBS="$BPM_SOURCE"/output-llvm-libs + mkdir -p "$LLVM_LIBS"/usr/lib/ + for lib in libLLVM libLLVM-"${BPM_PKG_VERSION%%.*}" libLTO libRemarks; do + mv "$BPM_OUTPUT"/usr/lib/"$lib".so* -t "$LLVM_LIBS"/usr/lib/ + done + # Install package license - install -Dm644 ../LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/llvm/LICENSE.TXT + install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/llvm/LICENSE.TXT +} + +package_llvm-libs() { + # Replace 'output' directory with 'output-llvm-libs' + rmdir "$BPM_OUTPUT" + mv "$BPM_SOURCE"/output-llvm-libs "$BPM_OUTPUT" + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/llvm-libs/LICENSE.TXT } package_clang() { - # Move clang files to 'output' diorectory - CLANG="$BPM_WORKDIR"/clang-output + # Replace 'output' directory with 'output-clang' rmdir "$BPM_OUTPUT" - mv "$CLANG" "$BPM_OUTPUT" + mv "$BPM_SOURCE"/output-clang "$BPM_OUTPUT" # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/clang/LICENSE.TXT