add openjdk10 and update josm

Julien LepillerSat Jun 09 14:12:03+0200 2018

40767eb

add openjdk10 and update josm

more/packages/java.scm

968968
    (description "")
969969
    (license license:gpl2)))
970970
971+
(define-public java-zstd
972+
  (package
973+
    (name "java-zstd")
974+
    (version "1.3.0-1")
975+
    (source (origin
976+
              (method url-fetch)
977+
              (uri (string-append "https://github.com/luben/zstd-jni/archive/v"
978+
                                  version ".tar.gz"))
979+
              (file-name (string-append name "-" version ".tar.gz"))
980+
              (sha256
981+
               (base32
982+
                "1an6gqps3n1ddxdz8vyzdrq7xz2p6nvwdwpmwf52mfia0w71xl9a"))))
983+
    (build-system ant-build-system)
984+
    (arguments
985+
     `(#:jar-name "java-zstd.jar"
986+
       #:source-dir "src/main/java"
987+
       #:tests? #f)); Require scala
988+
    (inputs
989+
     `(("zstd" ,zstd)))
990+
    (home-page "https://github.com/luben/zstd-jni")
991+
    (synopsis "")
992+
    (description "")
993+
    (license license:bsd-2)))
994+
971995
(define-public java-josm
972996
  (package
973997
    (name "java-josm")
974-
    (version "13576")
998+
    (version "13878")
975999
    (source (origin
9761000
              (method git-fetch)
9771001
              (uri (git-reference
9781002
                    (url "https://github.com/openstreetmap/josm.git")
979-
                    (commit "ac76e49953464260a30b110a86dfd8529171db50")))
1003+
                    (commit "1771fe8e7386f9e9a1fbf90837a6dda4371c5670")))
9801004
              ;; https://josm.openstreetmap.de/browser
9811005
              ;; FIXME: Fetching from mirror on github because svn-fetch result
9821006
              ;; is not deterministic: hash differs each time it fetches the repo.

9851009
              ;      (revision (string->number version))))
9861010
              (sha256
9871011
               (base32
988-
                "0x8xh0cn6dbyn55n3davyv6r84pgd4yb52fbxj6qdwh2icprkz92"))
1012+
                "0mkbaijlzxq828si3f46avvi4vj8c88gg7g72bq95n75lj8i0saa"))
9891013
              (file-name (string-append name "-" version))
9901014
              (modules '((guix build utils)))
9911015
              (snippet
9921016
                '(begin
9931017
                   (for-each delete-file (find-files "." ".*.jar"))
1018+
                   (delete-file-recursively "test/lib")
9941019
                   (delete-file-recursively "windows")))))
9951020
    (build-system ant-build-system)
9961021
    (native-inputs

10111036
       ("java-commons-jcs" ,java-commons-jcs)
10121037
       ("java-commons-collections" ,java-commons-collections)
10131038
       ("java-commons-logging-minimal" ,java-commons-logging-minimal)
1014-
       ("java-commons-compress" ,java-commons-compress-latest)))
1039+
       ("java-commons-compress" ,java-commons-compress-latest)
1040+
       ("java-zstd" ,java-zstd)))
