Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/depermitto/headerpuller

Header-only package manager for C/C++ written in Go. Provides hassle-free (un)installation and simplicity in use.
https://github.com/depermitto/headerpuller

c cpp cxx go golang-application header-files header-only hpp package-manager

Last synced: about 2 months ago
JSON representation

Header-only package manager for C/C++ written in Go. Provides hassle-free (un)installation and simplicity in use.

Awesome Lists containing this project

README

        

#+title: Cross-platform header-only package manager for C/C++ (and more!)
#+Author: Depermitto

* Install
Provided you have [[https://go.dev/][go]] installed, use this oneliner in the command-line (should work cross-platform, if not simply clone the repo and run ~go build~):
#+begin_src bash
git clone https://github.com/Depermitto/HeaderPuller && go build -C ./HeaderPuller -o "$(go env GOPATH)/bin/hp" && rm -rf ./HeaderPuller/
#+end_src

* Capabilities
Upon pulling a file, a *package log file* called *hp.yaml* shall be created. This is the core of the package managing functionality. Every *remove* or *pull* operation will modify the content of this file, to keep everything in check. Deleting /include/ folders without using *hp* commands and calling *sync* is _undefined behaviour_.

For any doubts, please refer to the ~help~ command of *hp*.

** Pulling packages
Pull single/multi header libraries from git repositories. There are 3 variations of this command:
- pull ~repo-link~ - providing the repo link will copy every valid file from ~repo-link/include~ to ~include~
- pull ~repo-link~ ~file~ - will copy that exact file if valid from ~repo-link~ to ~include~
- pull ~repo-link~ ~from~ - will copy every valid file from ~repo-link/from~ to ~from~, which is by default ~include~

*** Example
Pull a fantastic random number generating single-header library written in C++ (the _https://_ part may be omitted):
| hp pull [[https://github.com/Depermitto/randshow]] |

#+begin_src bash
workspace
+-- include
| +-- randshow.hpp
+-- hp.yaml
...
#+end_src

** Listing pulled packages
List all installed packages along with their identifiers in *id*: *package name* format. _Ids_ correspond to order the packages have been added by and _names_ are git repository names stripped of the author.

*** Example
| hp list |

#+begin_src bash
0: randshow
#+end_src

** Removing packages
Removes files and folders of all header files encompassing a package. There are 3 variations of this command:
- remove ~id~ - delete by id
- remove ~name~ - remove by package name
- remove ~repo-link~ - remove by repository link

The ids and packages names are provided by the ~list~ command.

*** Example
| hp rm 0 |

#+begin_src bash
workspace
+-- hp.yaml
...
#+end_src

** Syncing
The ~sync~ command simply pulls every package in *hp.yaml* and overwrites overlapping content, effectively updating every package to the latest version.

** Updating
The ~update~ command will automagically update the tool to the latest git commit.

** Wiping hp from workspace
The ~wipe~ command removes all pulled packages and the *hp.yaml* file itself. Does not remove *hp* tool from the computer. For that functionality refer to ~uninstall~.

** Uninstall
Upon confirmation, wipes *hp* from the computer entirely

* TODO Knows bugs
- [X] Update README to the newest version of software
- [X] Fix / pulling (e.g. [[https://github.com/mackron/miniaudio][miniaudio]])
- [X] Implement wiping whole *hp.yaml*
- [X] Fix ~sync~ command to ignore already downloaded packages
- [X] Make it possible to ~wipe~ an empty /hp.yaml/
- [X] Upgrade itself
- [X] Clean up codebase
- [ ] Add comments