The cargo-c package creates a cargo subcommand to build and install C-ABI compatible dynamic and static libraries.
This package is known to build and work properly using an LFS 12.4 platform.
Download (HTTP): https://github.com/lu-zero/cargo-c/archive/v0.10.18/cargo-c-0.10.18.tar.gz
Download SHA256 Sum: 0f2b699be7ad5cac05624701065ae521c7f6b8159bdbcb8103445fc2440d1a7e
Download MD5 sum: 0e66114002a5a0013ef8e5f1579d41f7
Download size: 142.7 KB
Estimated disk space required: 1,076,958.3 KB
Estimated build time: 7.06 SBU
First, download a file to ensure that cargo uses the dependency versions specified by the upstream developers when this cargo-c version (0.10.18) was released. Without this, the latest versions of the dependencies would be used and they might cause breakages:
curl -fLO https://github.com/lu-zero/cargo-c/releases/download/v0.10.18/Cargo.lock
![[Note]](../images/note.png)
Normally we would put such a download into an
“Additional Downloads” section. But in this case we
cannot tell the package name and version from the file name
Cargo.lock, so it's better not to put the
ambiguously-named file outside the
cargo-c-0.10.18
directory. We use curl here because the
cURL-8.17.0 package should have been installed
as a required dependency of rustc-1.91.0.
The sha256sum of the file should be
14e438039df865fbd1d4c68bc4ed61a2ee015c12f41bb47b942d4ee316d49d31.
The md5sum of the file should be
e9c554e1949e40627c1856ed3334d894.
Install cargo-c by running the following commands:
export LIBSSH2_SYS_USE_PKG_CONFIG=1 export LIBSQLITE3_SYS_USE_PKG_CONFIG=1 cargo build --release
To test the results, issue:
cargo test --release
Now Install, as the root user:
install -vm755 target/release/cargo-{capi,cbuild,cinstall,ctest} /usr/bin/Finally, unset the exported environment variables:
unset LIB{SSH2,SQLITE3}_SYS_USE_PKG_CONFIGexport LIBSSH2_SYS_USE_PKG_CONFIG=1: Allow cargo to link to system libssh2. Omit this command if you've not installed libssh2-1.11.1.
export LIBSQLITE3_SYS_USE_PKG_CONFIG=1: Allow cargo to link to system sqlite.