pkgsym — A poor man's package manager (like brew link but without the brew)
Usage and Motivation
pkgsym is a utility to symlink and un-symlink a package under from a self-contained directory to a prefix.
Say you're installing a package from source without your package manager. You perform the Unix magic invocation (or some on Windows):
./configure --prefix=/usr/local
make
sudo make install
Now you have a bunch of stuff under /usr/local. How do you determine what files came from what package? How do you uninstall the package? (Not all build systems provide a make uninstall.)
Enter pkgsym. Now you can install the package to a self-contained directory, something like this:
./configure --prefix=/usr/local/opt/foopkg
make
sudo make install
So now foo's command is something like /usr/local/opt/foo/bin/foocmd, which definitely isn't going to be in your PATH by default, and you probably don't want to add every odd directory of /usr/local/opt/*/bin to your PATH either.
Homebrew takes the approach of symlinking packages into a prefix. That's exactly what pkgsym does. Now you can finish off your package installation:
sudo pkgsym link --system foo
That will take any directories under /usr/local/opt/foo/ and symlink their contents to /usr/local/{dir}/{file}, creating any directories as necessary. So /usr/local/opt/foo/bin/cmd is symlinked to /usr/local/bin/foocmd, /usr/local/opt/foo/lib/libfoo.so is symlinked to /usr/local/lib/libfoo.so, etc. Subdirectories are handled recursively.
Now to uninstall the package, simply run:
sudo pkgsym unlink --system foo
sudo rm -rf /usr/local/opt/foo
Hey, what's that --system?
pkgsym supports any arbitrary package prefix. You could install foo to C:\Packages\opt\foo if you want, and then have foocmd as C:\Packages\bin\foocmd with something like:
cmake -B build -DCMAKE_INSTALL_PREFIX=C:/Packages/opt/foo
cmake --build build
cmake --install build
pkgsym --prefix C:/Packages link foo
(Forward slashes and backslashes are both supported for Windows).
--system is a shortcut for --prefix /usr/local, and --user is a shortcut for --prefix ~/.local. --user is the default, but is still available as an explicit argument for clarity.
What made this necessary? Are you okay?
Listen installing packages from source on Windows sucks okay? This script is basically a glorified for i in $prefix/opt/**/*; do ln -s "${i:bash/string/manipulation}", but with it as my hammer I've been able to manage dependency hell on Windows with ad-hoc packages.
If you have a real package manager available to you for the thing you want, definitely use that instead. pkgsym is for the unfortunate cases where you do not.
Metadata
Release files for pkgsym 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pkgsym-0.2.4.tar.gz | 6.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pkgsym-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.0 kB
Release files / pkgsym-0.2.4.tar.gz
| Download URL | pkgsym-0.2.4.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca4063cb38fe3e7effd64bff6f1197a11613b7ae3ea8a980a83caa7f0306fcfe
|
|
BLAKE2b-256 checksum How to use checksums |
907e634f211616ff8e2abff2abf6f76bf5847532143635a6524124b1762c310b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / pkgsym-0.2.4-py3-none-any.whl
| Download URL | pkgsym-0.2.4-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
841fe5700e491f1c11e69c1fce77cedd8d6f792297ba759e51d311f82b96f013
|
|
BLAKE2b-256 checksum How to use checksums |
a175b8a68e0976b94e487501a6f751ee33297200f2d802f2a1fa37e33599585b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for pkgsym 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.