gnu: Add rawdog.
[jackhill/guix/guix.git] / gnu / packages / java.scm
index e2f79c3..c0ec683 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016, 2017 Roel Janssen <roel@gnu.org>
 ;;; Copyright © 2017, 2019 Carlo Zancanaro <carlo@zancanaro.id.au>
@@ -1808,14 +1808,14 @@ new Date();"))
               (modules '((guix build utils)))
               (snippet
                 `(begin
-                   (for-each delete-file (find-files "." ".*.bin$"))
-                   (for-each delete-file (find-files "." ".*.exe$"))
-                   (for-each delete-file (find-files "." ".*.jar$"))
+                   (for-each delete-file
+                             (find-files "." ".*.(bin|exe|jar)$"))
                    #t))))
     (build-system gnu-build-system)
     (outputs '("out" "jdk" "doc"))
     (arguments
      `(#:tests? #f; require jtreg
+       #:make-flags '("all")
        #:imported-modules
        ((guix build syscalls)
         ,@%gnu-build-system-modules)
@@ -1840,14 +1840,20 @@ new Date();"))
                      "--with-libjpeg=system"
                      (string-append "--prefix=" (assoc-ref outputs "out")))
              #t))
-         (replace 'build
+         (add-before 'build 'write-source-revision-file
            (lambda _
              (with-output-to-file ".src-rev"
                (lambda _
                  (display ,version)))
-             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
-             (invoke "make" "all")
              #t))
+         (replace 'build
+           (lambda* (#:key make-flags parallel-build? #:allow-other-keys)
+             (apply invoke "make"
+                    `(,@(if parallel-build?
+                            (list (string-append "JOBS="
+                                                 (number->string (parallel-job-count))))
+                            '())
+                      ,@make-flags))))
          ;; Some of the libraries in the lib/ folder link to libjvm.so.
          ;; But that shared object is located in the server/ folder, so it
          ;; cannot be found.  This phase creates a symbolic link in the
@@ -1920,8 +1926,7 @@ new Date();"))
     (native-inputs
      `(("icedtea-8" ,icedtea-8)
        ("icedtea-8:jdk" ,icedtea-8 "jdk")
-       ;; XXX: The build system is not particularly parallel safe and
-       ;; fails with newer versions of GNU Make.
+       ;; XXX: The build system fails with newer versions of GNU Make.
        ("make@4.2" ,gnu-make-4.2)
        ("unzip" ,unzip)
        ("which" ,which)
@@ -1949,9 +1954,7 @@ new Date();"))
               (modules '((guix build utils)))
               (snippet
                 `(begin
-                   (for-each delete-file (find-files "." ".*.bin$"))
-                   (for-each delete-file (find-files "." ".*.exe$"))
-                   (for-each delete-file (find-files "." ".*.jar$"))
+                   (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
                    #t))))
     (arguments
       (substitute-keyword-arguments (package-arguments openjdk9)
@@ -1998,9 +2001,7 @@ new Date();"))
               (modules '((guix build utils)))
               (snippet
                 `(begin
-                   (for-each delete-file (find-files "." ".*.bin$"))
-                   (for-each delete-file (find-files "." ".*.exe$"))
-                   (for-each delete-file (find-files "." ".*.jar$"))
+                   (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
                    #t))))
     (build-system gnu-build-system)
     (outputs '("out" "jdk" "doc"))
@@ -2012,11 +2013,6 @@ new Date();"))
         ,@%gnu-build-system-modules)
        #:tests? #f; requires jtreg
        ;; TODO package jtreg
-       ;; disable parallel builds, as the openjdk build system does not like -j
-       #:parallel-build? #f
-       #:parallel-tests? #f
-       ;; reenable parallel builds and tests by adding the flags manually
-       #:make-flags (list (string-append "JOBS=" (number->string (parallel-job-count))))
        #:configure-flags
        `("--disable-option-checking" ; --enable-fast-install default flag errors otherwise
          "--disable-warnings-as-errors"
@@ -2033,7 +2029,6 @@ new Date();"))
                          (assoc-ref %build-inputs "freetype") "/include")
          ,(string-append "--with-freetype-lib="
                          (assoc-ref %build-inputs "freetype") "/lib"))
-       ;; TODO
        #:phases
        (modify-phases %standard-phases
          (add-after 'patch-source-shebangs 'fix-java-shebangs
@@ -2043,22 +2038,32 @@ new Date();"))
              (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem"
                (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n"))
              #t))
-         (replace 'build
+         (add-before 'build 'write-source-revision-file
            (lambda _
              (with-output-to-file ".src-rev"
                (lambda _
                  (display ,version)))
-             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
-             (invoke "make" "all")
              #t))
+         (replace 'build
+           (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
+             (apply invoke "make" "all"
+                    `(,@(if parallel-build?
+                            (list (string-append "JOBS="
+                                                 (number->string (parallel-job-count))))
+                            '())
+                      ,@make-flags))))
          ;; jdk 11 does not build jre by default any more
          ;; building it anyways
          ;; for further information see:
          ;; https://github.com/AdoptOpenJDK/openjdk-build/issues/356
          (add-after 'build 'build-jre
-           (lambda _
-             (invoke "make" "legacy-jre-image")
-             #t))
+           (lambda* (#:key parallel-build? make-flags #:allow-other-keys)
+             (apply invoke "make" "legacy-jre-image"
+                    `(,@(if parallel-build?
+                            (list (string-append "JOBS="
+                                                 (number->string (parallel-job-count))))
+                            '())
+                      ,@make-flags))))
          (replace 'install
            (lambda* (#:key outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))
@@ -2226,9 +2231,7 @@ new Date();"))
               (modules '((guix build utils)))
               (snippet
                `(begin
-                  (for-each delete-file (find-files "." ".*.bin$"))
-                  (for-each delete-file (find-files "." ".*.exe$"))
-                  (for-each delete-file (find-files "." ".*.jar$"))
+                  (for-each delete-file (find-files "." ".*.(bin|exe|jar)$"))
                   #t))))
     (inputs
      `(("alsa-lib" ,alsa-lib)