summaryrefslogtreecommitdiff
path: root/gnu/packages/java.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-02-17 17:47:38 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-02-25 09:46:06 +0900
commit9888260728af11433bbcaa3bbf2938cd47068af9 (patch)
tree8eff1d451bb222fc62f1c325c16ff0d3fabef3c8 /gnu/packages/java.scm
parentc5a5c27a90a9daf028a0d2abafe0e120050c6f6e (diff)
gnu: openjdk11: Small cleanup.
* gnu/packages/java.scm (openjdk11) [#:phases] {write-source-revision-file}: Capture version in an inheritance compatible way. {patch-jni-libs}: Remove extraneous 'remove' import. {strip-character-data-timestamps}: Re-order after... {remove-extraneous-files}: ... this phase. {strip-character-data-timestamps}: Delete phase. {build, build-jre}: Streamline. Change-Id: Ic2210f02d7133a0d440b8d83f289b17f1cb59f17
Diffstat (limited to 'gnu/packages/java.scm')
-rw-r--r--gnu/packages/java.scm48
1 files changed, 11 insertions, 37 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index c44bb9629ee..ddf141564f5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -1386,9 +1386,6 @@ new Date();"))))
1386 (add-after 'unpack 'patch-jni-libs 1386 (add-after 'unpack 'patch-jni-libs
1387 ;; Hardcode dynamically loaded libraries. 1387 ;; Hardcode dynamically loaded libraries.
1388 (lambda _ 1388 (lambda _
1389 (define remove
1390 (@ (srfi srfi-1) remove))
1391
1392 (define (icedtea-or-openjdk? path) 1389 (define (icedtea-or-openjdk? path)
1393 (or (string-contains path "openjdk") 1390 (or (string-contains path "openjdk")
1394 (string-contains path "icedtea"))) 1391 (string-contains path "icedtea")))
@@ -1421,26 +1418,24 @@ new Date();"))))
1421 (lambda _ 1418 (lambda _
1422 (with-output-to-file ".src-rev" 1419 (with-output-to-file ".src-rev"
1423 (lambda _ 1420 (lambda _
1424 (display #$version))))) 1421 (display #$(package-version this-package))))))
1425 (replace 'build 1422 (replace 'build
1426 (lambda* (#:key parallel-build? make-flags #:allow-other-keys) 1423 (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
1427 (apply invoke "make" "all" 1424 (apply invoke "make" "all"
1428 `(,@(if parallel-build? 1425 (format #f "JOBS=~a" (if parallel-build?
1429 (list (string-append "JOBS=" 1426 (parallel-job-count)
1430 (number->string (parallel-job-count)))) 1427 1))
1431 '("JOBS=1")) 1428 make-flags)))
1432 ,@make-flags))))
1433 ;; jdk 11 does not build jre by default any more; so explicitly build 1429 ;; jdk 11 does not build jre by default any more; so explicitly build
1434 ;; it (see: 1430 ;; it (see:
1435 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356). 1431 ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356).
1436 (add-after 'build 'build-jre 1432 (add-after 'build 'build-jre
1437 (lambda* (#:key parallel-build? make-flags #:allow-other-keys) 1433 (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
1438 (apply invoke "make" "legacy-jre-image" 1434 (apply invoke "make" "legacy-jre-image"
1439 `(,@(if parallel-build? 1435 (format #f "JOBS=~a" (if parallel-build?
1440 (list (string-append "JOBS=" 1436 (parallel-job-count)
1441 (number->string (parallel-job-count)))) 1437 1))
1442 '("JOBS=1")) 1438 make-flags)))
1443 ,@make-flags))))
1444 (replace 'install 1439 (replace 'install
1445 (lambda _ 1440 (lambda _
1446 (let ((images (car (find-files "build" "-server-release" 1441 (let ((images (car (find-files "build" "-server-release"
@@ -1469,28 +1464,7 @@ new Date();"))))
1469 (string-append lib-jdk "/libjvm.so")) 1464 (string-append lib-jdk "/libjvm.so"))
1470 (symlink (string-append lib-out "/server/libjvm.so") 1465 (symlink (string-append lib-out "/server/libjvm.so")
1471 (string-append lib-out "/libjvm.so"))))) 1466 (string-append lib-out "/libjvm.so")))))
1472 (add-after 'install 'strip-character-data-timestamps 1467 (add-after 'install 'remove-extraneous-files
1473 (lambda _
1474 (let ((archive (string-append #$output:jdk "/lib/src.zip"))
1475 (dir (mkdtemp "zip-contents.XXXXXX")))
1476 (with-directory-excursion dir
1477 (invoke "unzip" archive))
1478 (delete-file archive)
1479 (with-directory-excursion dir
1480 (let ((char-data-files (find-files "." "CharacterData")))
1481 (for-each (lambda (file)
1482 (substitute* file
1483 (((string-append "This file was generated "
1484 "AUTOMATICALLY from a template "
1485 "file.*"))
1486 (string-append "This file was generated "
1487 "AUTOMATICALLY from a template "
1488 "file"))))
1489 char-data-files)))
1490 (with-directory-excursion dir
1491 (let ((files (find-files "." #:directories? #t)))
1492 (apply invoke "zip" "-0" "-X" archive files))))))
1493 (add-after 'strip-character-data-timestamps 'remove-extraneous-files
1494 (lambda* (#:key outputs #:allow-other-keys) 1468 (lambda* (#:key outputs #:allow-other-keys)
1495 ;; Remove the *.diz and src.zip files for space considerations. 1469 ;; Remove the *.diz and src.zip files for space considerations.
1496 ;; The former are compressed debuginfo files not typically 1470 ;; The former are compressed debuginfo files not typically