You are not logged in.

#1 2015-10-11 19:02:58

Xaero252
Member
Registered: 2011-11-28
Posts: 107

What's the right way to write a multiarch, conditional PKGBUILD?

So, I've just submitted my first PKGBUILD since the AUR update, for a special package to add proper SFML functionality on the Raspberry Pi (The upstream source isn't written against OpenGL ES and the existing PKGBUILD doesn't compile against the opt/vc stuff)
I wrote this PKGBUILD to satisfy the dependency for another PKGBUILD that isn't on the AUR currently - for an application called "attract mode" - which is yet another front-end for emulators.

Now that we have some preface as to what I'm packaging we run into this small problem that makes it unique from the majority of PKGBUILDs I have seen:

On x86, 32-bit and 64-bit the dependencies are:

depends='openal'
makedepends='sfml>=2.0'
optdepends='ffmpeg' 'fontconfig' 'libxinerama'

On the armv7h target, the dependencies are unchanged _UNLESS_ it's Raspberry Pi.
Most arm devices support the upstream sfml source with no modifications, however in the case of Raspberry Pi we need to use the aforementioned sfml;

How should I approach this?
If I simply do the following:

depends_armv7h='sfml-rpi-git'

I would then force devices that shouldn't use the rpi branch to use that branch. Is there a better way to approach this?

Offline

#2 2015-10-12 07:01:03

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: What's the right way to write a multiarch, conditional PKGBUILD?

Have a look at the Steam PKGBUILD, either via ABS or on the package page. It shows how multiarch logic works in PKGBUILDS pretty well.

I have not played around with the Pi in a while, but you need to find the exact architecture string and see if it is different from other armv7h archs. If so, proceed as learned from the Steam PKGBUILD. If not, I'd suggest against an endlessly complicated PKGBUILD logic. Create a new package called $MYPACKAGE-rpi (better ask on the AUR mailing list for exact naming conventions), that provides the initial package name (and/or conflicts, read the PKGBUILD wiki article to learn more). The only people bothered by this, will be those who use AUR helpers for automatic dependency resolution without paying attention. If I consider all the factors, this might be the only real reason to write a complicated PKGBUILD. Not a good reason.

Offline

Board footer

Powered by FluxBB