diff --git a/check-version.sh b/check-version.sh index 42b837d..81c6740 100644 --- a/check-version.sh +++ b/check-version.sh @@ -4,6 +4,9 @@ REPO="mozilla/cbindgen" # 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"/releases/latest | jq -r '.tag_name') +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 '^v' | head -n1) -echo "$TAG_NAME" +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index cdf7ed2..161e0db 100644 --- a/pkg.info +++ b/pkg.info @@ -1,9 +1,20 @@ name: cbindgen description: A project for generating C bindings from Rust code -version: 0.29.0 +version: 0.29.2 +revision: 1 url: https://github.com/mozilla/cbindgen license: MPL2 architecture: any -depends: ["gcc-libs", "glibc"] -make_depends: ["cmake","rustc","python-cython"] type: source +depends: + - gcc-libs + - glibc +make_depends: + - cmake + - rustc + - python-cython +downloads: + - url: https://github.com/mozilla/cbindgen/archive/v${BPM_PKG_VERSION}/cbindgen-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: c7d4d610482390c70e471a5682de714967e187ed2f92f2237c317a484a8c7e3a diff --git a/source.sh b/source.sh index df2b5c7..2500998 100644 --- a/source.sh +++ b/source.sh @@ -2,15 +2,9 @@ # 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/mozilla/cbindgen/archive/v${BPM_PKG_VERSION}/cbindgen-${BPM_PKG_VERSION}.tar.gz" -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 +# This function is used for putting downloaded files to the correct location or applying patches prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" - cd "$BPM_SOURCE" # Fetch dependencies cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" @@ -33,5 +27,6 @@ check() { package() { install -Dm755 target/release/cbindgen "$BPM_OUTPUT"/usr/bin/cbindgen + # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/cbindgen/LICENSE }