Skip to content

GGLinnk/ccpm

Repository files navigation

ccpm

A cargo-style package and project manager for C and C++, written in pure Rust.

status CI Rust License: MIT

ccpm brings the cargo workflow to C and C++. You describe a project in one manifest, lock its dependencies, and build it with a single command. devkitPro and the Nintendo Switch are the first supported target.

Warning

ccpm is a work in progress. It is under active development and not yet stable, so expect rough edges and breaking changes.

Features

  • One ccpm.toml manifest per project, with a generated ccpm.lock lockfile.
  • Workspaces and dev / release build profiles.
  • A real version solver built on pubgrub, with semver and pacman version models side by side.
  • Dependencies from the ccpkg registry, from git, or from a local path.
  • A subprocess plugin system that adds toolchains and targets without rebuilding ccpm.
  • First-class devkitPro support: install the toolchain, build, and package a Switch .nro.
  • The ccpkg registry: a sparse HTTP index, a publish API, and a devkitPro mirror.
  • Runs on Linux, macOS, and Windows.
  • Pure Rust, with no C library bindings.

Install

ccpm builds from source with a recent stable Rust toolchain:

git clone https://github.com/GGLinnk/ccpm.git
cd ccpm
cargo install --path crates/ccpm-cli

This installs the ccpm binary onto your PATH.

Quickstart

Create a project, install a toolchain, and build it:

ccpm new hello-switch
cd hello-switch
ccpm toolchain install switch
ccpm build

Build in release mode and deploy to a Switch on your network:

ccpm run --release --host 192.168.1.42

Commands

Command What it does
ccpm new <name> Create a new project in a new directory.
ccpm init [path] Add a manifest to an existing directory.
ccpm build Build the current project.
ccpm run Build and deploy to a Switch.
ccpm add <pkg> Add a dependency to the manifest.
ccpm remove <pkg> Remove a dependency.
ccpm search <query> Search the package index.
ccpm update Re-resolve dependencies and rewrite the lockfile.
ccpm publish Publish the current package to a registry.
ccpm login <token> Store a registry API token.
ccpm clean Remove the build output.
ccpm tree Print the resolved dependency tree.
ccpm toolchain Install or check a devkitPro toolchain.
ccpm plugin List, add, link, or remove plugins.

The ccpkg registry

ccpkg is the package registry for ccpm. It is to ccpm what crates.io is to cargo: a sparse HTTP index of every package and every version, served with a publish API and resolved by a backtracking solver. The public instance lives at pkg.ccpm-rs.com.

Publish a package:

ccpm login <your-api-token>
ccpm publish

Run your own registry and web frontend with Docker:

docker compose up -d

The server exposes the index on port 8080, and the web frontend serves on port 3000.

devkitPro mirror

ccpkg mirrors the devkitPro package repository so every version stays available, even after upstream prunes it.

  • The mirror refreshes automatically once a week.
  • An optional mode allows a manual refresh at most once an hour.

Enable the manual refresh endpoint when starting the server:

ccpkg serve --allow-manual-refresh

Every server option also reads from an environment variable, so the same settings work in a shell or in a container.

Targets and plugins

ccpm keeps the package manager generic and moves toolchain knowledge into plugins. A plugin is a small executable that ccpm drives over a stable protocol, so a new target ships without changing the core. devkitPro and the Nintendo Switch are the first target, with 3DS, Wii, and GBA on the roadmap.

Manage plugins from the CLI:

ccpm plugin list
ccpm plugin add ./path/to/plugin

License

ccpm is released under the MIT License.


Note

Large language models were involved in building this project.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors