2018-12-26 11:16:30 +01:00
|
|
|
# Description: Generate C bindings from rust code
|
|
|
|
# URL: https://github.com/eqrion/cbindgen
|
2023-07-11 14:25:32 +02:00
|
|
|
# Maintainer: John McQuah, jmcquah at disroot dot org
|
2018-12-26 11:16:30 +01:00
|
|
|
# Depends on: rust
|
|
|
|
# Optional: sccache
|
|
|
|
|
|
|
|
name=cbindgen
|
2023-08-10 18:16:31 +02:00
|
|
|
version=0.24.6
|
2020-04-11 15:27:55 +02:00
|
|
|
release=1
|
2023-07-11 14:25:32 +02:00
|
|
|
source=(https://github.com/mozilla/$name/archive/v$version/$name-v$version.tar.gz)
|
2018-12-26 11:16:30 +01:00
|
|
|
|
|
|
|
build() {
|
|
|
|
cd $name-$version
|
|
|
|
|
2019-05-08 14:50:24 +02:00
|
|
|
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
|
2023-07-11 14:25:32 +02:00
|
|
|
mkdir -p "$PKGMK_SOURCE_DIR/rust"
|
2019-05-18 18:38:37 +02:00
|
|
|
export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
|
2018-12-26 11:16:30 +01:00
|
|
|
|
2023-07-11 14:25:32 +02:00
|
|
|
cargo fetch --target x86_64-unknown-linux-gnu
|
|
|
|
cargo build --release --frozen --bins
|
2020-04-06 14:58:29 +02:00
|
|
|
install -Dt $PKG/usr/bin target/release/cbindgen
|
2018-12-26 11:16:30 +01:00
|
|
|
}
|