10151041
    (arguments
10161042
     `(#:tests? #f
10171043
       #:jdk ,icedtea-8

10201046
       (modify-phases %standard-phases
10211047
         (add-after 'unpack 'rm-build.xml
10221048
           (lambda* _
1023-
             (delete-file "build.xml")))
1049+
             (delete-file "build.xml")
1050+
             #t))
10241051
         (add-before 'build 'fix-revision
10251052
           (lambda* _
10261053
             (with-output-to-file "REVISION.XML"

10281055
                 (display
10291056
                   (string-append "<info><entry><commit revision=\"" ,version "\">"
10301057
                                  "<date>1970-01-01 00:00:00 +0000</date>"
1031-
                                  "</commit></entry></info>"))))))
1058+
                                  "</commit></entry></info>"))))
1059+
             #t))
10321060
         (add-before 'build 'generate-parser
10331061
           (lambda* _
10341062
             (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
10351063
                    (out (string-append dir "/parsergen"))
10361064
                    (file (string-append dir "/MapCSSParser.jj")))
10371065
               (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1038-
               (zero? (system* "javacc" "-DEBUG_PARSER=false"
1039-
                               "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1040-
                               "-GRAMMAR_ENCODING=UTF-8"
1041-
                               (string-append "-OUTPUT_DIRECTORY=" out)
1042-
                               file)))))
1066+
               (invoke "javacc" "-DEBUG_PARSER=false"
1067+
                       "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1068+
                       "-GRAMMAR_ENCODING=UTF-8"
1069+
                       (string-append "-OUTPUT_DIRECTORY=" out)
1070+
                       file))
1071+
             #t))
10431072
         (add-after 'build 'generate-epsg
10441073
           (lambda _
10451074
             (system* "javac" "scripts/BuildProjectionDefinitions.java"

10471076
             (mkdir-p "data/projection")
10481077
             (with-output-to-file "data/projection/custom-epsg"
10491078
               (lambda _ (display "")))
1050-
             (zero? (system* "java" "-cp" "build/classes:scripts:."
1051-
                             "BuildProjectionDefinitions" "."))))
1079+
             (invoke "java" "-cp" "build/classes:scripts:."
1080+
                     "BuildProjectionDefinitions" ".")
1081+
             #t))
10521082
         (add-after 'generate-epsg 'copy-data
10531083
           (lambda _
10541084
             (mkdir-p "build/classes")
1055-
             (rename-file "data" "build/classes/data")))
1085+
             (rename-file "data" "build/classes/data")
1086+
             #t))
10561087
         (add-before 'install 'regenerate-jar
10571088
           (lambda _
10581089
             ;; We need to regenerate the jar file to add data.
10591090
             (delete-file "build/jar/josm.jar")
1060-
             (zero? (system* "jar" "-cf" "build/jar/josm.jar" "-C"
1061-
                             "build/classes" "."))))
1091+
             (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1092+
                     "build/classes" ".")
1093+
             #t))
10621094
         (add-before 'build 'copy-styles
10631095
           (lambda _
10641096
             (mkdir-p "build/classes")
1065-
             (rename-file "styles" "build/classes/styles")))
1097+
             (rename-file "styles" "build/classes/styles")
1098+
             #t))
10661099
         (add-before 'build 'copy-images
10671100
           (lambda _
10681101
             (mkdir-p "build/classes")
1069-
             (rename-file "images" "build/classes/images")))
1102+
             (rename-file "images" "build/classes/images")
1103+
             #t))
10701104
         (add-before 'build 'copy-revision
10711105
           (lambda _
10721106
             (mkdir-p "build/classes")

10751109
                 (display
10761110
                   (string-append "Revision: " ,version "\n"
10771111
                                  "Is-Local-Build: true\n"
1078-
                                  "Build-Date: 1970-01-01 00:00:00 +0000\n"))))))
1112+
                                  "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1113+
             #t))
10791114
         (add-after 'install 'install-bin
10801115
           (lambda* (#:key outputs inputs #:allow-other-keys)
10811116
             (let* ((out (assoc-ref outputs "out"))

10891124
                                    " -cp " out "/share/java/josm.jar:"
10901125
                                    (getenv "CLASSPATH")
10911126
                                    " org.openstreetmap.josm.gui.MainApplication"))))
1092-
               (chmod (string-append bin "/josm") #o755)))))))
1127+
               (chmod (string-append bin "/josm") #o755))
1128+
             #t)))))
10931129
    (home-page "https://josm.openstreetmap.de")
10941130
    (synopsis "OSM editor")
10951131
    (description "OSM editor.")

43404376
    (name "openjdk")
43414377
    (version "9+181")
43424378
    (source (origin
4343-
              ;(method hg-fetch)
4344-
              ;(uri (hg-reference
4345-
              ;       (url "http://hg.openjdk.java.net/jdk9/jdk9/")
4346-
              ;       (changeset "b656dea9398ef601f7fc08d1a5157a560e0ccbe0")))
4347-
              ;(uri (hg-reference
4348-
              ;       (url "http://hg.openjdk.java.net/jdk/jdk/")
4349-
              ;       (changeset "3cc80be736f2")))
43504379
              (method url-fetch)
43514380
              (uri "http://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2")
43524381
              (file-name (string-append name "-" version ".tar.bz2"))
43534382
              (sha256
43544383
               (base32
4355-
                ;"0mnyfknznp0bwxvnl9yv6p8vzmwra482ya612mkfw37frbvs5b8x"))))
43564384
                "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq"))))
43574385
    (build-system gnu-build-system)
43584386
    (outputs '("out" "jdk" "doc"))
43594387
    (arguments
43604388
     `(#:tests? #f; require jtreg
43614389
       #:imported-modules
4362-
       (;(guix build gnu-build-system)
4363-
        (guix build syscalls)
4390+
       ((guix build syscalls)
43644391
        ,@%gnu-build-system-modules)
43654392
       #:phases
43664393
       (modify-phases %standard-phases

43824409
             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
43834410
             (invoke "make" "all")
43844411
             #t))
4385-
         ;(replace 'check
4386-
         ;  (lambda _
4387-
         ;    (invoke "make" "test")
4388-
         ;    #t))
43894412
         ;; Some of the libraries in the lib/ folder link to libjvm.so.
43904413
         ;; But that shared object is located in the server/ folder, so it
43914414
         ;; cannot be found.  This phase creates a symbolic link in the

44544477
    (native-inputs
44554478
     `(("icedtea-8" ,icedtea-8)
44564479
       ("icedtea-8:jdk" ,icedtea-8 "jdk")
4480+
       ("gcc6" ,gcc-6)
4481+
       ("unzip" ,unzip)
4482+
       ("which" ,which)
4483+
       ("zip" ,zip)))
4484+
    (home-page "http://openjdk.java.net/projects/jdk9/")
4485+
    (synopsis "")
4486+
    (description "")
4487+
    (license license:gpl2)))
4488+
4489+
(define-public openjdk10
4490+
  (package
4491+
    (name "openjdk")
4492+
    (version "10+46")
4493+
    (source (origin
4494+
              (method url-fetch)
4495+
              (uri "http://hg.openjdk.java.net/jdk/jdk/archive/6fa770f9f8ab.tar.bz2")
4496+
              (file-name (string-append name "-" version ".tar.bz2"))
4497+
              (sha256
4498+
               (base32
4499+
                "0zywq2203b4hx4jms9vbwvjcj1d3k2v3qpx4s33729fkpmid97r4"))))
4500+
    (build-system gnu-build-system)
4501+
    (outputs '("out" "jdk" "doc"))
4502+
    (arguments
4503+
     `(#:tests? #f; require jtreg
4504+
       #:imported-modules
4505+
       ((guix build syscalls)
4506+
        ,@%gnu-build-system-modules)
4507+
       #:phases
4508+
       (modify-phases %standard-phases
4509+
         (delete 'patch-source-shebangs)
4510+
         (replace 'configure
4511+
           (lambda* (#:key inputs outputs #:allow-other-keys)
4512+
             (invoke "bash" "./configure"
4513+
                     (string-append "--with-freetype=" (assoc-ref inputs "freetype"))
4514+
                     "--disable-freetype-bundling"
4515+
                     "--disable-warnings-as-errors"
4516+
                     "--disable-hotspot-gtest"
4517+
                     (string-append "--prefix=" (assoc-ref outputs "out")))
4518+
             #t))
4519+
         (replace 'build
4520+
           (lambda _
4521+
             (with-output-to-file ".src-rev"
4522+
               (lambda _
4523+
                 (display ,version)))
4524+
             (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes")
4525+
             (invoke "make" "all")
4526+
             #t))
4527+
         ;; Some of the libraries in the lib/ folder link to libjvm.so.
4528+
         ;; But that shared object is located in the server/ folder, so it
4529+
         ;; cannot be found.  This phase creates a symbolic link in the
4530+
         ;; lib/ folder so that the other libraries can find it.
4531+
         ;;
4532+
         ;; See:
4533+
         ;; https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00169.html
4534+
         ;;
4535+
         ;; FIXME: Find the bug in the build system, so that this symlink is
4536+
         ;; not needed.
4537+
         (add-after 'install 'install-libjvm
4538+
           (lambda* (#:key inputs outputs #:allow-other-keys)
4539+
             (let* ((lib-out (string-append (assoc-ref outputs "out")
4540+
                                             "/lib"))
4541+
                    (lib-jdk (string-append (assoc-ref outputs "jdk")
4542+
                                             "/lib")))
4543+
               (symlink (string-append lib-jdk "/server/libjvm.so")
4544+
                        (string-append lib-jdk "/libjvm.so"))
4545+
               (symlink (string-append lib-out "/server/libjvm.so")
4546+
                        (string-append lib-out "/libjvm.so")))
4547+
             #t))
4548+
         (replace 'install
4549+
           (lambda* (#:key outputs #:allow-other-keys)
4550+
             (let ((out (assoc-ref outputs "out"))
4551+
                   (jdk (assoc-ref outputs "jdk"))
4552+
                   (doc (assoc-ref outputs "doc"))
4553+
                   (images (car (find-files "build" ".*-server-release"
4554+
                                            #:directories? #t))))
4555+
               (copy-recursively (string-append images "/images/jdk") jdk)
4556+
               (copy-recursively (string-append images "/images/jre") out)
4557+
               (copy-recursively (string-append images "/images/docs") doc))
4558+
             #t))
4559+
         (add-after 'install 'strip-zip-timestamps
4560+
           (lambda* (#:key outputs #:allow-other-keys)
4561+
             (use-modules (guix build syscalls))
4562+
             (for-each (lambda (zip)
4563+
                         (let ((dir (mkdtemp! "zip-contents.XXXXXX")))
4564+
                           (with-directory-excursion dir
4565+
                             (invoke "unzip" zip))
4566+
                           (delete-file zip)
4567+
                           (for-each (lambda (file)
4568+
                                       (let ((s (lstat file)))
4569+
                                         (unless (eq? (stat:type s) 'symlink)
4570+
                                           (format #t "reset ~a~%" file)
4571+
                                           (utime file 0 0 0 0))))
4572+
                             (find-files dir #:directories? #t))
4573+
                           (with-directory-excursion dir
4574+
                             (let ((files (find-files "." ".*" #:directories? #t)))
4575+
                               (apply invoke "zip" "-0" "-X" zip files)))))
4576+
               (find-files (assoc-ref outputs "doc") ".*.zip$"))
4577+
             #t)))))
4578+
    (inputs
4579+
     `(("alsa-lib" ,alsa-lib)
4580+
       ("cups" ,cups)
4581+
       ("fontconfig" ,fontconfig)
4582+
       ("freetype" ,freetype)
4583+
       ("libelf" ,libelf)
4584+
       ("libice" ,libice)
4585+
       ("libx11" ,libx11)
4586+
       ("libxcomposite" ,libxcomposite)
4587+
       ("libxi" ,libxi)
4588+
       ("libxinerama" ,libxinerama)
4589+
       ("libxrender" ,libxrender)
4590+
       ("libxt" ,libxt)
4591+
       ("libxtst" ,libxtst)))
4592+
    (native-inputs
4593+
     `(("openjdk9" ,openjdk9)
4594+
       ("openjdk9:jdk" ,openjdk9 "jdk")
44574595
       ("unzip" ,unzip)
44584596
       ("which" ,which)
44594597
       ("zip" ,zip)))