mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-19 04:26:43 +02:00
68 lines
2 KiB
Text
68 lines
2 KiB
Text
# Contributor: Milan P. Stanić <mps@arvanta.net>
|
|
# Maintainer: team/rust <alpine@ptrcnull.me>
|
|
maintainer="team/rust <alpine@ptrcnull.me>"
|
|
pkgname=rust-bindgen
|
|
pkgver=0.71.1
|
|
pkgrel=0
|
|
pkgdesc="automatically generates Rust FFI bindings to C (and some C++) libraries"
|
|
url="https://github.com/rust-lang/rust-bindgen"
|
|
makedepends="cargo clang cargo-auditable"
|
|
checkdepends="bash clang-dev"
|
|
arch="all"
|
|
license="BSD-3-Clause"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/rust-bindgen/archive/v$pkgver.tar.gz
|
|
disable-test_wrap_static_fns-patch
|
|
"
|
|
options="net" # cargo fetch
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
case "$CARCH" in
|
|
a*)
|
|
# possibly https://github.com/rust-lang/rust-bindgen/issues/2777
|
|
patch -Np1 < "$srcdir"/disable-test_wrap_static_fns-patch ;;
|
|
esac
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
}
|
|
|
|
build() {
|
|
cargo auditable build --release --frozen
|
|
|
|
for shell in bash fish zsh powershell zsh; do
|
|
./target/release/bindgen \
|
|
--generate-shell-completions "$shell" > "$pkgname"."$shell"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
cargo test --frozen
|
|
|
|
# silly, but in case upstream would break this again
|
|
./target/release/bindgen --version
|
|
}
|
|
|
|
package() {
|
|
install -Dm0755 target/release/bindgen "$pkgdir"/usr/bin/bindgen
|
|
|
|
install -Dm0644 book/src/*.md -t "$pkgdir"/usr/share/doc/"$pkgname"/
|
|
|
|
install -Dm0644 "$pkgname".bash \
|
|
"$pkgdir"/usr/share/bash-completion/completions/"$pkgname"
|
|
install -Dm0644 "$pkgname".fish \
|
|
"$pkgdir"/usr/share/fish/vendor_completions.d/"$pkgname".fish
|
|
install -Dm0644 "$pkgname".zsh \
|
|
"$pkgdir"/usr/share/zsh/site-functions/_"$pkgname"
|
|
}
|
|
|
|
sha512sums="
|
|
c900bd3780074c9f8df5dfb349cdfd59a8a71b5ac7fd63b18eb31c7fa3ab1fb5e656ff05bb7461ddc70c40a65ef73155007abea566c9d5deb41cda901a9fd57d rust-bindgen-0.71.1.tar.gz
|
|
1c5578b0935e84f75ebd04f2c4186d835d2e6363f16439ef4ea29c9448d803779ad40cc577b4b1c0f8757d08e7d0013f3a1267ca00410ca39e86e3ad199826a5 disable-test_wrap_static_fns-patch
|
|
"
|