P2pkgs
A source based package tree with virtual environments, optional p2p mirrors and optional remote build caching.
Install / Use
/learn @andrewchambers/P2pkgsREADME
p2pkgs
A simple, auditable, source based, package system for linux with an optional precompiled package cache and optional p2p mirroring.
Key features
-
Everything is built from source except a small set of well defined bootstrap packages.
-
Every bootstrap package can be reproduced exactly via the package tree itself.
-
Every download can be mirrored over p2p networks and self hosted, there is no central server that can prevent packages from compiling.
-
Packages can easily be exported to virtual environments, tarballs, docker containers and anything else you need.
Getting started
Install the dependencies:
- bwrap to run the build sandbox.
- goredo or redo or the very limited ./bin/do.
- curl to download source tarballs.
- recutils used for the mirror databases.
- gnu tar used for reproducible tarballs.
Optional dependencies:
- ipfs used for peer to peer package caches and source mirrors.
Building a package
./bin/build-packages-ifchange ./pkg/{make,oksh}
or:
$ redo -j $(nproc) ./pkg/make/.pkg.tar.gz
Running packages in a venv
We support running packages in a container called a venv:
$ ./bin/venv -j $(nproc) ./pkg/{make,oksh,gnu-base}
$ ./venv/bin/venv-run make --version
GNU Make 4.2
The requested process is run in a linux user container with top level directories substituted for those in the requested packages, this allows very lightweight use of package environments.
Setting up a package cache
To avoid compiling packages from source you can configure a package cache, which acts transparently but dramatically increases the build speed of cached packages.
See the package cache documentation for more information.
Public package caches
Below are some public package caches, you should only use them if you trust the cache owner.
Development package cache by Andrew Chambers:
export PKG_CACHE_URL=ipns://k51qzi5uqu5dlbmgpow9z63mgu9kita6zcipmdv63cq0nkyztwx4vzv02dyj02
Writing packages
For more information about writing packages see the packaging documentation.
Technical overview
To see how it all works, check the technical overview.
