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