Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] openjdk-common: update to 2.
@ 2024-01-06 21:45 classabbyamp
  2024-01-06 22:05 ` [PR PATCH] [Merged]: " classabbyamp
  0 siblings, 1 reply; 2+ messages in thread
From: classabbyamp @ 2024-01-06 21:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages binjava
https://github.com/void-linux/void-packages/pull/48092

openjdk-common: update to 2.
adds /usr/bin/java script to bridge the gap between fully profile-based and fully /usr/bin symlinks

<!-- Uncomment relevant sections and delete options which are not applicable -->

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


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

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

From 69b40f6bb307dc9677d72805f93236f9bbd82e79 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 6 Jan 2024 16:44:19 -0500
Subject: [PATCH] openjdk-common: update to 2.

adds /usr/bin/java script to bridge the gap between fully profile-based
and fully /usr/bin symlinks
---
 srcpkgs/openjdk-common/files/java.sh    | 11 +++++++++++
 srcpkgs/openjdk-common/files/profile.sh |  4 ++--
 srcpkgs/openjdk-common/template         |  3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/openjdk-common/files/java.sh

diff --git a/srcpkgs/openjdk-common/files/java.sh b/srcpkgs/openjdk-common/files/java.sh
new file mode 100644
index 0000000000000..3454478eadecb
--- /dev/null
+++ b/srcpkgs/openjdk-common/files/java.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# allows scripts that assume java exists on PATH to work
+# and helps users use java without logging out/in for the profile script
+die() {
+	echo "java: $@" >&2
+	exit 1
+}
+. /etc/profile.d/jdk.sh
+[ -d "$JAVA_HOME" ] || die "/usr/lib/jvm/default-jre not found. Check xbps-alternatives -lg java"
+[ -x "$JAVA_HOME"/bin/java ] || die "$JAVA_HOME/bin/java does not exist or is not executable"
+exec "$JAVA_HOME"/bin/java "$@"
diff --git a/srcpkgs/openjdk-common/files/profile.sh b/srcpkgs/openjdk-common/files/profile.sh
index e9c9a6042eea7..88d482ebe33a2 100644
--- a/srcpkgs/openjdk-common/files/profile.sh
+++ b/srcpkgs/openjdk-common/files/profile.sh
@@ -1,7 +1,7 @@
 # only modify the environment if an openjdk*-jre package is installed
-if [ -e "/usr/lib/jvm/default-jre" ]; then
+if [ -d "/usr/lib/jvm/default-jre" ]; then
 	# if an openjdk* package is installed, prefer it to the selected jre
-	if [ -e "/usr/lib/jvm/default-jdk" ]; then
+	if [ -d "/usr/lib/jvm/default-jdk" ]; then
 		export JAVA_HOME="/usr/lib/jvm/default-jdk"
 	else
 		export JAVA_HOME="/usr/lib/jvm/default-jre"
diff --git a/srcpkgs/openjdk-common/template b/srcpkgs/openjdk-common/template
index e0d3d53d55004..8b0748efaad54 100644
--- a/srcpkgs/openjdk-common/template
+++ b/srcpkgs/openjdk-common/template
@@ -1,6 +1,6 @@
 # Template file for 'openjdk-common'
 pkgname=openjdk-common
-version=1
+version=2
 revision=1
 short_desc="Common files for OpenJDK packages"
 maintainer="classabbyamp <void@placeviolette.net>"
@@ -9,4 +9,5 @@ homepage="https://www.voidlinux.org"
 
 do_install() {
 	vinstall "${FILESDIR}"/profile.sh 644 /etc/profile.d jdk.sh
+	vbin "${FILESDIR}"/java.sh java
 }

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

* Re: [PR PATCH] [Merged]: openjdk-common: update to 2.
  2024-01-06 21:45 [PR PATCH] openjdk-common: update to 2 classabbyamp
@ 2024-01-06 22:05 ` classabbyamp
  0 siblings, 0 replies; 2+ messages in thread
From: classabbyamp @ 2024-01-06 22:05 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

openjdk-common: update to 2.
https://github.com/void-linux/void-packages/pull/48092

Description:
adds /usr/bin/java script to bridge the gap between fully profile-based and fully /usr/bin symlinks

<!-- Uncomment relevant sections and delete options which are not applicable -->

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


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

end of thread, other threads:[~2024-01-06 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-06 21:45 [PR PATCH] openjdk-common: update to 2 classabbyamp
2024-01-06 22:05 ` [PR PATCH] [Merged]: " classabbyamp

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).