README.md (3991B)
1 dep 2 === 3 4 General purpose dependency manager for embedded C libraries, written in C. 5 6 Summary 7 ------- 8 9 ``` 10 Usage: dep [global options] <command> [command options] 11 12 Global options: 13 n/a 14 15 Commands: 16 a(dd) Add a new dependency to the project 17 i(nstall) Install all the project's dependencies 18 init Initialize a new project with a .dep file 19 license Show license information 20 r(epo(sitory)) Repository management 21 help [topic] Show this help or the top-level info about a command 22 23 Help topics: 24 global This help text 25 add More detailed explanation on the add command 26 install More detailed explanation on the install command 27 init More detailed explanation on the init command 28 repository More detailed explanation on the repository command 29 ``` 30 31 Installation 32 ------------ 33 34 **Note: Windows is not supported.** This project only targets posix-compliant operating systems. 35 36 To install dep, build it from source and place the binary in your `$PATH`: 37 38 ```sh 39 make 40 sudo make install 41 ``` 42 43 To install the binary in a location other than `/usr/local/bin`, pass the 44 `DESTDIR` definition to the `make install` command (default: `/usr/local`). 45 46 By default, no default repositories are enabled. You'll need to add your own 47 or use GitHub directly. 48 49 Usage 50 ----- 51 52 ### Initializing a project 53 54 To start using dep in your project, run the init command to create a `.dep` file: 55 56 ```sh 57 dep init 58 ``` 59 60 This creates an empty `.dep` file in the current directory. You can also specify 61 a target directory: 62 63 ```sh 64 dep init /path/to/project 65 ``` 66 67 ### Adding a dependency 68 69 To add a package, you can call the following command: 70 71 ```sh 72 dep add owner/library 73 dep add owner/library version 74 ``` 75 76 If a version is not specified, the latest version from the repository will be 77 used, or the default branch from GitHub. 78 79 Examples: 80 81 ```sh 82 dep add finwo/palloc # Latest from repo or GitHub main branch 83 dep add finwo/palloc edge # Specific version/branch 84 dep add finwo/palloc v1.0.0 # Specific tag 85 ``` 86 87 You can also add a dependency with a direct URL: 88 89 ```sh 90 dep add mylib https://example.com/mylib.tar.gz 91 ``` 92 93 ### Installing dependencies 94 95 To install all dependencies listed in your `.dep` file: 96 97 ```sh 98 dep install 99 ``` 100 101 Dependencies are installed to the `lib/` directory by default. 102 103 ### Repository management 104 105 dep can use custom repositories to discover packages. Repositories are 106 configured in `~/.config/finwo/dep/repositories.d/`. 107 108 To add a repository: 109 110 ```sh 111 dep repository add myorg https://example.com/path/to/manifest 112 ``` 113 114 To list configured repositories: 115 116 ```sh 117 dep repository list 118 ``` 119 120 To remove a repository: 121 122 ```sh 123 dep repository remove myorg 124 ``` 125 126 To clean the cache of downloaded repository manifests: 127 128 ```sh 129 dep repository clean-cache 130 ``` 131 132 Creating Repositories 133 -------------------- 134 135 Anyone can create a repository to host their own package manifests. A 136 repository is simply a static file server hosting a manifest file. 137 138 The manifest is a text file with one package per line. Lines starting with 139 `#` are comments. Each line has the following format: 140 141 ``` 142 name@version url 143 ``` 144 145 The version is optional. If omitted, the package is available without a 146 specific version. 147 148 Example manifest: 149 150 ``` 151 # My organization's packages 152 finwo/palloc@edge https://github.com/finwo/palloc/archive/refs/heads/edge.tar.gz 153 finwo/palloc@v1.0.0 https://github.com/finwo/palloc/archive/refs/tags/v1.0.0.tar.gz 154 finwo/palloc https://github.com/finwo/palloc/archive/refs/heads/main.tar.gz 155 myorg/mylib https://example.com/mylib-v1.0.0.tar.gz 156 myorg/mylib@2.0.0 https://example.com/mylib-v2.0.0.tar.gz 157 ``` 158 159 Host the manifest file on any static file server (GitHub Pages, S3, nginx, 160 etc.) and add the URL using `dep repository add`. 161 162 Building 163 -------- 164 165 Building this dependency manager requires: 166 - clang (or your preferred C compiler) 167 - make 168 169 Simply run: 170 171 ```sh 172 make 173 ``` 174 175 License 176 ------- 177 178 This project falls under the [FGPL license](LICENSE.md)