You are not logged in.

#1 2015-01-17 12:30:32

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,726
Website

syntax for multiple packages that can satisfy a dependency [SOLVED]

I maintain backintime in the AUR.  Upstream (Debian based) has listed some optional deps that can all satisfy a dependency, but the user needs to only select one of them.  How can I mirror this in my PKGBUILD?

Example:

upstream README wrote:

Qt4 GUI dependencies:
kdesudo | gksu

...

Recommends:
kompare | meld
python-secretstorage | python-keyring-kwallet | python-gnomekeyring

So either kdesudo or gksu will work which I believe converts into Arch packages: 'kdesu' or 'gksu'.  Therefore, users may use either package, but both are not needed.

Note - I have seen how Arch can have multiple packages that provide something like libgl for example, but in that case, all 4 providers have that hard-coded into their respective PKGBUILDs, eg. 1) mesa-libgl  2) nvidia-304xx-libgl  3) nvidia-340xx-libgl  4) nvidia-libgl in this case.

Others per the REAME:
Either kompare or meld will work  which I believe converts into Arch packages: 'kdesdk-kompare' or 'meld'.
Either python-secretstorage or python-gnomekeyring will work but I believe we only have 'python-secretstorage' in the official repos.

Last edited by graysky (2015-01-17 15:22:36)

Offline

#2 2015-01-17 12:32:31

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,319
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

I'd go with declaring both in optdepends and printing an install message telling the user that they need one or the other (or both).


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2015-01-17 12:42:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,726
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

WorMzy wrote:

I'd go with declaring both in optdepends and printing an install message telling the user that they need one or the other (or both).

I could do that for the optdepends, but there is a depends either-or-set as well that I cannot automate yet... (gksu or kdesu).

Last edited by graysky (2015-01-17 12:42:31)

Offline

#4 2015-01-17 12:53:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

It's already a split package - split packages can have separate dependencies for each package.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2015-01-17 13:01:45

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,726
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

Trilby wrote:

It's already a split package - split packages can have separate dependencies for each package.

Yes, but one of the two in the split require either gksu or kdesu.  How can I allow for this either-or dependency?

Offline

#6 2015-01-17 13:25:38

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,779

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

A possibilty might be to add code to create a virtual package for graphical-su .

Here's an example of how this could work in pseudo-code :

package_backintime_detect_graphical_su_dummy()
{
_gksu_installed = false; kdesu_installed = false;
If gksu is present then _gksu_installed = true ;
if kdesu is present then _kdesu_installed = true;

If _gksu_installed OR _kdesu_installed then provides = backintime_graphical_su
}

Add a depend on backintime_graphical_su to the gui program and some comments to clarify how to build.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2015-01-17 13:28:29

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

The official repos do this by making all affected packages provide some generic virtual package e.g. jre7-openjdk provides java-runtime. In an AUR context, this is clearly not applicable, so the least worst workaround is to pick one as the hard dependency and inform your users that they can change it if they want to.

Offline

#8 2015-01-17 14:08:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,726
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

@tomk - Agreed...  I think using some commented text in the PKGBUILD itself might be a good idea failing any official method someone has yet to make me aware of.

Last edited by graysky (2015-01-17 14:13:04)

Offline

#9 2015-01-17 14:44:35

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,640
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

I agree that a comment is the best way to go here.

depends=('gksu')    # change to kdesu if wanted

Or you could ask for a provides to be added to kdesu and gksu in the repos.


This is a problem that pops up every year or two...  I'm not sure what a good solution we could implement in makepkg is.

Offline

#10 2015-01-17 15:22:17

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,726
Website

Re: syntax for multiple packages that can satisfy a dependency [SOLVED]

Thanks Allan.  Might open a FS against the two asking for the meta target (or whatever it's called).

EDIT: https://bugs.archlinux.org/task/43489

Last edited by graysky (2015-01-17 15:31:22)

Offline

Board footer

Powered by FluxBB