[aur-general] Packaging question

Magnus Therning magnus at therning.org
Sun Feb 2 02:12:11 EST 2014

First off, please don't hijack threads in the list; refrain from using
reply-to when starting a new discussion!

On Sat, Feb 01, 2014 at 11:02:53PM -0700, Andrew DeMaria wrote:
> Hi all!
> So say I have package A which is installed with a "Drivers" folder
> under /usr/lib/PACKAGE_A/.  This package then would have an optional
> dependency on another standalone library (pakage B) to provide a
> certain driver.  To make package A work properly with the optional
> package B, either a symlink or direct copy of a libBBB.so file needs
> to be made. i.e.
> /usr/lib/PACKAGE_A/Drivers/libBBB.so -> /usr/lib/PACKAGE_B/libBBB.so
> So my question is, what is the best way to make this happen?  Do I
> provide a *.install file for PACKAGE_A that tries to see if
> PACKAGE_B exists and then link the files if so?  What should happen
> if PACKAGE_B is installed after PACKAGE_A?
> For reference PACKAGE_A is openni2
> (https://aur.archlinux.org/packages/openni2) and PACKAGE_B is
> libfreenect-git
> (https://aur.archlinux.org/packages/libfreenect-git/).  Currently
> they are not tied to each other, but I would like to make it
> possible for openni2 to optionally? depend on a driver provided by
> libfreenect.

In PKGBUILDs you can either depend (place a package in the 'depends'
array) on a package, or optionally depend (place a package in the
'optdepends' array) on a package.  The crucial thing to realise is
that in order to use 'optdepends' the built package must be able to
determine at runtime whether the optional dependencies are present and
if so make use of them.

With this in mind it sounds like what you need is two openni2
packages, one that

  - doesn't depend on libfreenect-git
  - configures openni2 at build time to NOT use (i.e. link against)

and one that

  - does depend on libfreenect-git
  - configures openni2 at build to use (i.e. link against) libfreenect


Magnus Therning                      OpenPGP: 0xAB4DFBA4 
email: magnus at therning.org   jabber: magnus at therning.org
twitter: magthe               http://therning.org/magnus

10.0 times 0.1 is hardly ever 1.0.
            - The Elements of Programming Style (Kernighan & Plaugher)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mailman.archlinux.org/pipermail/aur-general/attachments/20140202/2f49062b/attachment.asc>

More information about the aur-general mailing list