LinuxCommandLibrary

bpkg

Manage and build software packages

TLDR

Update the local index

$ bpkg update
copy

Install a package globally
$ bpkg install --global [package]
copy

Install a package in a subdirectory of the current directory
$ bpkg install [package]
copy

Install a specific version of a package globally
$ bpkg install [package]@[version] -g
copy

Show details about a specific package
$ bpkg show [package]
copy

Run a command, optionally specifying its arguments
$ bpkg run [command] [argument1 argument2 ...]
copy

SYNOPSIS

bpkg [options] command [arguments]
Common commands:
bpkg install repository
bpkg remove repository
bpkg update [repository]
bpkg search keyword
bpkg list
bpkg help

PARAMETERS

-h, --help
    Display help information for bpkg or a specific command.

-v, --verbose
    Enable verbose output, showing more details about operations.

-g, --global
    Perform operations globally, affecting system-wide bpkg directories.

-f, --force
    Force an operation, often overwriting existing files or bypassing warnings.

-d, --debug
    Enable debug mode, providing extensive diagnostic output.

-c, --config
    Specify an alternative configuration file path.

-p, --proxy
    Use a specified proxy for network operations.

-q, --quiet
    Suppress most output, showing only critical messages.

install
    Install a package from a specified Git repository URL or short name.

remove
    Remove an installed package.

update []
    Update all or a specific installed package.

search
    Search for packages matching a keyword in known registries (if configured).

list
    List all currently installed packages.

info
    Display detailed information about an installed or available package.

create
    Create a new bpkg package template.

link
    Link a local directory as a bpkg package.

clean
    Clean bpkg's cache directory.

config
    Display current bpkg configuration settings.

DESCRIPTION

bpkg is a minimalistic and cross-platform package manager primarily designed for C and C++ projects, emphasizing simplicity and speed. Unlike system-level package managers like apt or dnf, bpkg operates at the project level, allowing developers to manage dependencies for their C/C++ source code, particularly header-only libraries. It functions by cloning Git repositories directly from URLs, making it highly flexible and decentralized, as it does not rely on a central package repository.

Its design philosophy is to provide a "no-frills" solution for integrating third-party code. bpkg is particularly useful in environments where a lightweight solution is preferred, such as embedded systems development or scenarios where external dependencies need to be managed without complex build systems. It requires git and curl to be present on the system to fetch and manage packages. Being a single-file, header-only C/C++ library itself, bpkg is also easy to integrate and build from source.

CAVEATS

bpkg is not a system-wide package manager; it does not manage system libraries or binaries. Its scope is primarily C/C++ source code dependencies. It relies on git and curl being pre-installed on the system to function correctly.

Without a central, curated repository, package discovery can be less straightforward than with other C++ package managers like Conan or vcpkg, relying on direct Git repository URLs or self-maintained lists. As a minimal tool, it might lack advanced features (e.g., complex dependency resolution for transitive dependencies, binary package management) found in more comprehensive solutions.

DECENTRALIZED NATURE

Unlike many package managers that rely on a central repository, bpkg fetches packages directly from Git repository URLs. This decentralized approach means that any Git repository can be a bpkg package, promoting flexibility but requiring users to know the exact repository URLs.

HEADER-ONLY PHILOSOPHY

While capable of managing any source code, bpkg is particularly well-suited for header-only C/C++ libraries. Its design aligns with the concept of simply dropping source files into a project, making it ideal for self-contained components.

HISTORY

bpkg was created by 'r-lyeh' as a lightweight, cross-platform package manager designed with simplicity and speed in mind. Its development focused on providing a minimal tool for C/C++ developers to easily integrate header-only libraries or source code from Git repositories, without the overhead of more complex build systems or dependency managers. It emerged as a solution for projects requiring a straightforward approach to dependency management, particularly for embedded or small-scale applications where full-featured package managers might be too heavy or unnecessary.

SEE ALSO

git(1), curl(1), make(1), cmake(1), conan(1), vcpkg(1)

Copied to clipboard