Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] Fix alternatives for openjdk{11,17}
@ 2023-11-26 16:04 tornaria
  2023-11-27 12:01 ` ahesford
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tornaria @ 2023-11-26 16:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2888 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages jdk-alternatives
https://github.com/void-linux/void-packages/pull/47416

[RFC] Fix alternatives for openjdk{11,17}
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

Make sure alternatives for openjdk match the files that are shipped, to fix an issue with disappearing `/usr/bin/java`.

Steps to reproduce:
 - install `openjdk11-jre` so there is a symlink `/usr/bin/java -> ../lib/jvm/openjdk11/bin/java`
 - install `openjdk11` so the alternative switches from `java` to `jdk`, which also makes a symlink `/usr/bin/java -> ../lib/jvm/openjdk11/bin/java`
 - uninstall `openjdk11` so the alternative switches back from `jdk` to `java`. The symlink will be removed for `jdk` but not added back for `java`.

Arguably this is a bug in `xbps-alternatives`, but it doesn't seem ok for a package to provide an alternative for a file it doesn't contain (or for two packages to provide the exact same alternative.

However, I'm not sure this is ok. What happens if one tries to use `jdk` alternative from one version and `java` alternative from a different version? Maybe that's the reason why this was set up this way. Thus the [RFC]. I also didn't bump the revision, let me know if I should do that or just fix it and wait for a next update.

I found this while installing and uninstalling `jmol` which depends on `java-environment`, thus `openjdk11` would be installed/uninstalled breaking `/bin/java` for me. I also think `jmol` should not depend on java-environment but that java-runtime should be good enough (it seems to run ok; I don't use it directly but only through sage which uses it sometimes to create png files). So I added a commit here to that effect, but of course I could move that to a separate PR.

Ping: @mhmdanas @classabbyamp since you often update these.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/47416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-jdk-alternatives-47416.patch --]
[-- Type: text/x-diff, Size: 4160 bytes --]

From 4b3d130bba421453247b7191bbc9b28b6f4afed7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 26 Nov 2023 12:16:49 -0300
Subject: [PATCH 1/3] openjdk11: fix alternatives

---
 srcpkgs/openjdk11/template | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/srcpkgs/openjdk11/template b/srcpkgs/openjdk11/template
index b5dd94241a0c8..f8df2a88ac782 100644
--- a/srcpkgs/openjdk11/template
+++ b/srcpkgs/openjdk11/template
@@ -77,7 +77,6 @@ alternatives="
  jdk:/usr/bin/jaotc:/${_jdk_home}/bin/jaotc
  jdk:/usr/bin/jar:/${_jdk_home}/bin/jar
  jdk:/usr/bin/jarsigner:/${_jdk_home}/bin/jarsigner
- jdk:/usr/bin/java:/${_jdk_home}/bin/java
  jdk:/usr/bin/javac:/${_jdk_home}/bin/javac
  jdk:/usr/bin/javadoc:/${_jdk_home}/bin/javadoc
  jdk:/usr/bin/javap:/${_jdk_home}/bin/javap
@@ -86,10 +85,10 @@ alternatives="
  jdk:/usr/bin/jdb:/${_jdk_home}/bin/jdb
  jdk:/usr/bin/jdeprscan:/${_jdk_home}/bin/jdeprscan
  jdk:/usr/bin/jdeps:/${_jdk_home}/bin/jdeps
+ jdk:/usr/bin/jfr:/${_jdk_home}/bin/jfr
  jdk:/usr/bin/jhsdb:/${_jdk_home}/bin/jhsdb
  jdk:/usr/bin/jimage:/${_jdk_home}/bin/jimage
  jdk:/usr/bin/jinfo:/${_jdk_home}/bin/jinfo
- jdk:/usr/bin/jjs:/${_jdk_home}/bin/jjs
  jdk:/usr/bin/jlink:/${_jdk_home}/bin/jlink
  jdk:/usr/bin/jmap:/${_jdk_home}/bin/jmap
  jdk:/usr/bin/jmod:/${_jdk_home}/bin/jmod
@@ -99,13 +98,8 @@ alternatives="
  jdk:/usr/bin/jstack:/${_jdk_home}/bin/jstack
  jdk:/usr/bin/jstat:/${_jdk_home}/bin/jstat
  jdk:/usr/bin/jstatd:/${_jdk_home}/bin/jstatd
- jdk:/usr/bin/keytool:/${_jdk_home}/bin/keytool
- jdk:/usr/bin/pack200:/${_jdk_home}/bin/pack200
  jdk:/usr/bin/rmic:/${_jdk_home}/bin/rmic
- jdk:/usr/bin/rmid:/${_jdk_home}/bin/rmid
- jdk:/usr/bin/rmiregistry:/${_jdk_home}/bin/rmiregistry
  jdk:/usr/bin/serialver:/${_jdk_home}/bin/serialver
- jdk:/usr/bin/unpack200:/${_jdk_home}/bin/unpack200
 "
 
 post_extract() {

From e5bb43a0668319493448be8cc1522b69a9ec8274 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 26 Nov 2023 12:16:54 -0300
Subject: [PATCH 2/3] openjdk17: fix alternatives

---
 srcpkgs/openjdk17/template | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/srcpkgs/openjdk17/template b/srcpkgs/openjdk17/template
index bb72701f360e6..4c2d46db656a4 100644
--- a/srcpkgs/openjdk17/template
+++ b/srcpkgs/openjdk17/template
@@ -86,7 +86,6 @@ fi
 alternatives="
  jdk:/usr/bin/jar:/${_jdk_home}/bin/jar
  jdk:/usr/bin/jarsigner:/${_jdk_home}/bin/jarsigner
- jdk:/usr/bin/java:/${_jdk_home}/bin/java
  jdk:/usr/bin/javac:/${_jdk_home}/bin/javac
  jdk:/usr/bin/javadoc:/${_jdk_home}/bin/javadoc
  jdk:/usr/bin/javap:/${_jdk_home}/bin/javap
@@ -95,7 +94,6 @@ alternatives="
  jdk:/usr/bin/jdb:/${_jdk_home}/bin/jdb
  jdk:/usr/bin/jdeprscan:/${_jdk_home}/bin/jdeprscan
  jdk:/usr/bin/jdeps:/${_jdk_home}/bin/jdeps
- jdk:/usr/bin/jfr:/${_jdk_home}/bin/jfr
  jdk:/usr/bin/jhsdb:/${_jdk_home}/bin/jhsdb
  jdk:/usr/bin/jimage:/${_jdk_home}/bin/jimage
  jdk:/usr/bin/jinfo:/${_jdk_home}/bin/jinfo
@@ -109,8 +107,6 @@ alternatives="
  jdk:/usr/bin/jstack:/${_jdk_home}/bin/jstack
  jdk:/usr/bin/jstat:/${_jdk_home}/bin/jstat
  jdk:/usr/bin/jstatd:/${_jdk_home}/bin/jstatd
- jdk:/usr/bin/keytool:/${_jdk_home}/bin/keytool
- jdk:/usr/bin/rmiregistry:/${_jdk_home}/bin/rmiregistry
  jdk:/usr/bin/serialver:/${_jdk_home}/bin/serialver
 "
 

From 0db66ce05b6a0a9d8e241755bb5343f956aa573b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 26 Nov 2023 12:17:21 -0300
Subject: [PATCH 3/3] jmol: depend on java-runtime instead of java-environment

---
 srcpkgs/jmol/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/jmol/template b/srcpkgs/jmol/template
index 7217fdfaeb90d..4a61160eb454a 100644
--- a/srcpkgs/jmol/template
+++ b/srcpkgs/jmol/template
@@ -2,7 +2,7 @@
 pkgname=jmol
 version=16.1.9
 revision=1
-depends="virtual?java-environment"
+depends="virtual?java-runtime"
 short_desc="Open-source Java/JavaScript-based molecule viewer"
 maintainer="Brenton Horne <brentonhorne77@gmail.com>"
 license="LGPL-2.1-or-later"

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-23  0:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-26 16:04 [PR PATCH] [RFC] Fix alternatives for openjdk{11,17} tornaria
2023-11-27 12:01 ` ahesford
2023-11-27 15:34 ` classabbyamp
2023-11-28  1:59 ` tornaria
2023-11-28 14:23 ` classabbyamp
2023-11-28 14:34 ` classabbyamp
2023-11-28 18:43 ` ahesford
2023-11-28 21:44 ` classabbyamp
2023-12-23  0:23 ` tornaria
2023-12-23  0:23 ` [PR PATCH] [Closed]: " tornaria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).