You are not logged in.

#1 2019-10-23 00:33:40

Young
Member
Registered: 2009-04-26
Posts: 50

java-runtime dependency version problem

Hi!

I'm trying to create a PKGBUILD for a package that depends on any version of java-runtime between 8 and 11 (not 7 and not 13, but anything in between). According the wiki (https://wiki.archlinux.org/index.php/PKGBUILD), I should be able to restrict the version of a package by using something like:

depends=('foobar>=1.8.0' 'foobar<2.0.0')

So I tried to do this:

depends=('java-runtime>7' 'java-runtime<13')

But it appears to ignore the second restriction, as it offers me to install version 13. Am I doing something wrong?

Thanks for your time.

Offline

#2 2019-10-23 02:03:04

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: java-runtime dependency version problem

The dependencies are evaluated independently

==> Checking runtime dependencies...
==> Installing missing dependencies...
:: There are 4 providers available for java-runtime>7:
:: Repository extra
   1) jre-openjdk  2) jre10-openjdk  3) jre11-openjdk  4) jre8-openjdk

Enter a number (default=1): 2
:: There are 4 providers available for java-runtime<13:
:: Repository extra
   1) jre10-openjdk  2) jre11-openjdk  3) jre7-openjdk  4) jre8-openjdk

Enter a number (default=1): 1

I believe the best you can achieve is to document the package is for java 8-11 and if the package supplies a binary do something similar to https://git.archlinux.org/svntogit/comm … ges/pdfsam

Offline

#3 2019-10-23 04:39:14

Young
Member
Registered: 2009-04-26
Posts: 50

Re: java-runtime dependency version problem

Actually, the application provides its own version of java, but I'm trying to avoid using that in favor of using the java-runtime provided by Arch's official repository. I'm thinking about sticking to version 11 of java (since it's the latest one that works) and replacing the original launcher (inside $pkgdir/usr/bin) with a wrapper that locally changes the default PATH of java (as suggested here: https://wiki.archlinux.org/index.php/ja … a_version).

Offline

#4 2019-10-23 12:51:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: java-runtime dependency version problem

Often splitting those conditions can be used to workaround these issues.

Try

depends+=('java-runtime>=8')
conflicts+=('java-runtime>13')

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


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB