Skip to content

Instantly share code, notes, and snippets.

@Piraty
Last active February 3, 2024 22:00
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save Piraty/2e8c9fa86d4eb70f22efb9e0ecdda235 to your computer and use it in GitHub Desktop.
Save Piraty/2e8c9fa86d4eb70f22efb9e0ecdda235 to your computer and use it in GitHub Desktop.
Setting up xbps-src
Docs
1: https://wiki.voidlinux.eu/Xbps-src
2: https://github.com/voidlinux/void-packages/blob/master/Manual.md
3: https://github.com/voidlinux/void-packages/blob/master/README.md
clone https://github.com/voidlinux/void-packages.git
$ xbps-install xtools
xtools provides "xi" (short for xbps-install.
It takes a local void-packages repo into account, so you can install your own built packages easily just by "xi <pkgname>") (man xtools)
Now in void-packages
$ ./xbps-src binary-bootstrap (set up a build chroot env)
make a branch
- use an existing template to work on
- or make your own with "xnew <pkgname>"
Enable ccache (speeds up re-builds significantly!) and use multi-cpu
$ cat void-packages/etc/conf
XBPS_CCACHE=yes
XBPS_MAKEJOBS=4
$ ./xbps-src pkg <pkgname>
This should give you a first working build.
The package is configured, built and installed in a chroot and the .xbps file is derived from the installed files.
That one can be installed via "xi <pkgname>" when you are inside your void-packages-repo
Notes:
- chroot resides in masterdir
- build runs in masterdir/builddir
- files are installed into masterdir/destdir
- (packges reside in hostdir/binpkgs, but better use xi to install to system)
- after succesful build, the chroot is cleaned and dependencies are removed. use -C flag to preserve installed dependencies and the destdir
- upon a new call of ./xbps-src, it clean automatically, removing previously installed dependencies. So, if you re-run a lot and don't want to re-install the same depencencies everytime, use -C flag to skip cleaning
- if you mess up your master dir, use ./xbps-src zap and run ./xbps-src binary-bootstrap again
- if you already have an .xbps-file in hostdir/binpkgs with the same version+revision as the template you are building, it will not overwrite this file upon new build. use ./xbps-src -f pkg <pkgname> to force overwrite it
- keep your void-packages repo in sync with upstream, otherwise you end up building outdated templates (use sth like git pull --rebase upstream master)
@DonPiotr
Copy link

DonPiotr commented Feb 2, 2024

It should be:
2: https://github.com/void-linux/void-packages/blob/master/Manual.md
3: https://github.com/void-linux/void-packages/blob/master/README.md

clone https://github.com/void-linux/void-packages.git

Note: etc/conf should be used as indicated because etc/defaults.conf should be leave as it is

Need some notes on rebasing own branches.

@Piraty
Copy link
Author

Piraty commented Feb 3, 2024

this is from 2017 and repositories changed since then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment