From 79f6fc0d9950eb96ffeea4150b1822e759efa0b7 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 26 Dec 2018 17:40:47 +0100 Subject: gnu: antlr2: Fix reproducibility. * gnu/packages/java.scm (antlr2)[arguments]: Add a phase to fix a timestamp issue. --- gnu/packages/java.scm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 054ad67731..c607cbbcc5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -6140,6 +6140,11 @@ (define-public antlr2 (modify-phases %standard-phases (add-after 'install 'strip-jar-timestamps (assoc-ref ant:%standard-phases 'strip-jar-timestamps)) + (add-before 'configure 'fix-timestamp + (lambda _ + (substitute* "configure" + (("^TIMESTAMP.*") "TIMESTAMP=19700101\n")) + #t)) (add-after 'configure 'fix-bin-ls (lambda _ (substitute* (find-files "." "Makefile") -- cgit v1.2.3 From 24155bf40db2dfd25c167f41452ea0227a712654 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Thu, 10 Jan 2019 14:55:50 +0100 Subject: gnu: Move Java compression packages to new module. * gnu/packages/compression.scm (bitshuffle-for-snappy): Export variable. (java-snappy, java-snappy-1, java-iq80-snappy, java-jbzip2, java-tukaani-xz): Move these variables from here... * gnu/packages/java-compression.scm: ...to this new file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * gnu/packages/java.scm, gnu/packages/bioinformatics.scm: Adjust module references. --- gnu/local.mk | 1 + gnu/packages/bioinformatics.scm | 1 + gnu/packages/compression.scm | 280 +--------------------------------- gnu/packages/java-compression.scm | 308 ++++++++++++++++++++++++++++++++++++++ gnu/packages/java.scm | 1 + 5 files changed, 312 insertions(+), 279 deletions(-) create mode 100644 gnu/packages/java-compression.scm (limited to 'gnu/packages/java.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 306cfa3a62..7eb4366af2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -241,6 +241,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/irc.scm \ %D%/packages/iso-codes.scm \ %D%/packages/java.scm \ + %D%/packages/java-compression.scm \ %D%/packages/javascript.scm \ %D%/packages/jemalloc.scm \ %D%/packages/jrnl.scm \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 433d322b08..2ecc782324 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -78,6 +78,7 @@ (define-module (gnu packages bioinformatics) #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) #:use-module (gnu packages java) + #:use-module (gnu packages java-compression) #:use-module (gnu packages jemalloc) #:use-module (gnu packages dlang) #:use-module (gnu packages linux) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index b2b4488683..029d11ef21 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -45,7 +45,6 @@ (define-module (gnu packages compression) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) - #:use-module (guix build-system ant) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system perl) @@ -59,7 +58,6 @@ (define-module (gnu packages compression) #:use-module (gnu packages check) #:use-module (gnu packages curl) #:use-module (gnu packages file) - #:use-module (gnu packages java) #:use-module (gnu packages maths) #:use-module (gnu packages perl) #:use-module (gnu packages perl-check) @@ -1265,7 +1263,7 @@ (define-public snappy 100% bigger.") (license license:asl2.0))) -(define bitshuffle-for-snappy +(define-public bitshuffle-for-snappy (package (inherit bitshuffle) (name "bitshuffle-for-snappy") @@ -1302,245 +1300,6 @@ (define bitshuffle-for-snappy (inputs '()) (native-inputs '()))) -(define-public java-snappy - (package - (name "java-snappy") - (version "1.1.7.2") - (source (origin - (method url-fetch) - (uri (string-append "https://github.com/xerial/snappy-java/archive/" - version ".tar.gz")) - (file-name (string-append name "-" version ".tar.gz")) - (sha256 - (base32 - "1p557vdv006ysgxbpp83krmq0066k46108vyiyka69w8i4i8rbbm")))) - (build-system ant-build-system) - (arguments - `(#:jar-name "snappy.jar" - #:source-dir "src/main/java" - #:phases - (modify-phases %standard-phases - (add-before 'build 'remove-binaries - (lambda _ - (delete-file "lib/org/xerial/snappy/OSInfo.class") - (delete-file-recursively "src/main/resources/org/xerial/snappy/native") - #t)) - (add-before 'build 'build-jni - (lambda _ - ;; Rebuild one of the binaries we removed earlier - (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java" - "-d" "lib") - ;; Link to the dynamic bitshuffle and snappy, not the static ones - (substitute* "Makefile.common" - (("-shared") - "-shared -lbitshuffle -lsnappy")) - (substitute* "Makefile" - ;; Don't try to use git, don't download bitshuffle source - ;; and don't build it. - (("\\$\\(SNAPPY_GIT_UNPACKED\\) ") - "") - ((": \\$\\(SNAPPY_GIT_UNPACKED\\)") - ":") - (("\\$\\(BITSHUFFLE_UNPACKED\\) ") - "") - ((": \\$\\(SNAPPY_SOURCE_CONFIGURED\\)") ":") - ;; What we actually want to build - (("SNAPPY_OBJ:=.*") - "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, \ - SnappyNative.o BitShuffleNative.o)\n") - ;; Since we removed the directory structure in "native" during - ;; the previous phase, we need to recreate it. - (("NAME\\): \\$\\(SNAPPY_OBJ\\)") - "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)")) - ;; Finally we can run the Makefile to build the dynamic library. - ;; Use the -nocmake target to avoid a dependency on cmake, - ;; which in turn requires the "git_unpacked" directory. - (invoke "make" "native-nocmake"))) - ;; Once we have built the shared library, we need to place it in the - ;; "build" directory so it can be added to the jar file. - (add-after 'build-jni 'copy-jni - (lambda _ - (copy-recursively "src/main/resources/org/xerial/snappy/native" - "build/classes/org/xerial/snappy/native") - #t)) - (add-before 'check 'fix-failing - (lambda _ - (with-directory-excursion "src/test/java/org/xerial/snappy" - ;; This package assumes maven build, which puts results in "target". - ;; We put them in "build" instead, so fix that. - (substitute* "SnappyLoaderTest.java" - (("target/classes") "build/classes")) - ;; This requires Hadoop, which is not in Guix yet. - (delete-file "SnappyHadoopCompatibleOutputStreamTest.java")) - #t))))) - (inputs - `(("osgi-framework" ,java-osgi-framework))) - (propagated-inputs - `(("bitshuffle" ,bitshuffle-for-snappy) - ("snappy" ,snappy))) - (native-inputs - `(("junit" ,java-junit) - ("hamcrest" ,java-hamcrest-core) - ("xerial-core" ,java-xerial-core) - ("classworlds" ,java-plexus-classworlds) - ("commons-lang" ,java-commons-lang) - ("commons-io" ,java-commons-io) - ("perl" ,perl))) - (home-page "https://github.com/xerial/snappy-java") - (synopsis "Compression/decompression algorithm in Java") - (description "Snappy-java is a Java port of snappy, a fast C++ -compressor/decompressor.") - (license license:asl2.0))) - -(define-public java-snappy-1 - (package - (inherit java-snappy) - (version "1.0.3-rc3") - (source (origin - (method url-fetch) - (uri (string-append "https://github.com/xerial/snappy-java/archive/" - "snappy-java-" version ".tar.gz")) - (sha256 - (base32 - "08hsxlqidiqck0q57fshwyv3ynyxy18vmhrai9fyc8mz17m7gsa3")))) - (arguments - `(#:jar-name "snappy.jar" - #:source-dir "src/main/java" - #:phases - (modify-phases %standard-phases - (add-before 'build 'remove-binaries - (lambda _ - (delete-file "lib/org/xerial/snappy/OSInfo.class") - (delete-file-recursively "src/main/resources/org/xerial/snappy/native") - #t)) - (add-before 'build 'build-jni - (lambda _ - ;; Rebuild one of the binaries we removed earlier - (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java" - "-d" "lib") - ;; Link to the dynamic snappy, not the static ones - (substitute* "Makefile.common" - (("-shared") "-shared -lsnappy")) - (substitute* "Makefile" - ;; Don't download the sources here. - (("\\$\\(SNAPPY_UNPACKED\\) ") "") - ((": \\$\\(SNAPPY_UNPACKED\\) ") ":") - ;; What we actually want to build - (("SNAPPY_OBJ:=.*") - "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, SnappyNative.o)\n") - ;; Since we removed the directory structure in "native" during - ;; the previous phase, we need to recreate it. - (("NAME\\): \\$\\(SNAPPY_OBJ\\)") - "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)")) - ;; Finally we can run the Makefile to build the dynamic library. - (invoke "make" "native"))) - ;; Once we have built the shared library, we need to place it in the - ;; "build" directory so it can be added to the jar file. - (add-after 'build-jni 'copy-jni - (lambda _ - (copy-recursively "src/main/resources/org/xerial/snappy/native" - "build/classes/org/xerial/snappy/native") - #t)) - (add-before 'check 'fix-tests - (lambda _ - (mkdir-p "src/test/resources/org/xerial/snappy/") - (copy-recursively "src/test/java/org/xerial/snappy/testdata" - "src/test/resources/org/xerial/snappy/testdata") - (install-file "src/test/java/org/xerial/snappy/alice29.txt" - "src/test/resources/org/xerial/snappy/") - #t))))))) - -(define-public java-iq80-snappy - (package - (name "java-iq80-snappy") - (version "0.4") - (source (origin - (method url-fetch) - (uri (string-append "https://github.com/dain/snappy/archive/snappy-" - version ".tar.gz")) - (sha256 - (base32 - "0rb3zhci7w9wzd65lfnk7p3ip0n6gb58a9qpx8n7r0231gahyamf")))) - (build-system ant-build-system) - (arguments - `(#:jar-name "iq80-snappy.jar" - #:source-dir "src/main/java" - #:test-dir "src/test" - #:jdk ,icedtea-8 - #:phases - (modify-phases %standard-phases - (replace 'check - (lambda _ - (define (test class) - (invoke "java" "-cp" (string-append (getenv "CLASSPATH") - ":build/classes" - ":build/test-classes") - "-Dtest.resources.dir=src/test/resources" - "org.testng.TestNG" "-testclass" - class)) - (invoke "ant" "compile-tests") - (test "org.iq80.snappy.SnappyFramedStreamTest") - (test "org.iq80.snappy.SnappyStreamTest") - #t)) - (add-before 'build 'remove-hadoop-dependency - (lambda _ - ;; We don't have hadoop - (delete-file "src/main/java/org/iq80/snappy/HadoopSnappyCodec.java") - (delete-file "src/test/java/org/iq80/snappy/TestHadoopSnappyCodec.java") - #t))))) - (home-page "https://github.com/dain/snappy") - (native-inputs - `(("guava" ,java-guava) - ("java-snappy" ,java-snappy) - ("hamcrest" ,java-hamcrest-core) - ("testng" ,java-testng))) - (synopsis "Java port of the Snappy (de)compressor") - (description - "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten -in pure Java. This compression code produces a byte-for-byte exact copy of the -output created by the original C++ code, and is extremely fast.") - (license license:asl2.0))) - -(define-public java-jbzip2 - (package - (name "java-jbzip2") - (version "0.9.1") - (source (origin - (method url-fetch) - (uri (string-append "https://storage.googleapis.com/" - "google-code-archive-source/v2/" - "code.google.com/jbzip2/" - "source-archive.zip")) - (file-name (string-append name "-" version ".zip")) - (sha256 - (base32 - "0ncmhlqmrfmj96nqf6p77b9ws35lcfsvpfxzwxi2asissc83z1l3")))) - (build-system ant-build-system) - (native-inputs - `(("unzip" ,unzip) - ("java-junit" ,java-junit))) - (arguments - `(#:tests? #f ; no tests - #:jar-name "jbzip2.jar" - #:source-dir "tags/release-0.9.1/src" - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-encoding-problems - (lambda _ - ;; Some of the files we're patching are - ;; ISO-8859-1-encoded, so choose it as the default - ;; encoding so the byte encoding is preserved. - (with-fluids ((%default-port-encoding #f)) - (substitute* "tags/release-0.9.1/src/org/itadaki/bzip2/HuffmanAllocator.java" - (("Milidi.") "Milidiu"))) - #t))))) - (home-page "https://code.google.com/archive/p/jbzip2/") - (synopsis "Java bzip2 compression/decompression library") - (description "Jbzip2 is a Java bzip2 compression/decompression library. -It can be used as a replacement for the Apache @code{CBZip2InputStream} / -@code{CBZip2OutputStream} classes.") - (license license:expat))) - (define-public p7zip (package (name "p7zip") @@ -2099,43 +1858,6 @@ (define-public perl-archive-extract type by using either Perl modules, or command-line tools on your system.") (license license:perl-license))) -(define-public java-tukaani-xz - (package - (name "java-tukaani-xz") - (version "1.6") - (source (origin - (method url-fetch) - (uri (string-append "https://tukaani.org/xz/xz-java-" version ".zip")) - (sha256 - (base32 - "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x")))) - (build-system ant-build-system) - (arguments - `(#:tests? #f; no tests - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'chdir - (lambda _ - ;; Our build system enters the first directory in the archive, but - ;; the package is not contained in a subdirectory - (chdir "..") - #t)) - (replace 'install - (lambda* (#:key outputs #:allow-other-keys) - ;; Do we want to install *Demo.jar? - (install-file "build/jar/xz.jar" - (string-append - (assoc-ref outputs "out") - "/share/java/xz.jar")) - #t))))) - (native-inputs - `(("unzip" ,unzip))) - (home-page "https://tukaani.org") - (synopsis "XZ in Java") - (description "Tukaani-xz is an implementation of xz compression/decompression -algorithms in Java.") - (license license:public-domain))) - (define-public lunzip (package (name "lunzip") diff --git a/gnu/packages/java-compression.scm b/gnu/packages/java-compression.scm new file mode 100644 index 0000000000..8cebfc65a5 --- /dev/null +++ b/gnu/packages/java-compression.scm @@ -0,0 +1,308 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017, 2019 Ricardo Wurmus +;;; Copyright © 2017, 2018 Julien Lepiller +;;; Copyright © 2018 Marius Bakke +;;; Copyright © 2018 Mark H Weaver +;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages java-compression) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system ant) + #:use-module (gnu packages) + #:use-module (gnu packages compression) + #:use-module (gnu packages java) + #:use-module (gnu packages perl)) + +(define-public java-snappy + (package + (name "java-snappy") + (version "1.1.7.2") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/xerial/snappy-java/archive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1p557vdv006ysgxbpp83krmq0066k46108vyiyka69w8i4i8rbbm")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "snappy.jar" + #:source-dir "src/main/java" + #:phases + (modify-phases %standard-phases + (add-before 'build 'remove-binaries + (lambda _ + (delete-file "lib/org/xerial/snappy/OSInfo.class") + (delete-file-recursively "src/main/resources/org/xerial/snappy/native") + #t)) + (add-before 'build 'build-jni + (lambda _ + ;; Rebuild one of the binaries we removed earlier + (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java" + "-d" "lib") + ;; Link to the dynamic bitshuffle and snappy, not the static ones + (substitute* "Makefile.common" + (("-shared") + "-shared -lbitshuffle -lsnappy")) + (substitute* "Makefile" + ;; Don't try to use git, don't download bitshuffle source + ;; and don't build it. + (("\\$\\(SNAPPY_GIT_UNPACKED\\) ") + "") + ((": \\$\\(SNAPPY_GIT_UNPACKED\\)") + ":") + (("\\$\\(BITSHUFFLE_UNPACKED\\) ") + "") + ((": \\$\\(SNAPPY_SOURCE_CONFIGURED\\)") ":") + ;; What we actually want to build + (("SNAPPY_OBJ:=.*") + "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, \ + SnappyNative.o BitShuffleNative.o)\n") + ;; Since we removed the directory structure in "native" during + ;; the previous phase, we need to recreate it. + (("NAME\\): \\$\\(SNAPPY_OBJ\\)") + "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)")) + ;; Finally we can run the Makefile to build the dynamic library. + ;; Use the -nocmake target to avoid a dependency on cmake, + ;; which in turn requires the "git_unpacked" directory. + (invoke "make" "native-nocmake"))) + ;; Once we have built the shared library, we need to place it in the + ;; "build" directory so it can be added to the jar file. + (add-after 'build-jni 'copy-jni + (lambda _ + (copy-recursively "src/main/resources/org/xerial/snappy/native" + "build/classes/org/xerial/snappy/native") + #t)) + (add-before 'check 'fix-failing + (lambda _ + (with-directory-excursion "src/test/java/org/xerial/snappy" + ;; This package assumes maven build, which puts results in "target". + ;; We put them in "build" instead, so fix that. + (substitute* "SnappyLoaderTest.java" + (("target/classes") "build/classes")) + ;; This requires Hadoop, which is not in Guix yet. + (delete-file "SnappyHadoopCompatibleOutputStreamTest.java")) + #t))))) + (inputs + `(("osgi-framework" ,java-osgi-framework))) + (propagated-inputs + `(("bitshuffle" ,bitshuffle-for-snappy) + ("snappy" ,snappy))) + (native-inputs + `(("junit" ,java-junit) + ("hamcrest" ,java-hamcrest-core) + ("xerial-core" ,java-xerial-core) + ("classworlds" ,java-plexus-classworlds) + ("commons-lang" ,java-commons-lang) + ("commons-io" ,java-commons-io) + ("perl" ,perl))) + (home-page "https://github.com/xerial/snappy-java") + (synopsis "Compression/decompression algorithm in Java") + (description "Snappy-java is a Java port of snappy, a fast C++ +compressor/decompressor.") + (license license:asl2.0))) + +(define-public java-snappy-1 + (package + (inherit java-snappy) + (version "1.0.3-rc3") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/xerial/snappy-java/archive/" + "snappy-java-" version ".tar.gz")) + (sha256 + (base32 + "08hsxlqidiqck0q57fshwyv3ynyxy18vmhrai9fyc8mz17m7gsa3")))) + (arguments + `(#:jar-name "snappy.jar" + #:source-dir "src/main/java" + #:phases + (modify-phases %standard-phases + (add-before 'build 'remove-binaries + (lambda _ + (delete-file "lib/org/xerial/snappy/OSInfo.class") + (delete-file-recursively "src/main/resources/org/xerial/snappy/native") + #t)) + (add-before 'build 'build-jni + (lambda _ + ;; Rebuild one of the binaries we removed earlier + (invoke "javac" "src/main/java/org/xerial/snappy/OSInfo.java" + "-d" "lib") + ;; Link to the dynamic snappy, not the static ones + (substitute* "Makefile.common" + (("-shared") "-shared -lsnappy")) + (substitute* "Makefile" + ;; Don't download the sources here. + (("\\$\\(SNAPPY_UNPACKED\\) ") "") + ((": \\$\\(SNAPPY_UNPACKED\\) ") ":") + ;; What we actually want to build + (("SNAPPY_OBJ:=.*") + "SNAPPY_OBJ:=$(addprefix $(SNAPPY_OUT)/, SnappyNative.o)\n") + ;; Since we removed the directory structure in "native" during + ;; the previous phase, we need to recreate it. + (("NAME\\): \\$\\(SNAPPY_OBJ\\)") + "NAME): $(SNAPPY_OBJ)\n\t@mkdir -p $(@D)")) + ;; Finally we can run the Makefile to build the dynamic library. + (invoke "make" "native"))) + ;; Once we have built the shared library, we need to place it in the + ;; "build" directory so it can be added to the jar file. + (add-after 'build-jni 'copy-jni + (lambda _ + (copy-recursively "src/main/resources/org/xerial/snappy/native" + "build/classes/org/xerial/snappy/native") + #t)) + (add-before 'check 'fix-tests + (lambda _ + (mkdir-p "src/test/resources/org/xerial/snappy/") + (copy-recursively "src/test/java/org/xerial/snappy/testdata" + "src/test/resources/org/xerial/snappy/testdata") + (install-file "src/test/java/org/xerial/snappy/alice29.txt" + "src/test/resources/org/xerial/snappy/") + #t))))))) + +(define-public java-iq80-snappy + (package + (name "java-iq80-snappy") + (version "0.4") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/dain/snappy/archive/snappy-" + version ".tar.gz")) + (sha256 + (base32 + "0rb3zhci7w9wzd65lfnk7p3ip0n6gb58a9qpx8n7r0231gahyamf")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "iq80-snappy.jar" + #:source-dir "src/main/java" + #:test-dir "src/test" + #:jdk ,icedtea-8 + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (define (test class) + (invoke "java" "-cp" (string-append (getenv "CLASSPATH") + ":build/classes" + ":build/test-classes") + "-Dtest.resources.dir=src/test/resources" + "org.testng.TestNG" "-testclass" + class)) + (invoke "ant" "compile-tests") + (test "org.iq80.snappy.SnappyFramedStreamTest") + (test "org.iq80.snappy.SnappyStreamTest") + #t)) + (add-before 'build 'remove-hadoop-dependency + (lambda _ + ;; We don't have hadoop + (delete-file "src/main/java/org/iq80/snappy/HadoopSnappyCodec.java") + (delete-file "src/test/java/org/iq80/snappy/TestHadoopSnappyCodec.java") + #t))))) + (home-page "https://github.com/dain/snappy") + (native-inputs + `(("guava" ,java-guava) + ("java-snappy" ,java-snappy) + ("hamcrest" ,java-hamcrest-core) + ("testng" ,java-testng))) + (synopsis "Java port of the Snappy (de)compressor") + (description + "Iq80-snappy is a port of the Snappy compressor and decompressor rewritten +in pure Java. This compression code produces a byte-for-byte exact copy of the +output created by the original C++ code, and is extremely fast.") + (license license:asl2.0))) + +(define-public java-jbzip2 + (package + (name "java-jbzip2") + (version "0.9.1") + (source (origin + (method url-fetch) + (uri (string-append "https://storage.googleapis.com/" + "google-code-archive-source/v2/" + "code.google.com/jbzip2/" + "source-archive.zip")) + (file-name (string-append name "-" version ".zip")) + (sha256 + (base32 + "0ncmhlqmrfmj96nqf6p77b9ws35lcfsvpfxzwxi2asissc83z1l3")))) + (build-system ant-build-system) + (native-inputs + `(("unzip" ,unzip) + ("java-junit" ,java-junit))) + (arguments + `(#:tests? #f ; no tests + #:jar-name "jbzip2.jar" + #:source-dir "tags/release-0.9.1/src" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-encoding-problems + (lambda _ + ;; Some of the files we're patching are + ;; ISO-8859-1-encoded, so choose it as the default + ;; encoding so the byte encoding is preserved. + (with-fluids ((%default-port-encoding #f)) + (substitute* "tags/release-0.9.1/src/org/itadaki/bzip2/HuffmanAllocator.java" + (("Milidi.") "Milidiu"))) + #t))))) + (home-page "https://code.google.com/archive/p/jbzip2/") + (synopsis "Java bzip2 compression/decompression library") + (description "Jbzip2 is a Java bzip2 compression/decompression library. +It can be used as a replacement for the Apache @code{CBZip2InputStream} / +@code{CBZip2OutputStream} classes.") + (license license:expat))) + +(define-public java-tukaani-xz + (package + (name "java-tukaani-xz") + (version "1.6") + (source (origin + (method url-fetch) + (uri (string-append "https://tukaani.org/xz/xz-java-" version ".zip")) + (sha256 + (base32 + "1z3p1ri1gvl07inxn0agx44ck8n7wrzfmvkz8nbq3njn8r9wba8x")))) + (build-system ant-build-system) + (arguments + `(#:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + ;; Our build system enters the first directory in the archive, but + ;; the package is not contained in a subdirectory + (chdir "..") + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Do we want to install *Demo.jar? + (install-file "build/jar/xz.jar" + (string-append + (assoc-ref outputs "out") + "/share/java/xz.jar")) + #t))))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "https://tukaani.org") + (synopsis "XZ in Java") + (description "Tukaani-xz is an implementation of xz compression/decompression +algorithms in Java.") + (license license:public-domain))) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index c607cbbcc5..163c296278 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -60,6 +60,7 @@ (define-module (gnu packages java) #:use-module (gnu packages guile) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) + #:use-module (gnu packages java-compression) #:use-module (gnu packages libffi) #:use-module (gnu packages linux) ;alsa #:use-module (gnu packages maths) -- cgit v1.2.3 From 95bc85b7da0cd5177d1b1bd27f0533edca7e414e Mon Sep 17 00:00:00 2001 From: Gábor Boskovits Date: Mon, 28 Jan 2019 08:50:30 +0100 Subject: gnu: Add openjdk 11. * gnu/packages/java.scm (openjdk11): New variable. Signed-off-by: Julien Lepiller --- gnu/packages/java.scm | 225 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) (limited to 'gnu/packages/java.scm') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 163c296278..a314dc9953 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1860,6 +1860,231 @@ (define-public openjdk10 ("which" ,which) ("zip" ,zip))))) +(define-public openjdk11 + (package + (name "openjdk") + (version "11.28") + (source (origin + (method url-fetch) + (uri "http://hg.openjdk.java.net/jdk/jdk/archive/76072a077ee1.tar.bz2") + (file-name (string-append name "-" version ".tar.bz2")) + (sha256 + (base32 + "0v705w1s9lrqalzahir78pk397rkk9gfvzq821yv8h3xha0bqi6w")) + (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$")) + #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=" (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.guix.info/issue/32894 + "--with-native-debug-symbols=zipped" + ;; do not use the bundled libraries + "--with-giflib=system" + "--with-lcms=system" + "--with-libjpeg=system" + "--with-libpng=system" + ;; allow the build system to locate the system freetype + ,(string-append "--with-freetype-include=" + (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 + (lambda _ + ;; This file was "fixed" by patch-source-shebangs, but it requires + ;; this exact first line. + (substitute* "make/data/blacklistedcertsconverter/blacklisted.certs.pem" + (("^#!.*") "#! java BlacklistedCertsConverter SHA-256\n")) + #t)) + (replace 'build + (lambda _ + (with-output-to-file ".src-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.com/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" ".*-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.so. + ;; But that shared object is located in the server/ folder, so it + ;; cannot be found. This phase creates a symbolic link in the + ;; lib/ folder so that the other libraries can find it. + ;; + ;; See: + ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html + ;; + ;; FIXME: Find the bug in the build system, so that this symlink is + ;; not needed. + (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.so") + (string-append lib-jdk "/libjvm.so")) + (symlink (string-append lib-out "/server/libjvm.so") + (string-append lib-out "/libjvm.so"))) + #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.zip")) + (dir (mkdtemp! "zip-contents.XXXXXX"))) + (with-directory-excursion dir + (invoke "unzip" archive)) + (delete-file archive) + (with-directory-excursion dir + (let ((char-data-files (find-files "." "CharacterData.*"))) + (for-each (lambda (file) + (substitute* file + (((string-append "This file was generated " + "AUTOMATICALLY from a template " + "file.*")) + (string-append "This file was generated " + "AUTOMATICALLY from a template " + "file")))) + char-data-files))) + (with-directory-excursion dir + (let ((files (find-files "." ".*" #: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.XXXXXX"))) + (with-directory-excursion dir + (invoke "unzip" archive)) + (delete-file archive) + (for-each (compose repack-archive canonicalize-path) + (find-files dir "(ct.sym|.*.jar)$")) + (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 "." ".*" #:directories? #t))) + (apply invoke "zip" "-0" "-X" archive files))))))) + (for-each repack-archive + (find-files (assoc-ref outputs "doc") ".*.zip$")) + (for-each repack-archive + (find-files (assoc-ref outputs "jdk") + ".*.(zip|jar|diz)$")) + (repack-archive (string-append (assoc-ref outputs "jdk") "/lib/ct.sym")) + (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 + "temp-file.XXXXXX"))) + (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") ".*.jmod$"))) + #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.html") + (("Generated by javadoc \\(11-internal\\).*$") + "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.java.net/projects/jdk/11/") + (synopsis "Java development kit") + (description + "This package provides the Java development kit OpenJDK.") + (license license:gpl2+))) + (define-public icedtea icedtea-8) -- cgit v1.2.3