Files
haikuports/dev-rust/cargo_c/cargo_c-0.10.3.recipe
2024-09-04 13:20:34 +02:00

73 lines
1.9 KiB
Bash

SUMMARY="Cargo applet to build and install C-ABI compatibile dynamic and static libraries"
DESCRIPTION="It produces and installs a correct pkg-config file, a static \
library and a dynamic library, and a C header to be used by any C (and \
C-compatible) software."
HOMEPAGE="https://github.com/lu-zero/cargo-c"
COPYRIGHT="2024 Luca Barbato"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/lu-zero/cargo-c/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="922171afb3ceaf6553ff3916ae4663d3743ba22f80725f2300a26b76eb6eb94f"
SOURCE_URI_2="https://github.com/lu-zero/cargo-c/releases/download/v$portVersion/Cargo.lock#noarchive"
CHECKSUM_SHA256_2="6c099fe28666e4c6b5da41b65d00de35c9c60ab336c625d845f28055a0e90a7d"
SOURCE_DIR="cargo-c-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
cargo_c$secondaryArchSuffix
cmd:cargo_capi = $portVersion
cmd:cargo_cbuild = $portVersion
cmd:cargo_cinstall = $portVersion
cmd:cargo_ctest = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libgit2$secondaryArchSuffix
lib:libssh2$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libgit2$secondaryArchSuffix
devel:libssh2$secondaryArchSuffix
devel:libssl$secondaryArchSuffix >= 3
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cp $sourceDir2/Cargo.lock Cargo.lock
cargo fetch --locked
}
INSTALL()
{
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
export LIBSSH2_SYS_USE_PKG_CONFIG=1
export LIBGIT2_SYS_USE_PKG_CONFIG=1
export PKG_CONFIG_ALLOW_CROSS=1
cargo install --locked --root $prefix --path .
rm -f $prefix/{.crates.toml,.crates2.json}
}
TEST()
{
cargo test --release
}