unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: Julien Lepiller <julien@lepiller.eu>
Cc: 51693@debbugs.gnu.org
Subject: bug#51693: [patch] Add Java 17
Date: Sun, 14 Nov 2021 21:59:44 +0100	[thread overview]
Message-ID: <87zgq61hmw.fsf@web.de> (raw)
In-Reply-To: <20211114165407.5223d22f@tachikoma.lepiller.eu>


[-- Attachment #1.1: Type: text/plain, Size: 1322 bytes --]


Julien Lepiller <julien@lepiller.eu> writes:

> Le Mon, 08 Nov 2021 21:32:16 +0100,
> "Dr. Arne Babenhauserheide" <arne_bab@web.de> a écrit :
>
>> the attached patch adds openjdk@17
>> 
>> Take care with updating packages depending on this, because the
>> changes to the module system can cause runtime failures.

> sorry for the delay.

No problems — thank you for checking my patch!

> I tried your patch, but the build fails for me
> because it goes "out of file descriptors" and "unix resources". Does it
> work for you?

It works for me, yes.

./pre-inst-env guix environment --ad-hoc openjdk@17:jdk -- java -version
…
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+0-adhoc..source)
OpenJDK 64-Bit Server VM (build 17.0.1+0-adhoc..source, mixed mode, sharing)

> I tried with various levels of parallelism, but it did not
> change anything.
>
> also about your patch, could you replace (invoke "chmod" "u+w" file)
> with a call to make-writable?

Do you mean `make-file-writable` ? I switched to that now.

> It's available by default in the build
> environment, it comes from (guix build utils). I wonder also why you
> inherit arguments from openjdk15 instead of openjdk16?

That was a mistake — thank you!

I attached a new patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-openjdk17-add-Java-17.0.1.patch --]
[-- Type: text/x-patch, Size: 3156 bytes --]

From 5d9d3e96163798fe9b8146f134e47311b4e0ac77 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Mon, 8 Nov 2021 21:21:41 +0100
Subject: [PATCH] gnu: openjdk17: add Java 17.0.1.

* gnu/packages/java.scm (openjdk17): 17.0.1

Thanks to Julien Lepiller for feedback!
---
 gnu/packages/java.scm | 48 +++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index da72dbb38c..b62d730fc4 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2566,6 +2566,42 @@ (define-public openjdk16
        ("zip" ,zip)))
     (arguments
      (substitute-keyword-arguments (package-arguments openjdk15)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'make-templates-writable
+             (lambda _
+               ;; The build system copies a few .template files from the
+               ;; source directory into the build directory and then modifies
+               ;; them in-place.  So these files have to be writable.
+               (for-each make-file-writable
+                (find-files "src/java.base/share/classes/jdk/internal/misc/"
+                            "\\.template$"))
+               #t))))))
+    (home-page "https://openjdk.java.net/projects/jdk/16")))
+
+(define-public openjdk17
+  (package
+    (inherit openjdk16)
+    (name "openjdk")
+    (version "17.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/openjdk/jdk17u")
+                    (commit (string-append "jdk-" version "-ga"))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1l1jgbz8q7zq66npfg88r0l5xga427vrz35iys09j44b6qllrldd"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("openjdk16:jdk" ,openjdk16 "jdk")
+       ("pkg-config" ,pkg-config)
+       ("unzip" ,unzip)
+       ("which" ,which)
+       ("zip" ,zip)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments openjdk16)
        ((#:phases phases)
         `(modify-phases ,phases
            (add-after 'unpack 'make-templates-writable
@@ -2578,8 +2614,16 @@ (define-public openjdk16
                   (invoke "chmod" "u+w" file))
                 (find-files "src/java.base/share/classes/jdk/internal/misc/"
                             "\\.template$"))
-               #t))))))
-    (home-page "https://openjdk.java.net/projects/jdk/16")))
+               #t))
+           (replace 'fix-java-shebangs
+             (lambda _
+               ;; This file was "fixed" by patch-source-shebangs, but it requires
+               ;; this exact first line.
+               (substitute* "make/data/blockedcertsconverter/blocked.certs.pem"
+                 (("^#!.*") "#! java BlockedCertsConverter SHA-256\n"))
+               #t))
+           ))))
+    (home-page "https://openjdk.java.net/projects/jdk/17")))
 
 (define-public icedtea icedtea-8)
 
-- 
2.33.1


[-- Attachment #1.3: Type: text/plain, Size: 103 bytes --]


Liebe Grüße,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

  reply	other threads:[~2021-11-14 22:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 20:32 bug#51693: [patch] Add Java 17 Dr. Arne Babenhauserheide
2021-11-14 15:54 ` Julien Lepiller
2021-11-14 20:59   ` Dr. Arne Babenhauserheide [this message]
2021-11-15 12:59     ` Julien Lepiller
2021-11-15 14:00       ` Dr. Arne Babenhauserheide
2021-12-02 22:58 ` Ricardo Wurmus
2021-12-03  7:49   ` Dr. Arne Babenhauserheide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgq61hmw.fsf@web.de \
    --to=arne_bab@web.de \
    --cc=51693@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).