add binary scala and resume work on gradle
more/packages/gradle.scm
32 | 32 | #:use-module (gnu packages version-control) | |
33 | 33 | #:use-module (gnu packages xml) | |
34 | 34 | #:use-module (more packages java) | |
35 | - | #:use-module (more packages maven)) | |
35 | + | #:use-module (more packages maven) | |
36 | + | #:use-module (more packages scala)) | |
36 | 37 | ||
37 | 38 | ;; Gradle requires guava@17. | |
38 | 39 | ;; TODO: patch gradle to support at least guava@20 and send it upstream. | |
… | |||
63 | 64 | @code{projects} and @code{runtime} parameters." | |
64 | 65 | (package | |
65 | 66 | (name (string-append "gradle-" subproject)) | |
66 | - | (version "4.8.1") | |
67 | + | (version "4.9.0") | |
67 | 68 | (source (origin | |
68 | 69 | (method url-fetch) | |
69 | 70 | (uri (string-append "https://github.com/gradle/gradle/archive/v" | |
… | |||
71 | 72 | (file-name (string-append "gradle-" version ".tar.gz")) | |
72 | 73 | (sha256 | |
73 | 74 | (base32 | |
74 | - | "0khq8lvw5gp9nrwqhr9818xfmijz14z5lg9l6b2c4zrbsckqw940")) | |
75 | + | "19x1sksin2nh277pvd1f7h6kphbbqv4fb6sax696kvn1ci5h2fvp")) | |
75 | 76 | (patches | |
76 | 77 | (search-patches | |
77 | 78 | "gradle-match-files-without-version-number.patch")))) | |
… | |||
79 | 80 | (arguments | |
80 | 81 | ;; The jar-name must be this exactly: gradle will not find its jar files | |
81 | 82 | ;; if they are named differently. | |
82 | - | `(#:jar-name (string-append "gradle-" ,subproject "-4.8.jar") | |
83 | + | `(#:jar-name (string-append "gradle-" ,subproject "-" ,version ".jar") | |
83 | 84 | #:source-dir (string-append "subprojects/" ,subproject "/src/main/java") | |
84 | 85 | #:jdk ,icedtea-8 | |
85 | 86 | #:tests? #f;; Ignore tests for now | |
… | |||
94 | 95 | (("message=\"") | |
95 | 96 | (string-append "message=\"Implementation-Title: Gradle" | |
96 | 97 | "${line.separator}" | |
97 | - | "Implementation-Version: 4.8" | |
98 | + | "Implementation-Version: " ,version | |
98 | 99 | "${line.separator}"))) | |
99 | 100 | #t)) | |
100 | 101 | (add-before 'build 'add-properties | |
… | |||
346 | 347 | (mkdir-p "build/classes/org/gradle") | |
347 | 348 | (with-output-to-file "build/classes/org/gradle/build-receipt.properties" | |
348 | 349 | (lambda _ | |
349 | - | (format #t "baseVersion=4.8 | |
350 | + | (format #t "baseVersion=~a | |
350 | 351 | commitId=cf7821a6f79f8e2a598df21780e3ff7ce8db2b82 | |
351 | 352 | buildTimestamp=19710101000000+0000 | |
352 | 353 | buildTimestampIso=1971-01-01 00\\:00\\:00 UTC | |
353 | - | versionNumber=4.8 | |
354 | - | isSnapshot=false"))) | |
354 | + | versionNumber=~a | |
355 | + | isSnapshot=false" ,(package-version base) ,(package-version base)))) | |
355 | 356 | #t)))))) | |
356 | 357 | (inputs | |
357 | 358 | `(("java-guava-for-gradle" ,java-guava-for-gradle) | |
… | |||
414 | 415 | (add-before 'build 'fix-kryo | |
415 | 416 | (lambda _ | |
416 | 417 | ;; gradle depends on kryo-2.20 from 2013, we packaged version 4. | |
417 | - | (substitute* "subprojects/messaging/src/main/java/org/gradle/internal/serialize/kryo/KryoBackedEncoder.java" | |
418 | - | (("public int getWritePosition") | |
419 | - | "public long getWritePosition")) | |
418 | + | (with-directory-excursion "subprojects/messaging/src/main/java" | |
419 | + | (substitute* '("org/gradle/internal/serialize/kryo/KryoBackedEncoder.java" | |
420 | + | "org/gradle/internal/serialize/kryo/StringDeduplicatingKryoBackedEncoder.java") | |
421 | + | (("public int getWritePosition") | |
422 | + | "public long getWritePosition"))) | |
420 | 423 | #t)))))) | |
421 | 424 | (inputs | |
422 | 425 | `(("gradle-base-services" ,gradle-base-services) | |
… | |||
478 | 481 | ("java-slf4j-api" ,java-slf4j-api) | |
479 | 482 | ("java-jul-to-slf4j" ,java-jul-to-slf4j))))) | |
480 | 483 | ||
484 | + | (define-public gradle-language-scala | |
485 | + | (let ((base (gradle-subproject | |
486 | + | "language-scala" | |
487 | + | '("gradle-core" "gradle-platform-jvm" "gradle-language-java" | |
488 | + | "gradle-language-jvm") | |
489 | + | '()))) | |
490 | + | (package | |
491 | + | (inherit base) | |
492 | + | (inputs | |
493 | + | `(("gradle-base-services" ,gradle-base-services) | |
494 | + | ("gradle-base-services-groovy" ,gradle-base-services-groovy) | |
495 | + | ("gradle-core" ,gradle-core) | |
496 | + | ("gradle-core-api" ,gradle-core-api) | |
497 | + | ("gradle-language-java" ,gradle-language-java) | |
498 | + | ("gradle-language-jvm" ,gradle-language-jvm) | |
499 | + | ("gradle-logging" ,gradle-logging) | |
500 | + | ("gradle-model-core" ,gradle-model-core) | |
501 | + | ("gradle-native" ,gradle-native) | |
502 | + | ("gradle-persis tent-cache" ,gradle-persistent-cache) | |
503 | + | ("gradle-platform-base" ,gradle-platform-base) | |
504 | + | ("gradle-platform-jvm" ,gradle-platform-jvm) | |
505 | + | ("gradle-process-services" ,gradle-process-services) | |
506 | + | ("gradle-workers" ,gradle-workers) | |
507 | + | ("groovy" ,groovy) | |
508 | + | ("java-guava-for-gradle" ,java-guava-for-gradle) | |
509 | + | ("java-javax-inject" ,java-javax-inject) | |
510 | + | ("java-jsr305" ,java-jsr305) | |
511 | + | ("scala-official" ,scala-official)))))) | |
512 | + | ||
481 | 513 | (define-public gradle-scala | |
482 | 514 | (let ((base (gradle-subproject | |
483 | 515 | "scala" | |
… | |||
488 | 520 | (inherit base) | |
489 | 521 | (inputs | |
490 | 522 | `(("gradle-base-services" ,gradle-base-services) | |
523 | + | ("gradle-base-services-groovy" ,gradle-base-services-groovy) | |
491 | 524 | ("gradle-core" ,gradle-core) | |
492 | 525 | ("gradle-core-api" ,gradle-core-api) | |
493 | 526 | ("gradle-model-core" ,gradle-model-core) | |
494 | 527 | ("gradle-platform-base" ,gradle-platform-base) | |
528 | + | ("gradle-platform-jvm" ,gradle-platform-jvm) | |
495 | 529 | ("gradle-plugins" ,gradle-plugins) | |
496 | 530 | ("gradle-reporting" ,gradle-reporting) | |
497 | 531 | ("groovy" ,groovy) | |
498 | 532 | ("java-guava-for-gradle" ,java-guava-for-gradle) | |
499 | 533 | ("java-javax-inject" ,java-javax-inject) | |
500 | - | ("java-jsr305" ,java-jsr305)))))) | |
534 | + | ("java-jsr305" ,java-jsr305) | |
535 | + | ("scala-official" ,scala-official)))))) | |
501 | 536 | ||
502 | 537 | (define-public gradle-ide | |
503 | 538 | (let ((base (gradle-subproject | |
… | |||
811 | 846 | `(modify-phases ,phases | |
812 | 847 | (add-before 'build 'add-classpath | |
813 | 848 | (lambda _ | |
814 | - | (substitute* "build.xml" | |
815 | - | (("message=\"") | |
816 | - | (string-append "message=\"Class-Path: " | |
817 | - | "gradle-base-services-4.8.jar " | |
818 | - | "gradle-core-api-4.8.jar " | |
819 | - | "gradle-core-4.8.jar" | |
820 | - | "${line.separator}"))) | |
849 | + | (let ((version ,(package-version base))) | |
850 | + | (substitute* "build.xml" | |
851 | + | (("message=\"") | |
852 | + | (string-append "message=\"Class-Path: " | |
853 | + | "gradle-base-services-" version ".jar " | |
854 | + | "gradle-core-api-" version ".jar " | |
855 | + | "gradle-core-" version ".jar" | |
856 | + | "${line.separator}")))) | |
821 | 857 | #t)) | |
822 | 858 | ;; This phase fails, because the jar files are not actually | |
823 | 859 | ;; present in the output directory. This is because gradle | |
… | |||
1589 | 1625 | org/objenesis | |
1590 | 1626 | ")))) | |
1591 | 1627 | (mkdir-p "build/jar") | |
1592 | - | (invoke "jar" "cf" "build/jar/gradle-runtime-api-info-4.8.jar" | |
1593 | - | "-C" "build/classes" ".") | |
1628 | + | (invoke "jar" "cf" "build/jar/gradle-runtime-api-info-" | |
1629 | + | (package-version base) ".jar" "-C" "build/classes" ".") | |
1594 | 1630 | #t))))))))) | |
1595 | 1631 | ||
1596 | 1632 | (define-public gradle-announce | |
… | |||
3351 | 3387 | output | |
3352 | 3388 | (string-append (assoc-ref %build-inputs "icedtea-8") | |
3353 | 3389 | "/bin/java") | |
3354 | - | (string-append libdir "/gradle-launcher-4.8.jar")))) | |
3390 | + | (string-append libdir "/gradle-launcher-" | |
3391 | + | (package-version gradle-base-services) | |
3392 | + | ".jar")))) | |
3355 | 3393 | (chmod filename #o755) | |
3356 | 3394 | ;; Create a symlink for every dependency listed above. | |
3357 | 3395 | (for-each | |
… | |||
3373 | 3411 | ".*.jar")) | |
3374 | 3412 | plugins))) | |
3375 | 3413 | ;; Using a symlink for gradle-launcher doesn't seem to work. | |
3376 | - | (delete-file (string-append libdir "/gradle-launcher-4.8.jar")) | |
3414 | + | (delete-file (string-append libdir "/gradle-launcher-" | |
3415 | + | (package-version gradle-base-services) | |
3416 | + | ".jar")) | |
3377 | 3417 | (copy-file (string-append (assoc-ref %build-inputs "gradle-launcher") | |
3378 | - | "/share/java/gradle-launcher-4.8.jar") | |
3418 | + | "/share/java/gradle-launcher-" | |
3419 | + | (package-version gradle-base-services) | |
3420 | + | ".jar") | |
3379 | 3421 | (string-append libdir | |
3380 | - | "/gradle-launcher-4.8.jar")))))) | |
3422 | + | "/gradle-launcher-" | |
3423 | + | (package-version gradle-base-services) | |
3424 | + | ".jar")))))) | |
3381 | 3425 | (inputs | |
3382 | 3426 | `(("gradle-wrapper" ,gradle-wrapper) | |
3383 | 3427 | ("gradle-workers" ,gradle-workers) |
more/packages/scala.scm unknown status 1
1 | + | ;;; GNU Guix --- Functional package management for GNU | |
2 | + | ;;; Copyright ?? 2018 Julien Lepiller <julien@lepiller.eu> | |
3 | + | ;;; | |
4 | + | ;;; This file is part of GNU Guix. | |
5 | + | ;;; | |
6 | + | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
7 | + | ;;; under the terms of the GNU General Public License as published by | |
8 | + | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | + | ;;; your option) any later version. | |
10 | + | ;;; | |
11 | + | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
12 | + | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | + | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | + | ;;; GNU General Public License for more details. | |
15 | + | ;;; | |
16 | + | ;;; You should have received a copy of the GNU General Public License | |
17 | + | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | + | ||
19 | + | (define-module (more packages scala) | |
20 | + | #:use-module ((guix licenses) #:prefix license:) | |
21 | + | #:use-module (gnu packages) | |
22 | + | #:use-module (guix packages) | |
23 | + | #:use-module (guix download) | |
24 | + | #:use-module (guix git-download) | |
25 | + | #:use-module (guix utils) | |
26 | + | #:use-module (guix build-system ant) | |
27 | + | #:use-module (guix build-system trivial) | |
28 | + | #:use-module (gnu packages base) | |
29 | + | #:use-module (gnu packages bash) | |
30 | + | #:use-module (gnu packages compression) | |
31 | + | #:use-module (gnu packages java)) | |
32 | + | ||
33 | + | ;; This package downloads the so-called official version of scala, a pre-built | |
34 | + | ;; binary by the scala developers. | |
35 | + | ;; This binary should never be made part of Guix itself, because we have | |
36 | + | ;; ways to bootstrap it properly. The bootstrap project of scala takes time, | |
37 | + | ;; so in the meantime... here you are :( | |
38 | + | (define-public scala-official | |
39 | + | (package | |
40 | + | (name "scala-official") | |
41 | + | (version "2.12.6") | |
42 | + | (source | |
43 | + | (origin | |
44 | + | (method url-fetch) | |
45 | + | (uri (string-append "https://downloads.lightbend.com/scala/" | |
46 | + | version "/scala-" version ".tgz")) | |
47 | + | (sha256 | |
48 | + | (base32 | |
49 | + | "05ili2959yrshqi44wpmwy0dyfm4kvp6i8mlbnj1xvc5b9649iqs")))) | |
50 | + | (build-system trivial-build-system) | |
51 | + | (arguments | |
52 | + | `(#:modules ((guix build utils)) | |
53 | + | #:builder (begin | |
54 | + | (use-modules (guix build utils)) | |
55 | + | (let* ((source (assoc-ref %build-inputs "source")) | |
56 | + | (java (assoc-ref %build-inputs "icedtea-8")) | |
57 | + | (bash (assoc-ref %build-inputs "bash")) | |
58 | + | (tar (string-append | |
59 | + | (assoc-ref %build-inputs "tar") | |
60 | + | "/bin/tar")) | |
61 | + | (gzip (assoc-ref %build-inputs "gzip")) | |
62 | + | (output (assoc-ref %outputs "out")) | |
63 | + | (bindir (string-append output "/bin"))) | |
64 | + | (mkdir-p output) | |
65 | + | (setenv "PATH" (string-append (getenv "PATH") ":" gzip "/bin")) | |
66 | + | (invoke tar "xf" source) | |
67 | + | (copy-recursively "scala-2.12.6" output) | |
68 | + | (chdir output) | |
69 | + | (for-each delete-file (find-files "bin" "bat$")) | |
70 | + | (substitute* (find-files "bin" ".*") | |
71 | + | (("^#!.*") | |
72 | + | (string-append "#!" bash "/bin/bash\n" "JAVA_HOME=" java))))))) | |
73 | + | (inputs | |
74 | + | `(("bash" ,bash) | |
75 | + | ("gzip" ,gzip) | |
76 | + | ("icedtea-8" ,icedtea-8) | |
77 | + | ("tar" ,tar))) | |
78 | + | (home-page "https://scala-lang.org/") | |
79 | + | (synopsis "") | |
80 | + | (description "") | |
81 | + | (license license:bsd-3))) | |
82 | + | ||
83 | + | (define-public sjsonnew | |
84 | + | (package | |
85 | + | (name "sjsonnew") | |
86 | + | (version "0.8.2") | |
87 | + | (source | |
88 | + | (origin | |
89 | + | (method url-fetch) | |
90 | + | (uri (string-append "https://github.com/eed3si9n/sjson-new/archive/v" | |
91 | + | version ".tar.gz")) | |
92 | + | (file-name (string-append name "-" version ".tar.gz")) | |
93 | + | (sha256 | |
94 | + | (base32 | |
95 | + | "1rv0c50af5kn27x51g650wl2ig94z52fhs0rn8ykahpz4jhg1p7p")))) | |
96 | + | (arguments | |
97 | + | `(#:tests? #f | |
98 | + | #:jdk ,icedtea-8 | |
99 | + | #:phases | |
100 | + | (modify-phases %standard-phases | |
101 | + | (replace 'build | |
102 | + | (lambda _ | |
103 | + | (mkdir-p "build/classes") | |
104 | + | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") | |
105 | + | "-d" "build/classes" | |
106 | + | (find-files "core/src/main/scala" ".*.scala$")) | |
107 | + | #t))))) | |
108 | + | (build-system ant-build-system) | |
109 | + | (inputs | |
110 | + | `(("scala" ,scala-official))) | |
111 | + | (home-page "") | |
112 | + | (synopsis "") | |
113 | + | (description "") | |
114 | + | (license license:asl2.0))) | |
115 | + | ||
116 | + | (define-public sbt | |
117 | + | (package | |
118 | + | (name "sbt") | |
119 | + | (version "1.2.1") | |
120 | + | (source | |
121 | + | (origin | |
122 | + | (method url-fetch) | |
123 | + | (uri (string-append "https://github.com/sbt/sbt/archive/v" | |
124 | + | version ".tar.gz")) | |
125 | + | (file-name (string-append name "-" version ".tar.gz")) | |
126 | + | (sha256 | |
127 | + | (base32 | |
128 | + | "15i8fd7zgairaaikscrva8d1klz0w9nh7fc0896x1n8nrs578vmy")))) | |
129 | + | (build-system ant-build-system) | |
130 | + | (arguments | |
131 | + | `(#:tests? #f | |
132 | + | #:jdk ,icedtea-8 | |
133 | + | #:phases | |
134 | + | (modify-phases %standard-phases | |
135 | + | (add-before 'build 'copy-resources | |
136 | + | (lambda _ | |
137 | + | (copy-recursively "sbt/src/main/resources" "build/classes") | |
138 | + | #t)) | |
139 | + | (replace 'build | |
140 | + | (lambda _ | |
141 | + | (define (build-subproject prefix name) | |
142 | + | (let ((build-directory (string-append "build/" name)) | |
143 | + | (jar-name (string-append name ".jar"))) | |
144 | + | (mkdir-p build-directory) | |
145 | + | (format #t "Building project ~a...~%" name) | |
146 | + | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") | |
147 | + | "-d" build-directory | |
148 | + | (find-files (string-append prefix name "/src/main/scala") | |
149 | + | ".*.scala$")) | |
150 | + | (invoke "jar" "cf" jar-name "-C" build-directory))) | |
151 | + | (build-subproject "internal/" "util-collection") | |
152 | + | (build-subproject "" "main-settings") | |
153 | + | (build-subproject "" "sbt") | |
154 | + | #t)) | |
155 | + | (replace 'install | |
156 | + | (install-jars "build"))))) | |
157 | + | (inputs | |
158 | + | `(("scala" ,scala-official))) | |
159 | + | (home-page "https://www.scala-sbt.org/") | |
160 | + | (synopsis "") | |
161 | + | (description "") | |
162 | + | (license license:bsd-3))) |