General purpose dependency manager for embedded C libraries, written in C.
Usage: dep [global options] <command> [command options]
Global options:
n/a
Commands:
a(dd) Add a new dependency to the project
i(nstall) Install all the project's dependencies
init Initialize a new project with a .dep file
license Show license information
r(epo(sitory)) Repository management
help [topic] Show this help or the top-level info about a command
Help topics:
global This help text
add More detailed explanation on the add command
install More detailed explanation on the install command
init More detailed explanation on the init command
repository More detailed explanation on the repository command
Note: Windows is not supported. This project only targets posix-compliant operating systems.
To install dep, build it from source and place the binary in your $PATH:
make
sudo make installTo install the binary in a location other than /usr/local/bin, pass the
DESTDIR definition to the make install command (default: /usr/local).
By default, no default repositories are enabled. You'll need to add your own or use GitHub directly.
To start using dep in your project, run the init command to create a .dep file:
dep initThis creates an empty .dep file in the current directory. You can also specify
a target directory:
dep init /path/to/projectTo add a package, you can call the following command:
dep add owner/library
dep add owner/library versionIf a version is not specified, the latest version from the repository will be used, or the default branch from GitHub.
Examples:
dep add finwo/palloc # Latest from repo or GitHub main branch
dep add finwo/palloc edge # Specific version/branch
dep add finwo/palloc v1.0.0 # Specific tagYou can also add a dependency with a direct URL:
dep add mylib https://example.com/mylib.tar.gzTo install all dependencies listed in your .dep file:
dep installDependencies are installed to the lib/ directory by default.
dep can use custom repositories to discover packages. Repositories are
configured in ~/.config/finwo/dep/repositories.d/.
To add a repository:
dep repository add myorg https://example.com/path/to/manifestTo list configured repositories:
dep repository listTo remove a repository:
dep repository remove myorgTo clean the cache of downloaded repository manifests:
dep repository clean-cacheAnyone can create a repository to host their own package manifests. A repository is simply a static file server hosting a manifest file.
The manifest is a text file with one package per line. Lines starting with
# are comments. Each line has the following format:
name@version url
The version is optional. If omitted, the package is available without a specific version.
Example manifest:
# My organization's packages
finwo/palloc@edge https://github.com/finwo/palloc/archive/refs/heads/edge.tar.gz
finwo/palloc@v1.0.0 https://github.com/finwo/palloc/archive/refs/tags/v1.0.0.tar.gz
finwo/palloc https://github.com/finwo/palloc/archive/refs/heads/main.tar.gz
myorg/mylib https://example.com/mylib-v1.0.0.tar.gz
myorg/mylib@2.0.0 https://example.com/mylib-v2.0.0.tar.gz
Host the manifest file on any static file server (GitHub Pages, S3, nginx,
etc.) and add the URL using dep repository add.
Building this dependency manager requires:
- clang (or your preferred C compiler)
- make
Simply run:
makeThis project falls under the FGPL license