[aur-general] How to depend a pkg on two alternative packages?
Hello, I want to create a package for an app that needs either pyaudio or (as an alternative) pygame. How can I write this in the PKGBUILD? And what's more: The main dependency pyaudio is "only" in AUR but the alternative "pygame" is part of the official repos. For now, I don't know when the app decides what package to use. So I see three ways to do it: * make both packages alternatives in the depends-array (but how?) * make pygame a hard dependency (because it is an official package) and pyaudio an optional one * make both optional and write a message to .install, that at least one of them has to be installed ... Could you help me? Uwe
I have never seen something like alternative dependencies so I suppose that you make pygame the non optional dependency. Is there an advantage from using pyaudio over pygame ? Mateusz -- Sent from my toaster
On 14-03-2015 15:09, Uwe Koloska wrote:
Hello,
I want to create a package for an app that needs either pyaudio or (as an alternative) pygame. How can I write this in the PKGBUILD?
And what's more: The main dependency pyaudio is "only" in AUR but the alternative "pygame" is part of the official repos.
For now, I don't know when the app decides what package to use. So I see three ways to do it:
* make both packages alternatives in the depends-array (but how?)
* make pygame a hard dependency (because it is an official package) and pyaudio an optional one
* make both optional and write a message to .install, that at least one of them has to be installed ...
Could you help me? Uwe
If I'm not wrong, what you want is done with the provides array. Both pyaudio and pygame would need to "say" they provide something in common. When a user installs your package, pacman will prompt to install one if needed. Example: package one name: fast food place provides: food package two: name: fancy cuisine restaurant provides: food package three name: super duper food chain requires: food When you want to install super duper food chain you will be prompted to install either fast food place or fancy cuisine restaurant if neither is installed. -- Mauro Santos
If you maintain "pyaudio" package, you could add provides=(pygame) to it. Then the package that you're now creating would just need to have depends=(pygame).
* Damian Nowak <enwukaer@gmail.com> [2015-03-14 12:50:32 -0500]:
If you maintain "pyaudio" package, you could add provides=(pygame) to it.
Then the package that you're now creating would just need to have depends=(pygame).
That's a bad idea. Then everything depending on pygame would consider that dependency satisfied when pyaudio is installed, and thus break. Florian -- http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/
On Sat, Mar 14, 2015 at 10:09 AM, Uwe Koloska <kolewu@koloro.de> wrote:
I want to create a package for an app that needs either pyaudio or (as an alternative) pygame. How can I write this in the PKGBUILD?
Mauro's reply is the technically correct one - however, I'm questioning your logic. The two packages are not alternates of the same thing; pyaudio is simply the audio bindings, whereas pygame is for writing games. Your app needing "one or the other" is a logic split - either you need the audio bindings, or you need the gaming code -- they don't even provide the same shared binary modules or play on the same field. Just require pyaudio since you're in AUR and it's a quick, easy build then make your Optional for pygame if you want. The provides/requires as Mauro outlines is when two packages provide the same functionality -- for example, Exim and Postfix provide "smtp-server" so an app who requires smtp-server is satisfied by A or B. Your app/package trying to require pyaudio/pygame as equal alternates is just... questionable. $0.02, -te
Hello, thanks for your answers and input. Am 14.03.2015 um 21:06 schrieb Troy Engel:
On Sat, Mar 14, 2015 at 10:09 AM, Uwe Koloska <kolewu@koloro.de> wrote:
I want to create a package for an app that needs either pyaudio or (as an alternative) pygame. How can I write this in the PKGBUILD?
Mauro's reply is the technically correct one - however, I'm questioning your logic. The two packages are not alternates of the same thing; pyaudio is simply the audio bindings, whereas pygame is for writing games. Your app needing "one or the other" is a logic split - either you need the audio bindings, or you need the gaming code -- they don't even provide the same shared binary modules or play on the same field.
No logic split in here ;-) The app (BTW it's EdWare http://meetedison.com/robot-programming-software/) needs audio and if I understand it correctly, was developed with pyaudio (a python binding to portaudio) and then enhanced with an alternative binding to the audio part of pygame. And since I'm not the maintainer of pyaudio nor pygame, I can't add the provides information. So I really want some way to express the logic: "This app needs audio bindings but they can be provided equally well by two different packages that are besides from the audio part very different and so don't share matching provides statements." Looks like I can't express this in a PKGBUILD. Thank you Uwe
On 2015-03-14 21:48 +0100 Uwe Koloska wrote:
The app (BTW it's EdWare http://meetedison.com/robot-programming-software/) needs audio and if I understand it correctly, was developed with pyaudio (a python binding to portaudio) and then enhanced with an alternative binding to the audio part of pygame.
When I began reading this thread, I suspected that pygame may provide pyaudio, in which case your package should depend on "pyaudio" and pygame should provide "pyaudio". After the explanation above, however, it seems that there really are two completely different audio systems that your package can use. In that case. you will have to make an arbitrary choice. If upstream recommends one over the other then you should use that. If not, use the one in the official repos. Add a comment in the PKGBUILD to let the user know that one can be replaced with the other before building the package.
And since I'm not the maintainer of pyaudio nor pygame, I can't add the provides information.
Although in this case it would be incorrect for either pyaudio or pygame to provide the other (as I understand it), if a similar issue arises again you can always request that the maintainer of a package add that information.
So I really want some way to express the logic: "This app needs audio bindings but they can be provided equally well by two different packages that are besides from the audio part very different and so don't share matching provides statements."
Looks like I can't express this in a PKGBUILD.
Unfortunately this isn't possible even though there are times when it would be very useful. I believe that the matter has been discussed before and that the devs may be open to the idea but I am not sure. Regards, Xyne
participants (7)
-
Damian Nowak
-
Florian Bruhin
-
Mateusz Lemusisk
-
Mauro Santos
-
Troy Engel
-
Uwe Koloska
-
Xyne