From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:50571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go2Hz-0002YM-71 for guix-patches@gnu.org; Mon, 28 Jan 2019 03:29:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go2Hv-0004t7-OD for guix-patches@gnu.org; Mon, 28 Jan 2019 03:29:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48925) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1go2Hu-0004rm-H5 for guix-patches@gnu.org; Mon, 28 Jan 2019 03:29:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1go2Hu-0002x3-B6 for guix-patches@gnu.org; Mon, 28 Jan 2019 03:29:02 -0500 Subject: [bug#34230] [PATCH] gnu: Add openjdk 11. Resent-Message-ID: Date: Mon, 28 Jan 2019 09:28:18 +0100 In-Reply-To: <20190128075030.13331-1-boskovits@gmail.com> References: <20190128075030.13331-1-boskovits@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Julien Lepiller Message-ID: <62612899-118C-4B55-BFDC-C77E45E5F367@lepiller.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?G=C3=A1bor?= Boskovits , 34230@debbugs.gnu.org Le 28 janvier 2019 08:50:30 GMT+01:00, "G=C3=A1bor Boskovits" a =C3=A9crit : >* gnu/packages/java=2Escm (openjdk11): New variable=2E >--- > gnu/packages/java=2Escm | 225 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 225 insertions(+) > >diff --git a/gnu/packages/java=2Escm b/gnu/packages/java=2Escm >index 163c29627=2E=2Ea314dc995 100644 >--- a/gnu/packages/java=2Escm >+++ b/gnu/packages/java=2Escm >@@ -1860,6 +1860,231 @@ new Date();")) > ("which" ,which) > ("zip" ,zip))))) >=20 >+(define-public openjdk11 >+ (package >+ (name "openjdk") >+ (version "11=2E28") >+ (source (origin >+ (method url-fetch) >+ (uri >"http://hg=2Eopenjdk=2Ejava=2Enet/jdk/jdk/archive/76072a077ee1=2Etar=2Ebz= 2") >+ (file-name (string-append name "-" version "=2Etar=2Ebz2")= ) >+ (sha256 >+ (base32 >+ =20 >"0v705w1s9lrqalzahir78pk397rkk9gfvzq821yv8h3xha0bqi6w")) >+ (modules '((guix build utils))) >+ (snippet >+ `(begin >+ (for-each delete-file (find-files "=2E" "=2E*=2Ebin$"= )) >+ (for-each delete-file (find-files "=2E" "=2E*=2Eexe$"= )) >+ (for-each delete-file (find-files "=2E" "=2E*=2Ejar$"= )) >+ #t)))) >+ (build-system gnu-build-system) >+ (outputs '("out" "jdk" "doc")) >+ (arguments >+ `(#:imported-modules >+ ((guix build syscalls) >+ (ice-9 binary-ports) >+ (rnrs bytevectors) >+ ,@%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=3D" (number->string >(parallel-job-count)))) >+ #:configure-flags >+ `("--disable-option-checking" ; --enable-fast-install default >flag errors otherwise >+ "--disable-warnings-as-errors" >+ ;; make validate-runpath pass, see: >http://issues=2Eguix=2Einfo/issue/32894 >+ "--with-native-debug-symbols=3Dzipped" >+ ;; do not use the bundled libraries >+ "--with-giflib=3Dsystem" >+ "--with-lcms=3Dsystem" >+ "--with-libjpeg=3Dsystem" >+ "--with-libpng=3Dsystem" >+ ;; allow the build system to locate the system freetype >+ ,(string-append "--with-freetype-include=3D" >+ (assoc-ref %build-inputs "freetype") >"/include") >+ ,(string-append "--with-freetype-lib=3D" >+ (assoc-ref %build-inputs "freetype") "/lib")) >+ ;; TODO >+ #:phases >+ (modify-phases %standard-phases >+ (add-after 'patch-source-shebangs 'fix-java-shebangs >+ (lambda _ >+ ;; This file was "fixed" by patch-source-shebangs, but it >requires >+ ;; this exact first line=2E >+ (substitute* >"make/data/blacklistedcertsconverter/blacklisted=2Ecerts=2Epem" >+ (("^#!=2E*") "#! java BlacklistedCertsConverter >SHA-256\n")) >+ #t)) >+ (replace 'build >+ (lambda _ >+ (with-output-to-file "=2Esrc-rev" >+ (lambda _ >+ (display ,version))) >+ (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes") >+ (invoke "make" "all") >+ #t)) >+ ;; jdk 11 does not build jre by default any more >+ ;; building it anyways >+ ;; for further information see: >+ ;; https://github=2Ecom/AdoptOpenJDK/openjdk-build/issues/356 >+ (add-after 'build 'build-jre >+ (lambda _ >+ (invoke "make" "legacy-jre-image") >+ #t)) >+ (replace 'install >+ (lambda* (#:key outputs #:allow-other-keys) >+ (let ((out (assoc-ref outputs "out")) >+ (jdk (assoc-ref outputs "jdk")) >+ (doc (assoc-ref outputs "doc")) >+ (images (car (find-files "build" >"=2E*-server-release" >+ #:directories? #t)))) >+ (copy-recursively (string-append images "/images/jdk") >jdk) >+ (copy-recursively (string-append images "/images/jre") >out) >+ (copy-recursively (string-append images "/images/docs") >doc)) >+ #t)) >+ ;; Some of the libraries in the lib/ folder link to >libjvm=2Eso=2E >+ ;; But that shared object is located in the server/ folder, >so it >+ ;; cannot be found=2E This phase creates a symbolic link in >the >+ ;; lib/ folder so that the other libraries can find it=2E >+ ;; >+ ;; See: >+ ;; >https://lists=2Egnu=2Eorg/archive/html/guix-devel/2017-10/msg00169=2Ehtml >+ ;; >+ ;; FIXME: Find the bug in the build system, so that this >symlink is >+ ;; not needed=2E >+ (add-after 'install 'install-libjvm >+ (lambda* (#:key inputs outputs #:allow-other-keys) >+ (let* ((lib-out (string-append (assoc-ref outputs "out") >+ "/lib")) >+ (lib-jdk (string-append (assoc-ref outputs "jdk") >+ "/lib"))) >+ (symlink (string-append lib-jdk "/server/libjvm=2Eso") >+ (string-append lib-jdk "/libjvm=2Eso")) >+ (symlink (string-append lib-out "/server/libjvm=2Eso") >+ (string-append lib-out "/libjvm=2Eso"))) >+ #t)) >+ (add-after 'install 'strip-character-data-timestamps >+ (lambda* (#:key outputs #:allow-other-keys) >+ (use-modules (guix build syscalls)) >+ (let ((archive (string-append >+ (assoc-ref outputs "jdk") >"/lib/src=2Ezip")) >+ (dir (mkdtemp! "zip-contents=2EXXXXXX"))) >+ (with-directory-excursion dir >+ (invoke "unzip" archive)) >+ (delete-file archive) >+ (with-directory-excursion dir >+ (let ((char-data-files (find-files "=2E" >"CharacterData=2E*"))) >+ (for-each (lambda (file) >+ (substitute* file >+ (((string-append "This file was >generated " >+ "AUTOMATICALLY from a >template " >+ "file=2E*")) >+ (string-append "This file was >generated " >+ "AUTOMATICALLY from a >template " >+ "file")))) >+ char-data-files))) >+ (with-directory-excursion dir >+ (let ((files (find-files "=2E" "=2E*" #:directories? >#t))) >+ (apply invoke "zip" "-0" "-X" archive files)))))) >+ (add-after 'strip-character-data-timestamps >'strip-archive-timestamps >+ (lambda* (#:key outputs #:allow-other-keys) >+ (use-modules (guix build syscalls) >+ (ice-9 binary-ports) >+ (rnrs bytevectors)) >+ (letrec ((repack-archive >+ (lambda (archive) >+ (let ((dir (mkdtemp! "zip-contents=2EXXXXXX"))) >+ (with-directory-excursion dir >+ (invoke "unzip" archive)) >+ (delete-file archive) >+ (for-each (compose repack-archive >canonicalize-path) >+ (find-files dir "(ct=2Esym|=2E*=2Ejar)= $")) >+ (let ((reset-file-timestamp >+ (lambda (file) >+ (let ((s (lstat file))) >+ (unless (eq? (stat:type s) >'symlink) >+ (format #t "reset ~a~%" file) >+ (utime file 0 0 0 0)))))) >+ (for-each reset-file-timestamp >+ (find-files dir #:directories? >#t))) >+ (with-directory-excursion dir >+ (let ((files (find-files "=2E" "=2E*" >#:directories? #t))) >+ (apply invoke "zip" "-0" "-X" archive >files))))))) >+ (for-each repack-archive >+ (find-files (assoc-ref outputs "doc") >"=2E*=2Ezip$")) >+ (for-each repack-archive >+ (find-files (assoc-ref outputs "jdk") >+ "=2E*=2E(zip|jar|diz)$")) >+ (repack-archive (string-append (assoc-ref outputs >"jdk") "/lib/ct=2Esym")) >+ (let ((repack-jmod >+ (lambda (file-name) >+ (call-with-input-file file-name >+ (lambda (file) >+ (let ((header #vu8(#x4a #x4d #x01 #x00))) >+ (if (equal? (get-bytevector-n >+ file (bytevector-length >header)) >+ header) >+ (let* ((header-length >(bytevector-length header)) >+ (temp-file (mkstemp! >+ (string-copy >+ =20 >"temp-file=2EXXXXXX"))) >+ (temp-filename (port-filename >temp-file)) >+ (content-length >+ (- (stat:size (stat file)) >+ header-length))) >+ (sendfile temp-file file content-length >header-length) >+ (delete-file file-name) >+ (close-port temp-file) >+ (repack-archive (canonicalize-path >temp-filename)) >+ (call-with-output-file file-name >+ (lambda (file) >+ (put-bytevector file header) >+ (call-with-input-file temp-filename >+ (lambda (temp-file) >+ (sendfile >+ file temp-file >+ (stat:size (stat temp-file)) >0))))))))))))) >+ (for-each repack-jmod >+ (find-files (assoc-ref outputs "jdk") >"=2E*=2Ejmod$"))) >+ #t))) >+ (add-after 'install 'remove-timestamp-from-api-summary >+ (lambda* (#:key outputs #:allow-other-keys) >+ (substitute* (string-append (assoc-ref outputs "doc") >+ "/api/overview-summary=2Ehtml") >+ (("Generated by javadoc \\(11-internal\\)=2E*$") >+ "Generated by javadoc (11-internal) -->\n")) >+ #t))))) >+ (inputs >+ `(("alsa-lib" ,alsa-lib) >+ ("cups" ,cups) >+ ("fontconfig" ,fontconfig) >+ ("freetype" ,freetype) >+ ("giflib" ,giflib) >+ ("lcms" ,lcms) >+ ("libjpeg" ,libjpeg) >+ ("libpng" ,libpng) >+ ("libx11" ,libx11) >+ ("libxext" ,libxext) >+ ("libxrender" ,libxrender) >+ ("libxt" ,libxt) >+ ("libxtst" ,libxtst))) >+ (native-inputs >+ `(("autoconf" ,autoconf) >+ ("openjdk10" ,openjdk10) >+ ("openjdk10:jdk" ,openjdk10 "jdk") >+ ("pkg-config" ,pkg-config) >+ ("unzip" ,unzip) >+ ("which" ,which) >+ ("zip" ,zip))) >+ (home-page "https://openjdk=2Ejava=2Enet/projects/jdk/11/") >+ (synopsis "Java development kit") >+ (description >+ "This package provides the Java development kit OpenJDK=2E") >+ (license license:gpl2+))) >+ > (define-public icedtea icedtea-8) >=20 > =0C> Great job! I didn't test it yet, is it reproducible? If so you're wonderfu= l! If not, you're still fine :p