cargo-c: moved from contrib

This commit is contained in:
Tim Biermann 2024-09-27 23:03:41 +02:00
parent 1aee5be483
commit bae66d1f6f
Signed by: tb
GPG Key ID: 42F8B4E30B673606
3 changed files with 36 additions and 0 deletions

6
cargo-c/.footprint Normal file
View File

@ -0,0 +1,6 @@
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/cargo-capi
-rwxr-xr-x root/root usr/bin/cargo-cbuild
-rwxr-xr-x root/root usr/bin/cargo-cinstall
-rwxr-xr-x root/root usr/bin/cargo-ctest

6
cargo-c/.signature Normal file
View File

@ -0,0 +1,6 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/YxzVrKaHw1olX3D54yPxv+GlrHQhc2bhwFK6yY9mriWBPU5FxY1swy4EsSvelqJKKXx1FzZeND1X2NHhI/UbwY=
SHA256 (Pkgfile) = 7c39b6896e2dfebaca4e606eade3bfe058b535d54a933177a2c747ee950ce68d
SHA256 (.footprint) = 120f05ca57fb0dbc82b26d55fe14f3719e1bf43681a430bb813e7310a9a6a1e0
SHA256 (cargo-c-0.10.4.tar.gz) = 3382f6c3eca404695885e79babfce6448124a481a77cec11c3bfeb5830f677c1
SHA256 (cargo-c-0.10.4-cargo.lock) = 9faed81831966f6569ecb8778443199de4126523c063c2b1257b39fe3d48691f

24
cargo-c/Pkgfile Normal file
View File

@ -0,0 +1,24 @@
# Description: A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries
# URL: https://github.com/lu-zero/cargo-c/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: libgit2 rust
name=cargo-c
version=0.10.4
release=1
source=(https://github.com/lu-zero/cargo-c/archive/v$version/$name-$version.tar.gz
https://github.com/lu-zero/cargo-c/releases/download/v$version/Cargo.lock)
renames=(SKIP $name-$version-cargo.lock)
build() {
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
[[ ! -e $PKGMK_SOURCE_DIR/rust ]] && mkdir $PKGMK_SOURCE_DIR/rust
cp $SRC/$name-$version-cargo.lock $name-$version/Cargo.lock
export CFLAGS+=' -ffat-lto-objects'
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" --manifest-path $name-$version/Cargo.toml
cargo build --release --frozen --manifest-path $name-$version/Cargo.toml
find $SRC/$name-$version/target/release -maxdepth 1 -type f -executable -exec install -D -m755 -t $PKG/usr/bin {} +
}