From e529207b6f20b1a281da2285699ef91fc7a5f95c Mon Sep 17 00:00:00 2001 From: EnumDev Date: Fri, 1 May 2026 15:56:24 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ check-version.sh | 4 ++++ pkg.info | 36 ++++++++++++++++++++++++++++++++++++ source.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..cd89e29 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Ignore this package +echo "ignore" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..74b536b --- /dev/null +++ b/pkg.info @@ -0,0 +1,36 @@ +name: lld21 +description: Linker from the LLVM project +version: 21.1.8 +revision: 1 +url: https://lld.llvm.org/ +license: Apache-2.0 WITH LLVM-exception +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - gcc-libs + - llvm21-libs + - zlib + - zstd +make_depends: + - cmake + - ninja + - llvm21 +downloads: + - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/lld-${BPM_PKG_VERSION}.src.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: d9524c5ee952500a2af92c27042a0d90ab089962af47816d4c85d0ebf76373d1 + - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/llvm-${BPM_PKG_VERSION}.src.tar.xz + extract_to: llvm + extract_strip_components: 1 + checksum: d9022ddadb40a15015f6b27e6549a7144704ded8828ba036ffe4b8165707de21 + - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/libunwind-${BPM_PKG_VERSION}.src.tar.xz + extract_to: libunwind + extract_strip_components: 1 + checksum: 03e8adc6c3bdde657dcaedc94886ea70d1f7d551d622fcd8a36a8300e5c36cbc + - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/cmake-${BPM_PKG_VERSION}.src.tar.xz + extract_to: cmake + extract_strip_components: 1 + checksum: 85735f20fd8c81ecb0a09abb0c267018475420e93b65050cc5b7634eab744de9 diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..88df148 --- /dev/null +++ b/source.sh @@ -0,0 +1,43 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + cd "$BPM_SOURCE" + # Fix https://github.com/llvmenv/llvmenv/issues/115 + ln -s ../../libunwind/include/mach-o MachO/mach-o +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm${BPM_PKG_VERSION%%.*} \ + -DCMAKE_SKIP_RPATH=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DLLVM_CMAKE_DIR=/usr/lib/llvm${BPM_PKG_VERSION%%.*}/lib/cmake \ + -DLLVM_CONFIG=/usr/lib/llvm${BPM_PKG_VERSION%%.*}/bin/llvm-config \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_ENABLE_SPHINX=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + -DLLVM_MAIN_SRC_DIR="${BPM_WORKDIR}"/llvm + cmake --build build +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + DESTDIR="$BPM_OUTPUT" cmake --install build + + # Symlink libraries + for lib in COFF Common ELF MachO MinGW Wasm; do + ln -s llvm${BPM_PKG_VERSION%%.*}/lib/liblld"$lib".so.${BPM_PKG_VERSION%.*} "$BPM_OUTPUT"/usr/lib/liblld"$lib".so.${BPM_PKG_VERSION%.*} + done + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/lld/LICENSE.TXT +}