#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 13. Programming

- Prev

  Programming

- Next

  Cbindgen-0.28.0

- Up
- Home

# cargo-c-0.10.11

## Introduction to cargo-c

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.3 platform.

### Package Information

- Download (HTTP): https://github.com/lu-zero/cargo-c/archive/v0.10.11/cargo-c-0.10.11.tar.gz

- Download MD5 sum: 727bcba75cf4e65313bb3a1b084bb57e

- Download size: 36 KB

- Estimated disk space required: 827 MB

- Estimated build time: 0.7 SBU

### cargo-c Dependencies

#### Required

rustc-1.85.0

#### Recommended

libssh2-1.11.1 and SQLite-3.49.1

### Note

An Internet connection is needed for building this package. The system certificate store may need to be set up with make-ca-1.15 before building this package.

## Installation of cargo-c

First, download a file to ensure that cargo uses the dependency versions specified by the upstream developers when this cargo-c version (0.10.11) was released. Without this, the latest versions of the dependencies would be used and they might cause breakages:

    curl -LO https://github.com/lu-zero/cargo-c/releases/download/v0.10.11/Cargo.lock

### Note

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.11` directory. We use curl here because the cURL-8.12.1 package should have been installed as a required dependency of rustc-1.85.0.

The md5sum of the file should be `d39f6c60470dc6aff66fac7a86b6b261`.

Install cargo-c by running the following commands:

    [ ! -e /usr/include/libssh2.h ] || export LIBSSH2_SYS_USE_PKG_CONFIG=1    &&
    [ ! -e /usr/include/sqlite3.h ] || export LIBSQLITE3_SYS_USE_PKG_CONFIG=1 &&

    cargo build --release

To test the results, issue: cargo test --release.

Now, as the `root` user:

    install -vm755 target/release/cargo-{capi,cbuild,cinstall,ctest} /usr/bin/

## Contents

Installed Programs: cargo-capi, cargo-cbuild, cargo-cinstall, and cargo-ctest
Installed Libraries: None
Installed Directories: None

- Prev

  Programming

- Next

  Cbindgen-0.28.0

- Up
- Home