From bae66d1f6f60a1b801967fc41c7f075e5ce02157 Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Fri, 27 Sep 2024 23:03:41 +0200 Subject: [PATCH] cargo-c: moved from contrib --- cargo-c/.footprint | 6 ++++++ cargo-c/.signature | 6 ++++++ cargo-c/Pkgfile | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 cargo-c/.footprint create mode 100644 cargo-c/.signature create mode 100644 cargo-c/Pkgfile diff --git a/cargo-c/.footprint b/cargo-c/.footprint new file mode 100644 index 000000000..d9f7d3988 --- /dev/null +++ b/cargo-c/.footprint @@ -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 diff --git a/cargo-c/.signature b/cargo-c/.signature new file mode 100644 index 000000000..3bebb009b --- /dev/null +++ b/cargo-c/.signature @@ -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 diff --git a/cargo-c/Pkgfile b/cargo-c/Pkgfile new file mode 100644 index 000000000..7b369510d --- /dev/null +++ b/cargo-c/Pkgfile @@ -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 {} + +}