# Install cargo-c with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

Helper program to build and install c-like libraries. Version 0.10.23 via Homebrew; verified 2026-06-22.

## Install

```sh
sudo av install brew:cargo-c
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install cargo-c
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install cargo-c
```

  Evidence: MacPorts ports tree: devel/cargo-c/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add cargo-c
```

  Evidence: Alpine Linux edge package indexes: cargo-c from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install cargo-c
```

  Evidence: Debian stable package indexes: cargo-c from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install cargo-c
```

  Evidence: Fedora Rawhide package metadata: cargo-c from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#cargo-c
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ca/cargo-c/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S cargo-c
```

  Evidence: Arch Linux sync databases: cargo-c from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install cargo-c
```

  Evidence: openSUSE Tumbleweed package metadata: cargo-c from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:cargo-c
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/cargo-c>
- **Version:** 0.10.23
- **Source summary:** Helper program to build and install c-like libraries
- **Homepage:** <https://github.com/lu-zero/cargo-c>
- **Repository:** <https://github.com/lu-zero/cargo-c>
- **Upstream docs:** <https://github.com/lu-zero/cargo-c#readme>
- **License:** MIT
- **Source archive:** <https://github.com/lu-zero/cargo-c/archive/refs/tags/v0.10.23.tar.gz>
- **Last updated:** 2026-06-22T14:02:57-07:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- cargo-capi (cli)
- cargo-cbuild (cli)
- cargo-cinstall (cli)
- cargo-ctest (cli)
- cargo-capi (alias)
- cargo-cbuild (alias)
- cargo-cinstall (alias)
- cargo-ctest (alias)

## Dependencies

- libgit2
- libssh2
- openssl@3

## Build dependencies

- pkgconf
- rust

## Uses from macOS

- curl

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.10.23
- Package-manager updated: 2026-06-22
- Local data: ok
- Upstream repository: https://github.com/lu-zero/cargo-c
- Upstream latest detected: v0.10.23 (current)
## Project history and usage

cargo-c is a Cargo applet for building, testing, installing, and packaging Rust crates as C ABI-compatible libraries with headers, pkg-config files, static libraries, and dynamic libraries.

### Project history

The lu-zero/cargo-c repository was created in May 2019 and cargo-c 0.1.0 was published to crates.io in June 2019 with cargo-cbuild and cargo-cinstall binaries. The project grew into a four-command suite: cargo-capi, cargo-cbuild, cargo-cinstall, and cargo-ctest.

The README describes cargo-c as a bridge between Cargo and traditional C library distribution. It uses Cargo.toml metadata under `package.metadata.capi` to configure headers, pkg-config files, generated or copied assets, library names, versioning, install paths, and target-specific behavior.

cargo-c integrates with cbindgen for header generation and pkg-config for consumer metadata. Its versioning scheme also tracks the embedded Cargo version in current releases, tying the tool's behavior to the Cargo implementation it vendors or embeds.

### Adoption history

cargo-c is one of the more significant Rust packaging tools because it lets Rust libraries participate in long-established C and Unix packaging workflows. The README lists users including ebur128, gcode-rs, gst-plugins-rs, lewton, libdovi, libimagequant, librsvg, rav1e, rustls-ffi, sled, pathfinder, and udbserver.

Distribution adoption is broad for a Cargo plugin: the input records Alpine, Homebrew, Debian, Fedora, MacPorts, Nix, Arch, Ubuntu, and openSUSE packaging. Crates.io reports more than 960,000 downloads and over 90 published versions, reflecting an actively maintained compatibility layer rather than a one-shot helper.

### How it is used

Users install cargo-c from crates.io with `cargo install cargo-c`. `cargo cbuild` builds a library and produces a C header and pkg-config file, `cargo ctest` builds and runs tests, and `cargo cinstall` installs the generated library, header, and metadata into a destination prefix.

A typical project adds a C API module, a `capi` feature, and optional `package.metadata.capi` settings in Cargo.toml. cargo-c then produces artifacts that C and C-compatible build systems can consume through headers, shared or static libraries, and pkg-config.

### Why package nerds care

cargo-c matters because it solves a packaging boundary that Rust itself deliberately does not hide: Rust crates are not automatically C libraries. By generating the Unix packaging pieces expected by downstream consumers, it lets Rust code enter ecosystems built around C headers, SONAMEs, pkg-config, and distro install prefixes.

For package maintainers, cargo-c is a practical adapter between language-package metadata and system-package policy. It is especially visible in multimedia and systems libraries where Rust implementations need to be consumed by C applications or by build systems such as Meson.

### Timeline

- 2019-05-23: GitHub repository lu-zero/cargo-c was created.
- 2019-06-26: cargo-c 0.1.0 was published on crates.io with cargo-cbuild and cargo-cinstall.
- 2019-2021: The command set expanded to include cargo-capi and cargo-ctest.
- 2020s: README documented real users including gst-plugins-rs, librsvg, rav1e, rustls-ffi, and libimagequant.
- 2026-06-01: Version 0.10.23+cargo-0.97.1 was published.

### Related projects

- cbindgen is used for C header generation.
- pkg-config is the metadata format cargo-c emits for C consumers.
- Projects listed by the README as users include gst-plugins-rs, librsvg, rav1e, rustls-ffi, libimagequant, lewton, and sled.

### Sources

- GitHub repository API metadata: https://api.github.com/repos/lu-zero/cargo-c
- Official README: https://github.com/lu-zero/cargo-c#readme
- Package-manager adoption from source_facts.package-manager.
- crates.io API metadata and versions: https://crates.io/api/v1/crates/cargo-c


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: Cargo.toml
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** cargo-c
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- Debian apt - cargo-c - 0.10.11-1+b2: normalized package name match | Debian stable package indexes: cargo-c from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Helper program to build and install c-like libraries | https://github.com/lu-zero/cargo-c
- Nix - cargo-c: normalized package name match | nixpkgs package indexes: pkgs/by-name/ca/cargo-c/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - cargo-c - 0.9.19-2build3: normalized package name match | Ubuntu 24.04 LTS package indexes: cargo-c from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Helper program to build and install c-like libraries
- apk - cargo-c - 0.10.23-r0: normalized package name match | Alpine Linux edge package indexes: cargo-c from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | cargo subcommand to build and install C-ABI compatibile dynamic and static libraries | https://github.com/lu-zero/cargo-c
- apk - cargo-c-doc - 0.10.23-r0: normalized package name match | Alpine Linux edge package indexes: cargo-c-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | cargo subcommand to build and install C-ABI compatibile dynamic and static libraries (documentation) | https://github.com/lu-zero/cargo-c
- dnf - cargo-c - 0.10.21-1.fc45: normalized package name match | Fedora Rawhide package metadata: cargo-c from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Helper program to build and install c-like libraries | https://crates.io/crates/cargo-c
- pacman - cargo-c - 0.10.23-1: normalized package name match | Arch Linux sync databases: cargo-c from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A cargo subcommand to build and install C-ABI compatible dynamic and static libraries | https://github.com/lu-zero/cargo-c/
- zypper - cargo-c - 0.10.15-2.2: normalized package name match | openSUSE Tumbleweed package metadata: cargo-c from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Helper to build and install c-like libraries from Rust | https://crates.io/crates/cargo-c
- MacPorts - cargo-c: normalized package name match | MacPorts ports tree: devel/cargo-c/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Package publisher tools](https://www.automicvault.com/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [libgit2](https://www.automicvault.com/pkg/brew/libgit2/) - Runtime dependency declared by Homebrew.
- [openssl@3](https://www.automicvault.com/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [cargo-auditable](https://www.automicvault.com/pkg/brew/cargo-auditable/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-binstall](https://www.automicvault.com/pkg/brew/cargo-binstall/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-binutils](https://www.automicvault.com/pkg/brew/cargo-binutils/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-bloat](https://www.automicvault.com/pkg/brew/cargo-bloat/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-bundle](https://www.automicvault.com/pkg/brew/cargo-bundle/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-cache](https://www.automicvault.com/pkg/brew/cargo-cache/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-careful](https://www.automicvault.com/pkg/brew/cargo-careful/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-chef](https://www.automicvault.com/pkg/brew/cargo-chef/) - Shares av.db curated category or tags: cargo, cli, developer-tools, rust.
- [cargo-outdated](https://www.automicvault.com/pkg/brew/cargo-outdated/) - Both packages touch the same language runtime or ecosystem. Shared terms: cargo, cli, developer, developer-tools, libgit2.
- [cargo-clone](https://www.automicvault.com/pkg/brew/cargo-clone/) - Both packages touch the same language runtime or ecosystem. Shared terms: cargo, cli, developer, developer-tools, openssl.
- [cargo-crev](https://www.automicvault.com/pkg/brew/cargo-crev/) - Both packages touch the same language runtime or ecosystem. Shared terms: cargo, cli, developer, developer-tools, openssl.

## Combined YAML source

View the package source record on GitHub. [combined/cargo-c.yml](https://github.com/automic-vault/db/blob/main/combined/cargo-c.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
