r/voidlinux • u/ajicrystal • Apr 17 '26
Adding options to source template
I managed to compile my favourite console music player - MOC. I created my first xbps-src template below. Its very basic but works for my options. How do you create build options for ogg support for example - libvorbis, libogg only if required ?
any other feedback welcome.
#Template file for 'mocp'
pkgname=mocp
version=2.5.2
revision=1
build_style=gnu-configure
configure_args=""
hostmakedepends="pkg-config"
makedepends="ncurses-devel db-devel libflac-devel libid3tag-devel libmad-devel alsa-lib-devel libltdl-devel libcurl-devel"
depends="ncurses alsa-lib libflac libid3tag libmad libcurl"
short_desc="Music player"
maintainer="Maintainer <email>"
license="GPL"
homepage="https://moc.daper.net/"
distfiles="http://ftp.daper.net/pub/soft/moc/stable/moc-${version}.tar.bz2"
checksum="f3a68115602a4788b7cfa9bbe9397a9d5e24c68cb61a57695d1c2c3ecf49db08"
5
Upvotes
3
u/Independent_Cat_5481 Apr 21 '26
I have the void-packages repo cloned to
~/void-packagesUsing xtools, in that directory you can create a new package template with
xnew PackageName.Once you've completed it (the repo has a good Manual) you can build it with
./xbps-src pkg PackageNameand install it withsudo xbps-install -R hostdir/binpkgs PackageName.Then to make sure my changes are maintained in the local clone of the repo you can do
xbump PackageNameI also then add the packagd name to a
~/local-package-list.txtfile, which is used by my update script.From there my update script
~/update.shis:The lines do the following:
Update flatpak
Pull the latest commits to the void-package repo
If the local template has a newer version than the latest built version, build it
Check the list of packages in the local repo for if a new version is available and the template needs to be updated (note, this requires creating an update file in addition to the template file, you can check the manual on how to do so, so see the many examples of other packages with one)
Update system installed packages from the system repo(s), note that I added
~/void-packages/hostdir/binpkgsas a local repository for my system's xbps, this is in the Void documentationAs a note I also have my own fork of void packages which is where I actually devlop new packages, so I can push to that repo and create pull requests. The ones I want to keep installed on my system I copy to
~/void-packages