FS#60468 - [netbeans] Explicit (make)dependencies to a specific jdk
Attached to Project:
Community Packages
Opened by Alexandre Garnier (agarnier) - Thursday, 18 October 2018, 08:22 GMT
Last edited by Santiago Torres (sangy) - Tuesday, 23 October 2018, 04:17 GMT
Opened by Alexandre Garnier (agarnier) - Thursday, 18 October 2018, 08:22 GMT
Last edited by Santiago Torres (sangy) - Tuesday, 23 October 2018, 04:17 GMT
|
Details
Is there any need for this package to depend on
jdk10-openjdk rather than java-{environment,runtime}?
Same question goes for the makedep to jdk8-openjdk. AFAIK this packages and aur/apache-netbeans (https://aur.archlinux.org/packages/apache-netbeans/) bundle the very same IDE, and I’ve been using the latter flawlessly for quite a few weeks without having any openjdk installed. |
This task depends upon
It is because I have oracle jdk 9+ that I don’t want this package to install an openjdk one.
But it does so, systematically, just have a look at the PKGBUILD if you have a doubt:
depends=([…] 'jdk10-openjdk')
makedepends=([…] 'jdk8-openjdk')
And basically, I assume netbeans needs any jdk8+ to be built, not the very specific jdk8-openjdk. The way to go here is to specify the make-dependency as java-environment>=8.
But there is something worse: in your PKGBUILD, you *also* have java-environment as make dependency, which defaults to jdk10-openjdk, instead of jdk8-openjdk, and most definitely uses it by default. The consequence of this is your PKGBUILD does use time, bandwidth, CPU and disk space to install jdk8-openjdk, and never uses it.
Another issue, though not so important, with your PKGBUILD is the presence of java-environment in depends & makedepends: from the Wiki it is stated that depends lists dependencies for build *and* run, while makedepends manages dependencies only needed to build the package.
Ideally, I assume these two lines should look like this:
depends=('java-environment>=8' 'ttf-font')
makedepends=('ant')
Here I’m assuming a jdk8+ is enough for netbeans 9.0 to be built *and* run; you may want to replace the version with 10 if it is needed to run netbeans (which might be the case, as you put jdk10-openjdk as a dependency at the moment?)
This lets users use their already installed jdk, or chose which one they want in order to build & run netbeans, and this is the way to go.
Well that's the intention. As of now, we don't provide any other type of jdk in any of the official repositories
>And basically, I assume netbeans needs any jdk8+ to be built, not the very specific jdk8-openjdk. The way to go here is to specify the make-dependency as java-environment>=8.
The reason as to why I need to do this is because it *will* default to jdk 10 as you mention down there.
> But there is something worse: in your PKGBUILD, you *also* have java-environment as make dependency, which defaults to jdk10-openjdk, instead of jdk8-openjdk, and most definitely uses it by default. The consequence of this is your PKGBUILD does use time, bandwidth, CPU and disk space to install jdk8-openjdk, and never uses it.
It uses if, you should read the build() section of the PKGBUILD.
> Another issue, though not so important, with your PKGBUILD is the presence of java-environment in depends & makedepends: from the Wiki it is stated that depends lists dependencies for build *and* run, while makedepends manages dependencies only needed to build the package.
> Ideally, I assume these two lines should look like this:
> depends=('java-environment>=8' 'ttf-font')
> makedepends=('ant')
> Here I’m assuming a jdk8+ is enough for netbeans 9.0 to be built *and* run; you may want to replace the version with 10 if it is needed to run netbeans (which might be the case, as you put jdk10-openjdk as a dependency at the moment?)
They explicitly mention in the readme you need jdk8 for building and 9+ for running.
> This lets users use their already installed jdk, or chose which one they want in order to build & run netbeans, and this is the way to go.
I think part of the reason is that you haven't tried these changes yourself and are just speculating on what needs to be done to build from source. The AUR package that you mention is a -bin package, which by the way should be renamed as such.
Nevertheless, can’t the makedepend be replaced with java-environment=8?
It is unambiguously true that the makedepends and depends on java-environment are pointless. They're the same dependency string.
And if it depends on java-environment=8 to build, then it must specify that versioned dependency, rather than assuming what the user selects in the maybe interactive prompt. Same goes for the depends on >=9.
Rigging the depends/makedepends by *also* hardcoding the jdk8/jdk10 package means you're not using the java-environment dependency string *at all*. Its being there is a lie.
This PKGBUILD only depends on jdk10-openjdk, and it only makedepends on jdk8-openjdk, and that defeats the purpose of having the provides in our repository at all.
You do raise a valid point though. After discussing with some other TU's it appears there's a way to do this cleanly and allowing you to use the jdk that you want. Let me push a -3 version of this for you and thanks for reporting this issue.
I updated the package to not have a hard dependency on openjdk.