add openjdk10 and update josm
more/packages/java.scm
968 | 968 | (description "") | |
969 | 969 | (license license:gpl2))) | |
970 | 970 | ||
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 | + | ||
971 | 995 | (define-public java-josm | |
972 | 996 | (package | |
973 | 997 | (name "java-josm") | |
974 | - | (version "13576") | |
998 | + | (version "13878") | |
975 | 999 | (source (origin | |
976 | 1000 | (method git-fetch) | |
977 | 1001 | (uri (git-reference | |
978 | 1002 | (url "https://github.com/openstreetmap/josm.git") | |
979 | - | (commit "ac76e49953464260a30b110a86dfd8529171db50"))) | |
1003 | + | (commit "1771fe8e7386f9e9a1fbf90837a6dda4371c5670"))) | |
980 | 1004 | ;; https://josm.openstreetmap.de/browser | |
981 | 1005 | ;; FIXME: Fetching from mirror on github because svn-fetch result | |
982 | 1006 | ;; is not deterministic: hash differs each time it fetches the repo. | |
… | |||
985 | 1009 | ; (revision (string->number version)))) | |
986 | 1010 | (sha256 | |
987 | 1011 | (base32 | |
988 | - | "0x8xh0cn6dbyn55n3davyv6r84pgd4yb52fbxj6qdwh2icprkz92")) | |
1012 | + | "0mkbaijlzxq828si3f46avvi4vj8c88gg7g72bq95n75lj8i0saa")) | |
989 | 1013 | (file-name (string-append name "-" version)) | |
990 | 1014 | (modules '((guix build utils))) | |
991 | 1015 | (snippet | |
992 | 1016 | '(begin | |
993 | 1017 | (for-each delete-file (find-files "." ".*.jar")) | |
1018 | + | (delete-file-recursively "test/lib") | |
994 | 1019 | (delete-file-recursively "windows"))))) | |
995 | 1020 | (build-system ant-build-system) | |
996 | 1021 | (native-inputs | |
… | |||
1011 | 1036 | ("java-commons-jcs" ,java-commons-jcs) | |
1012 | 1037 | ("java-commons-collections" ,java-commons-collections) | |
1013 | 1038 | ("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))) | |
1015 | 1041 | (arguments | |
1016 | 1042 | `(#:tests? #f | |
1017 | 1043 | #:jdk ,icedtea-8 | |
… | |||
1020 | 1046 | (modify-phases %standard-phases | |
1021 | 1047 | (add-after 'unpack 'rm-build.xml | |
1022 | 1048 | (lambda* _ | |
1023 | - | (delete-file "build.xml"))) | |
1049 | + | (delete-file "build.xml") | |
1050 | + | #t)) | |
1024 | 1051 | (add-before 'build 'fix-revision | |
1025 | 1052 | (lambda* _ | |
1026 | 1053 | (with-output-to-file "REVISION.XML" | |
… | |||
1028 | 1055 | (display | |
1029 | 1056 | (string-append "<info><entry><commit revision=\"" ,version "\">" | |
1030 | 1057 | "<date>1970-01-01 00:00:00 +0000</date>" | |
1031 | - | "</commit></entry></info>")))))) | |
1058 | + | "</commit></entry></info>")))) | |
1059 | + | #t)) | |
1032 | 1060 | (add-before 'build 'generate-parser | |
1033 | 1061 | (lambda* _ | |
1034 | 1062 | (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss") | |
1035 | 1063 | (out (string-append dir "/parsergen")) | |
1036 | 1064 | (file (string-append dir "/MapCSSParser.jj"))) | |
1037 | 1065 | (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)) | |
1043 | 1072 | (add-after 'build 'generate-epsg | |
1044 | 1073 | (lambda _ | |
1045 | 1074 | (system* "javac" "scripts/BuildProjectionDefinitions.java" | |
… | |||
1047 | 1076 | (mkdir-p "data/projection") | |
1048 | 1077 | (with-output-to-file "data/projection/custom-epsg" | |
1049 | 1078 | (lambda _ (display ""))) | |
1050 | - | (zero? (system* "java" "-cp" "build/classes:scripts:." | |
1051 | - | "BuildProjectionDefinitions" ".")))) | |
1079 | + | (invoke "java" "-cp" "build/classes:scripts:." | |
1080 | + | "BuildProjectionDefinitions" ".") | |
1081 | + | #t)) | |
1052 | 1082 | (add-after 'generate-epsg 'copy-data | |
1053 | 1083 | (lambda _ | |
1054 | 1084 | (mkdir-p "build/classes") | |
1055 | - | (rename-file "data" "build/classes/data"))) | |
1085 | + | (rename-file "data" "build/classes/data") | |
1086 | + | #t)) | |
1056 | 1087 | (add-before 'install 'regenerate-jar | |
1057 | 1088 | (lambda _ | |
1058 | 1089 | ;; We need to regenerate the jar file to add data. | |
1059 | 1090 | (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)) | |
1062 | 1094 | (add-before 'build 'copy-styles | |
1063 | 1095 | (lambda _ | |
1064 | 1096 | (mkdir-p "build/classes") | |
1065 | - | (rename-file "styles" "build/classes/styles"))) | |
1097 | + | (rename-file "styles" "build/classes/styles") | |
1098 | + | #t)) | |
1066 | 1099 | (add-before 'build 'copy-images | |
1067 | 1100 | (lambda _ | |
1068 | 1101 | (mkdir-p "build/classes") | |
1069 | - | (rename-file "images" "build/classes/images"))) | |
1102 | + | (rename-file "images" "build/classes/images") | |
1103 | + | #t)) | |
1070 | 1104 | (add-before 'build 'copy-revision | |
1071 | 1105 | (lambda _ | |
1072 | 1106 | (mkdir-p "build/classes") | |
… | |||
1075 | 1109 | (display | |
1076 | 1110 | (string-append "Revision: " ,version "\n" | |
1077 | 1111 | "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)) | |
1079 | 1114 | (add-after 'install 'install-bin | |
1080 | 1115 | (lambda* (#:key outputs inputs #:allow-other-keys) | |
1081 | 1116 | (let* ((out (assoc-ref outputs "out")) | |
… | |||
1089 | 1124 | " -cp " out "/share/java/josm.jar:" | |
1090 | 1125 | (getenv "CLASSPATH") | |
1091 | 1126 | " org.openstreetmap.josm.gui.MainApplication")))) | |
1092 | - | (chmod (string-append bin "/josm") #o755))))))) | |
1127 | + | (chmod (string-append bin "/josm") #o755)) | |
1128 | + | #t))))) | |
1093 | 1129 | (home-page "https://josm.openstreetmap.de") | |
1094 | 1130 | (synopsis "OSM editor") | |
1095 | 1131 | (description "OSM editor.") | |
… | |||
4340 | 4376 | (name "openjdk") | |
4341 | 4377 | (version "9+181") | |
4342 | 4378 | (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"))) | |
4350 | 4379 | (method url-fetch) | |
4351 | 4380 | (uri "http://hg.openjdk.java.net/jdk/jdk/archive/3cc80be736f2.tar.bz2") | |
4352 | 4381 | (file-name (string-append name "-" version ".tar.bz2")) | |
4353 | 4382 | (sha256 | |
4354 | 4383 | (base32 | |
4355 | - | ;"0mnyfknznp0bwxvnl9yv6p8vzmwra482ya612mkfw37frbvs5b8x")))) | |
4356 | 4384 | "01ihmyf7k5z17wbr7xig7y40l9f01d5zjgkcmawn1102hw5kchpq")))) | |
4357 | 4385 | (build-system gnu-build-system) | |
4358 | 4386 | (outputs '("out" "jdk" "doc")) | |
4359 | 4387 | (arguments | |
4360 | 4388 | `(#:tests? #f; require jtreg | |
4361 | 4389 | #:imported-modules | |
4362 | - | (;(guix build gnu-build-system) | |
4363 | - | (guix build syscalls) | |
4390 | + | ((guix build syscalls) | |
4364 | 4391 | ,@%gnu-build-system-modules) | |
4365 | 4392 | #:phases | |
4366 | 4393 | (modify-phases %standard-phases | |
… | |||
4382 | 4409 | (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "yes") | |
4383 | 4410 | (invoke "make" "all") | |
4384 | 4411 | #t)) | |
4385 | - | ;(replace 'check | |
4386 | - | ; (lambda _ | |
4387 | - | ; (invoke "make" "test") | |
4388 | - | ; #t)) | |
4389 | 4412 | ;; Some of the libraries in the lib/ folder link to libjvm.so. | |
4390 | 4413 | ;; But that shared object is located in the server/ folder, so it | |
4391 | 4414 | ;; cannot be found. This phase creates a symbolic link in the | |
… | |||
4454 | 4477 | (native-inputs | |
4455 | 4478 | `(("icedtea-8" ,icedtea-8) | |
4456 | 4479 | ("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") | |
4457 | 4595 | ("unzip" ,unzip) | |
4458 | 4596 | ("which" ,which) | |
4459 | 4597 | ("zip" ,zip))) |