diff --git a/check-version.sh b/check-version.sh index f2ac8e8..403b1cc 100644 --- a/check-version.sh +++ b/check-version.sh @@ -3,8 +3,11 @@ # Github repository REPO="llvm/llvm-project" +# Get LLVM major version number +LLVM_VERSION=$(bpm q -d llvm | grep "^Version: " | awk '{print $2}' | cut -d'.' -f1) + # Get tag name using Github Rest API -TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[].name' | grep 'llvmorg-20.*' | head -n1) +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/tags | jq -r '.[].name' | grep "llvmorg-${LLVM_VERSION}.*" | head -n1) # Get version number from tag name VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev) diff --git a/pkg.info b/pkg.info index e9c1907..254f54a 100644 --- a/pkg.info +++ b/pkg.info @@ -1,8 +1,20 @@ name: libclc description: Open Source implementation of the library requirements of the OpenCL C programming language -version: 20.1.8 +version: 21.1.4 +revision: 1 url: https://libclc.llvm.org/ license: NCSA OR MIT architecture: any -make_depends: ["clang","llvm","cmake","ninja","python3","spirv-llvm-translator"] type: source +make_depends: + - clang + - llvm + - cmake + - ninja + - python3 + - spirv-llvm-translator +downloads: + - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/libclc-${BPM_PKG_VERSION}.src.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 2311128b86ae95b4319341671a8ec93950928d0bc4fa13d0e6a97d7a65507aaa diff --git a/source.sh b/source.sh index 48d38a4..cca6da7 100644 --- a/source.sh +++ b/source.sh @@ -2,32 +2,18 @@ # 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 -DOWNLOAD="https://github.com/llvm/llvm-project/releases/download/llvmorg-${BPM_PKG_VERSION}/libclc-${BPM_PKG_VERSION}.src.tar.xz" -FILENAME="${DOWNLOAD##*/}" - -# 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() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" -} - # The build function is executed in the source directory # This function is used to compile the source code build() { - mkdir build - cd build - - cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -G Ninja .. - ninja + cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -G Ninja + 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() { - cd build - - DESTDIR="$BPM_OUTPUT" ninja install + DESTDIR="$BPM_OUTPUT" cmake --install build - install -Dm644 ../LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/libclc/LICENSE.TXT + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/libclc/LICENSE.TXT }