I have frequently looked to Arch Linux and their AUR (Arch Linux User Repository) for inspiration on how to port various things to FreeBSD. I recently looked a little deeper due to revisiting an attempt to port Defold game engine. One of the things I happened to look at is their version of a makefile, the PKGBUILD file.
An example framework for how a PKGBASE file is constructed that I found after more looking around.
# This is an example PKGBUILD file. Use this as a start to creating your own, # and remove these comments. For more information, see 'man PKGBUILD'. # NOTE: Please fill out the license field for your package! If it is unknown, # then please put 'unknown'. # Maintainer: Your Namepkgname=NAME pkgver=VERSION pkgrel=1 epoch= pkgdesc="" arch=() url="" license=('GPL') groups=() depends=() makedepends=() checkdepends=() optdepends=() provides=() conflicts=() replaces=() backup=() options=() install= changelog= source=("$pkgname-$pkgver.tar.gz" "$pkgname-$pkgver.patch") noextract=() sha256sums=() validpgpkeys=() prepare() { cd "$pkgname-$pkgver" patch -p1 -i "$srcdir/$pkgname-$pkgver.patch" } build() { cd "$pkgname-$pkgver" ./configure --prefix=/usr make } check() { cd "$pkgname-$pkgver" make -k check } package() { cd "$pkgname-$pkgver" make DESTDIR="$pkgdir/" install }
The one specific PKGBASE file I saw initially which I had believed was for Defold but I am guessing now it is for one of its dependencies instead.
# Maintainer: Jens Staalpkgname=sbase-hg pkgver=20110624 pkgrel=1 pkgdesc="A suckless variant of the *nix core utilities" arch=('i686' 'x86_64') license=('MIT') url="http://hg.suckless.org/sbase/" makedepends=('mercurial') build() { cd $srcdir # Update the repo, else clone a new one if [ -d sbase ]; then cd sbase hg pull -u cd $srcdir else hg clone http://hg.suckless.org/sbase fi rm -rf $srcdir/build # start fresh cp -ar $srcdir/sbase $srcdir/build } package() { cd $srcdir/build/ make DESTDIR=$pkgdir PREFIX=/opt install mkdir -p $pkgdir/usr/share/licenses/$pkgname/ install -m644 $srcdir/build/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE }
So my thought, foreshadowed by the title, is might it be possible to use their efforts to bootstrap FreeBSD ports? And surely if we can do this, the reverse can be true as well. Considering most of our ports arrive via Linux, it is less likely that our ports tree is examined by Arch folks trying to get something to work but it could happen. Both projects can certainly benefit from being able to translate between the two build/pkg systems easily. I or others could complete this translation task but it may take some time. If I manage some level of success I can write about it in another blog post, but I still would like to get Defold game engine ported regardless.
No comments:
Post a Comment
Thank you for your interest!