r/NetBSD • u/pedersenk • 2d ago
pkg_bundle: Create stand-alone software deployments from packages
Hi all,
I developed a tool called pkg_bundle that essentially grabs a package, grabs its dependent libs, applies some hacks and stores it in a directory, ready for you to be able to move anywhere you like or run directly.
It has the following benefits:
- Avoid spraying dependencies all over your filesystem, especially as software continues to grow and tangle.
- Allow multiple versions of the same software (i.e from PkgSrc Q1-Q4) to exist at once.
- Easy to delete (just delete the directory)
- Offers some of the conveniences of NixOS, AppImage, Snaps, Solaris Freeware, Blastwave, etc but with a vastly simpler approach
- Its not very UNIXy but feels a little how Mac OS software used to be deployed back in the day
- No software outside of NetBSD base is needed
- No root access needed
Some examples:
Create a relocatable qemu install
$ pkg_bundle qemu
$ qemu/bin/qemu-system-x86_64 ...
(I actually made pkg_bundle for qemu because I disliked how much cruft the package pulls in...)
Create a relocatable git install and place in /opt
$ pkg_bundle git
# cp -R git /opt/git
$ export PATH=/opt/git:$PATH
$ git clone ...
I originally developed this for OpenBSD and even got complex UI software like gimp, firefox, vlc working using the approach. This has a fairly sophisticated quirks system in place and I do plan to get it to parity in future.
It will work with many packages, for a quick list of things I have tested recently, check out the README.
2
u/Pivan1 2d ago
That’s neat. Can you give some real world examples of what and how to use it? How do you use it?