scala.scm
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 | #:use-module (gnu packages protobuf) |
33 | #:use-module (more packages java)) |
34 | |
35 | ;; This package downloads the so-called official version of scala, a pre-built |
36 | ;; binary by the scala developers. |
37 | ;; This binary should never be made part of Guix itself, because we have |
38 | ;; ways to bootstrap it properly. The bootstrap project of scala takes time, |
39 | ;; so in the meantime... here you are :( |
40 | (define-public scala-official |
41 | (package |
42 | (name "scala-official") |
43 | (version "2.12.8") |
44 | (source |
45 | (origin |
46 | (method url-fetch) |
47 | (uri (string-append "https://downloads.lightbend.com/scala/" |
48 | version "/scala-" version ".tgz")) |
49 | (sha256 |
50 | (base32 |
51 | "18w0vdbsp0q5rxglgalwlgkggld926bqi1fxc598rn4gh46a03j4")))) |
52 | (build-system trivial-build-system) |
53 | (arguments |
54 | `(#:modules ((guix build utils)) |
55 | #:builder (begin |
56 | (use-modules (guix build utils)) |
57 | (let* ((source (assoc-ref %build-inputs "source")) |
58 | (java (assoc-ref %build-inputs "icedtea-8")) |
59 | (bash (assoc-ref %build-inputs "bash")) |
60 | (tar (string-append |
61 | (assoc-ref %build-inputs "tar") |
62 | "/bin/tar")) |
63 | (gzip (assoc-ref %build-inputs "gzip")) |
64 | (output (assoc-ref %outputs "out")) |
65 | (bindir (string-append output "/bin"))) |
66 | (mkdir-p output) |
67 | (setenv "PATH" (string-append (getenv "PATH") ":" gzip "/bin")) |
68 | (invoke tar "xf" source) |
69 | (copy-recursively "scala-2.12.8" output) |
70 | (chdir output) |
71 | (for-each delete-file (find-files "bin" "bat$")) |
72 | (substitute* (find-files "bin" ".*") |
73 | (("^#!.*") |
74 | (string-append "#!" bash "/bin/bash\n" "JAVA_HOME=" java))))))) |
75 | (inputs |
76 | `(("bash" ,bash) |
77 | ("gzip" ,gzip) |
78 | ("icedtea-8" ,icedtea-8) |
79 | ("tar" ,tar))) |
80 | (home-page "https://scala-lang.org/") |
81 | (synopsis "") |
82 | (description "") |
83 | (license license:bsd-3))) |
84 | |
85 | ;; TODO: put it in guix/build/java-utils.scm |
86 | ;; TODO: remove contraband-* directories and regenerate them from contraband/ |
87 | (define* (sbt-building-phase subprojects #:optional (kind-projector? #f)) |
88 | `(lambda* (#:key inputs #:allow-other-keys) |
89 | (define (build-subproject prefix name) |
90 | (let ((build-directory (string-append "build/" name)) |
91 | (kind-projector (assoc-ref inputs "scala-kind-projector")) |
92 | (jar-name (string-append |
93 | (if (> (string-length prefix) 0) |
94 | (string-replace prefix "-" (- (string-length prefix) 1)) |
95 | "") |
96 | name ".jar")) |
97 | (java-files |
98 | (append |
99 | (find-files (string-append prefix name "/src/main/contraband-java") |
100 | ".*.java$") |
101 | (find-files (string-append prefix name "/src/main/java") |
102 | ".*.java$"))) |
103 | (scala-files |
104 | (append |
105 | (find-files (string-append prefix name "/src/main/contraband-scala") |
106 | ".*.scala$") |
107 | (find-files (string-append prefix name "/src/main/scala") |
108 | ".*.scala$")))) |
109 | (mkdir-p build-directory) |
110 | (format #t "Building project ~a...~%" jar-name) |
111 | (unless (eq? scala-files '()) |
112 | (apply invoke "scalac" "-classpath" |
113 | (string-append |
114 | (getenv "CLASSPATH") ":" |
115 | ;; Add any top-level directory in build that may contain |
116 | ;; .class files, but don't actually add build/ iteself or |
117 | ;; any individual class file. |
118 | (string-join |
119 | (filter (lambda (s) (eq? (string-count s #\/) 1)) |
120 | (find-files "build" "." #:directories? #t)) |
121 | ":")) |
122 | "-d" build-directory "-language:experimental.macros" |
123 | (if ,kind-projector? |
124 | (string-append "-Xplugin:" kind-projector |
125 | "/share/java/kind-projector.jar") |
126 | "") |
127 | (append scala-files java-files))) |
128 | (unless (eq? java-files '()) |
129 | (apply invoke "javac" "-classpath" |
130 | (string-append |
131 | (getenv "CLASSPATH") ":" |
132 | (string-join |
133 | (filter (lambda (s) (eq? (string-count s #\/) 1)) |
134 | (find-files "build" "." #:directories? #t)) |
135 | ":")) |
136 | "-d" build-directory java-files)) |
137 | (invoke "jar" "cf" (string-append "build/jar/" jar-name) |
138 | "-C" build-directory "."))) |
139 | (mkdir-p "build/jar") |
140 | (for-each (lambda (project) |
141 | (build-subproject (car project) (cadr project))) |
142 | '(,@subprojects)) |
143 | #t)) |
144 | |
145 | (define-public sbt-boilerplate-standalone |
146 | (package |
147 | (name "sbt-boilerplate-standalone") |
148 | (version "0.6.1") |
149 | (source (origin |
150 | (method url-fetch) |
151 | (uri (string-append "https://github.com/sbt/sbt-boilerplate/archive/v" |
152 | version ".tar.gz")) |
153 | (file-name (string-append name "-" version ".tar.gz")) |
154 | (sha256 |
155 | (base32 |
156 | "1xzh7qrsl2nmnbyzlmrshzfsf8b4qgf6yaqm1hn3qnzk6761p2jy")))) |
157 | (build-system ant-build-system) |
158 | (arguments |
159 | `(#:tests? #f |
160 | #:phases |
161 | (modify-phases %standard-phases |
162 | (add-before 'build 'add-standalone |
163 | (lambda _ |
164 | (substitute* "src/main/scala/spray/boilerplate/Generator.scala" |
165 | (("object Generator \\{") |
166 | "object Generator { |
167 | def main(args: Array[String]): Unit = { |
168 | val num = args(2).toInt |
169 | val file = scala.io.Source.fromFile(args(0)) |
170 | val content = file.mkString |
171 | val result = new java.io.PrintWriter(new java.io.File(args(1))) |
172 | |
173 | file.close |
174 | result.write(generateFromTemplate(content, num)) |
175 | result.close() |
176 | }")) |
177 | #t)) |
178 | (replace 'build |
179 | (lambda _ |
180 | (mkdir-p "build/classes") |
181 | (mkdir-p "build/jar") |
182 | (invoke "scalac" "-classpath" (getenv "CLASSPATH") |
183 | "-d" "build/classes" |
184 | "src/main/scala/spray/boilerplate/Generator.scala" |
185 | "src/main/scala/spray/boilerplate/TemplateParser.scala") |
186 | (invoke "jar" "-cf" "build/jar/boilerplate.jar" |
187 | "-C" "build/classes" ".") |
188 | #t)) |
189 | (replace 'install |
190 | (install-jars "build"))))) |
191 | (native-inputs |
192 | `(("scala" ,scala-official))) |
193 | (home-page "https://github.com/sbt/sbt-boilerplate") |
194 | (synopsis "") |
195 | (description "") |
196 | (license license:bsd-2))) |
197 | |
198 | (define-public scala-sjsonnew |
199 | (package |
200 | (name "scala-sjsonnew") |
201 | (version "0.8.2") |
202 | (source |
203 | (origin |
204 | (method url-fetch) |
205 | (uri (string-append "https://github.com/eed3si9n/sjson-new/archive/v" |
206 | version ".tar.gz")) |
207 | (file-name (string-append name "-" version ".tar.gz")) |
208 | (sha256 |
209 | (base32 |
210 | "1rv0c50af5kn27x51g650wl2ig94z52fhs0rn8ykahpz4jhg1p7p")))) |
211 | (arguments |
212 | `(#:tests? #f |
213 | #:phases |
214 | (modify-phases %standard-phases |
215 | (add-before 'build 'generate-boilerplate |
216 | (lambda _ |
217 | ; CaseClassFormats.scala.template FlatUnionFormats.scala.template TupleFormats.scala.template UnionFormats.scala.template |
218 | (invoke "java" "-cp" (getenv "CLASSPATH") "spray.boilerplate.Generator" |
219 | "core/src/main/boilerplate/sjsonnew/CaseClassFormats.scala.template" |
220 | "core/src/main/scala/sjsonnew/CaseClassFormats.scala" "22") |
221 | (invoke "java" "-cp" (getenv "CLASSPATH") "spray.boilerplate.Generator" |
222 | "core/src/main/boilerplate/sjsonnew/FlatUnionFormats.scala.template" |
223 | "core/src/main/scala/sjsonnew/FlatUnionFormats.scala" "22") |
224 | (invoke "java" "-cp" (getenv "CLASSPATH") "spray.boilerplate.Generator" |
225 | "core/src/main/boilerplate/sjsonnew/TupleFormats.scala.template" |
226 | "core/src/main/scala/sjsonnew/TupleFormats.scala" "22") |
227 | (invoke "java" "-cp" (getenv "CLASSPATH") "spray.boilerplate.Generator" |
228 | "core/src/main/boilerplate/sjsonnew/UnionFormats.scala.template" |
229 | "core/src/main/scala/sjsonnew/UnionFormats.scala" "22") |
230 | #t)) |
231 | (replace 'build |
232 | (lambda _ |
233 | (mkdir-p "build/classes") |
234 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
235 | "-d" "build/classes" |
236 | (find-files "core/src/main/scala" ".*.scala$")) |
237 | (mkdir-p "build/jar") |
238 | (invoke "jar" "-cf" "build/jar/sjsonnew.jar" |
239 | "-C" "build/classes" ".") |
240 | #t)) |
241 | (replace 'install |
242 | (install-jars "build"))))) |
243 | (build-system ant-build-system) |
244 | (native-inputs |
245 | `(("scala" ,scala-official) |
246 | ("sbt-boilerplate-standalone" ,sbt-boilerplate-standalone))) |
247 | (home-page "") |
248 | (synopsis "") |
249 | (description "") |
250 | (license license:asl2.0))) |
251 | |
252 | (define-public scala-scalajson |
253 | (package |
254 | (name "scala-scalajson") |
255 | (version "1.0.0-M4") |
256 | (source (origin |
257 | (method url-fetch) |
258 | (uri (string-append "https://github.com/mdedetrich/scalajson/archive/v" version ".tar.gz")) |
259 | (file-name (string-append name "-" version ".tar.gz")) |
260 | (sha256 |
261 | (base32 |
262 | "0k4dj2zm7zilhshdnvqi9n17qr4szc5s9ymsm9imgqpr8r5hm2vj")))) |
263 | (build-system ant-build-system) |
264 | (arguments |
265 | `(#:tests? #f |
266 | #:phases |
267 | (modify-phases %standard-phases |
268 | (replace 'build |
269 | (lambda _ |
270 | (mkdir-p "build/classes") |
271 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
272 | "-d" "build/classes" |
273 | (find-files "shared/src/main/scala" ".*.scala$")) |
274 | (mkdir-p "build/jar") |
275 | (invoke "jar" "-cf" "build/jar/scalajson-shared.jar" |
276 | "-C" "build/classes" ".") |
277 | (delete-file-recursively "build/classes") |
278 | (setenv "CLASSPATH" (string-append (getenv "CLASSPATH") ":build/jar/scalajson-shared.jar")) |
279 | (mkdir-p "build/classes") |
280 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
281 | "-d" "build/classes" |
282 | (find-files "jvm/src/main/scala" ".*.scala$")) |
283 | (mkdir-p "build/jar") |
284 | (invoke "jar" "-cf" "build/jar/scalajson-jvm.jar" |
285 | "-C" "build/classes" ".") |
286 | #t)) |
287 | (replace 'install |
288 | (install-jars "build"))))) |
289 | (native-inputs |
290 | `(("scala" ,scala-official))) |
291 | (home-page "") |
292 | (synopsis "") |
293 | (description "") |
294 | (license license:bsd-3))) |
295 | |
296 | ;; Latest is 0.13.0, but this version is required for scala-jsonnew |
297 | (define-public scala-jawn |
298 | (package |
299 | (name "scala-jawn") |
300 | (version "0.10.4") |
301 | (source (origin |
302 | (method url-fetch) |
303 | (uri (string-append "https://github.com/non/jawn/archive/v" |
304 | version ".tar.gz")) |
305 | (file-name (string-append name "-" version ".tar.gz")) |
306 | (sha256 |
307 | (base32 |
308 | "1iic1rp7w7vsy0xhi40rcp339vcq5b4b46f51qrkfpv433f7hafi")))) |
309 | (build-system ant-build-system) |
310 | (arguments |
311 | `(#:tests? #f |
312 | #:phases |
313 | (modify-phases %standard-phases |
314 | (replace 'build |
315 | (lambda _ |
316 | (mkdir-p "build/classes") |
317 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
318 | "-d" "build/classes" |
319 | (find-files "util/src/main/scala" ".*.scala$")) |
320 | (mkdir-p "build/jar") |
321 | (invoke "jar" "-cf" "build/jar/jawn-util.jar" |
322 | "-C" "build/classes" ".") |
323 | (delete-file-recursively "build/classes") |
324 | (setenv "CLASSPATH" (string-append (getenv "CLASSPATH") ":build/jar/scalajson-shared.jar")) |
325 | (mkdir-p "build/classes") |
326 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
327 | "-d" "build/classes" |
328 | (find-files "parser/src/main/scala" ".*.scala$")) |
329 | (mkdir-p "build/jar") |
330 | (invoke "jar" "-cf" "build/jar/jawn-parser.jar" |
331 | "-C" "build/classes" ".") |
332 | #t)) |
333 | (replace 'install |
334 | (install-jars "build"))))) |
335 | (native-inputs |
336 | `(("scala" ,scala-official))) |
337 | (home-page "") |
338 | (synopsis "") |
339 | (description "") |
340 | (license license:bsd-3))) |
341 | |
342 | (define-public scala-sjsonnew-support-scalajson |
343 | (package |
344 | (inherit scala-sjsonnew) |
345 | (name "scala-sjsonnew-support-scalajson") |
346 | (arguments |
347 | `(#:tests? #f |
348 | #:phases |
349 | (modify-phases %standard-phases |
350 | (replace 'build |
351 | (lambda _ |
352 | (substitute* (find-files "." ".*.scala") |
353 | (("shaded.scalajson") "scalajson")) |
354 | (mkdir-p "build/classes") |
355 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
356 | "-d" "build/classes" |
357 | (find-files "support/scalajson/src/main/scala" ".*.scala$")) |
358 | (mkdir-p "build/jar") |
359 | (invoke "jar" "-cf" "build/jar/sjsonnew-support-scalajson.jar" |
360 | "-C" "build/classes" ".") |
361 | #t)) |
362 | (replace 'install |
363 | (install-jars "build"))))) |
364 | (inputs |
365 | `(("scala-sjsonnew" ,scala-sjsonnew) |
366 | ("scala-scalajson" ,scala-scalajson) |
367 | ("scala-jawn" ,scala-jawn))))) |
368 | |
369 | (define-public scala-sjsonnew-support-murmurhash |
370 | (package |
371 | (inherit scala-sjsonnew) |
372 | (name "scala-sjsonnew-support-murmurhash") |
373 | (arguments |
374 | `(#:tests? #f |
375 | #:phases |
376 | (modify-phases %standard-phases |
377 | (replace 'build |
378 | (lambda _ |
379 | (mkdir-p "build/classes") |
380 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
381 | "-d" "build/classes" |
382 | (find-files "support/murmurhash/src/main/scala" ".*.scala$")) |
383 | (mkdir-p "build/jar") |
384 | (invoke "jar" "-cf" "build/jar/sjsonnew-support-murmurhash.jar" |
385 | "-C" "build/classes" ".") |
386 | #t)) |
387 | (replace 'install |
388 | (install-jars "build"))))) |
389 | (inputs |
390 | `(("scala-sjsonnew" ,scala-sjsonnew))))) |
391 | |
392 | (define-public scala-kind-projector |
393 | (package |
394 | (name "scala-kind-projector") |
395 | (version "0.9.9") |
396 | (source (origin |
397 | (method url-fetch) |
398 | (uri (string-append "https://github.com/non/kind-projector/archive/v" |
399 | version ".tar.gz")) |
400 | (file-name (string-append name "-" version ".tar.gz")) |
401 | (sha256 |
402 | (base32 |
403 | "125amrhy7ri0z4bk2jzghg7341fm88a0p6gw3qg5diminlpaida3")))) |
404 | (build-system ant-build-system) |
405 | (arguments |
406 | `(#:phases |
407 | (modify-phases %standard-phases |
408 | (replace 'build |
409 | (lambda _ |
410 | (mkdir-p "build/classes") |
411 | (mkdir-p "build/jar") |
412 | (copy-recursively "src/main/resources" "build/classes") |
413 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
414 | "-d" "build/classes" |
415 | (find-files "src/main/scala" ".*.scala$")) |
416 | (invoke "jar" "-cf" "build/jar/kind-projector.jar" |
417 | "-C" "build/classes" ".") |
418 | #t)) |
419 | (replace 'check |
420 | (lambda _ |
421 | (mkdir-p "build/test-classes") |
422 | (copy-recursively "src/test/resources" "build/test-classes") |
423 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
424 | "-Xplugin:build/jar/kind-projector.jar" |
425 | "-d" "build/test-classes" |
426 | (find-files "src/test/scala" ".*.scala$")) |
427 | ;; TODO: actually run the tests... :D |
428 | #t)) |
429 | (replace 'install |
430 | (install-jars "build"))))) |
431 | (native-inputs |
432 | `(("scala-official" ,scala-official) |
433 | ("java-junit" ,java-junit))) |
434 | (home-page "https://github.com/non/kind-projector") |
435 | (synopsis "Scala compiler plugin for type lambda") |
436 | (description "Kind projector is a Scala compiler plugin for making type |
437 | lambdas (type projections) easier to write.") |
438 | (license license:expat))) |
439 | |
440 | (define-public sbt-util |
441 | (package |
442 | (name "sbt-util") |
443 | (version "1.2.4") |
444 | (source |
445 | (origin |
446 | (method url-fetch) |
447 | (uri (string-append "https://github.com/sbt/util/archive/v" |
448 | version ".tar.gz")) |
449 | (file-name (string-append "sbt-util-" version ".tar.gz")) |
450 | (sha256 |
451 | (base32 |
452 | "04ss1q4rl272ryxys05zmd4j2gm3aanaiqn6dmqbh6jii934pyxg")))) |
453 | (build-system ant-build-system) |
454 | (arguments |
455 | `(#:tests? #f |
456 | #:phases |
457 | (modify-phases %standard-phases |
458 | (add-before 'build 'fix-sjsonnew |
459 | (lambda _ |
460 | (substitute* (find-files "." ".*.scala") |
461 | (("sjsonnew.shaded.") "")) |
462 | #t)) |
463 | (replace 'build |
464 | ,(sbt-building-phase |
465 | '(("internal/" "util-position") |
466 | ("internal/" "util-control") |
467 | ("internal/" "util-interface") |
468 | ("internal/" "util-logging") |
469 | ("internal/" "util-relation") |
470 | ("internal/" "util-scripted") |
471 | ("" "util-cache") |
472 | ("" "util-tracking")))) |
473 | (replace 'install |
474 | (install-jars "."))))) |
475 | (inputs |
476 | `(("java-log4j-api" ,java-log4j-api-for-sbt) |
477 | ("java-log4j-core" ,java-log4j-core-for-sbt) |
478 | ("sbt-io" ,sbt-io) |
479 | ("scala-jawn" ,scala-jawn) |
480 | ("scala-scalajson" ,scala-scalajson) |
481 | ("scala-sjsonnew" ,scala-sjsonnew) |
482 | ("scala-sjsonnew-support-murmurhash" ,scala-sjsonnew-support-murmurhash) |
483 | ("scala-sjsonnew-support-scalajson" ,scala-sjsonnew-support-scalajson))) |
484 | (native-inputs |
485 | `(("scala" ,scala-official))) |
486 | (home-page "https://www.scala-sbt.org/") |
487 | (synopsis "") |
488 | (description "") |
489 | (license license:bsd-3))) |
490 | |
491 | (define-public java-log4j-api-for-sbt |
492 | (package |
493 | (inherit java-log4j-api) |
494 | (version "2.8.1") |
495 | ;(version "2.11.1") |
496 | (arguments |
497 | (ensure-keyword-arguments (package-arguments java-log4j-api) |
498 | `(#:source-dir "src/main/java" |
499 | #:phases |
500 | (modify-phases %standard-phases |
501 | (add-after 'unpack 'chdir |
502 | (lambda _ |
503 | (chdir "log4j-api") |
504 | #t)) |
505 | (add-before 'build 'fix-ambiguous |
506 | (lambda _ |
507 | (substitute* "src/main/java/org/apache/logging/log4j/message/MapMessage.java" |
508 | (("append\\(data") "append((CharSequence)data")) |
509 | #t)))))) |
510 | (source (origin |
511 | (method url-fetch) |
512 | (uri (string-append "mirror://apache/logging/log4j/" version |
513 | "/apache-log4j-" version "-src.tar.gz")) |
514 | (sha256 |
515 | (base32 |
516 | "0x5gksgh0jkvd7k70rqrs2hy3glms0pkj6lhl26m6f83x1b6kvdm")))))) |
517 | ;"1dhxnd0348is21w93m1rv2sbfwyx83rv63adnbd0bgjq01gzbvic")))))) |
518 | |
519 | ;; More dependencies needed |
520 | (define-public java-log4j-core-for-sbt |
521 | (package |
522 | (inherit java-log4j-api-for-sbt) |
523 | (name "java-log4j-core") |
524 | (inputs |
525 | `(("java-osgi-core" ,java-osgi-core) |
526 | ("java-hamcrest-core" ,java-hamcrest-core) |
527 | ("java-log4j-api" ,java-log4j-api-for-sbt) |
528 | ("java-mail" ,java-mail) |
529 | ("java-jansi" ,java-jansi) |
530 | ("java-jboss-jms-api-spec" ,java-jboss-jms-api-spec) |
531 | ("java-jctools-core" ,java-jctools-core) |
532 | ("java-lmax-disruptor" ,java-lmax-disruptor) |
533 | ("java-kafka" ,java-kafka-clients) |
534 | ("java-datanucleus-javax-persistence" ,java-datanucleus-javax-persistence) |
535 | ("java-fasterxml-jackson-annotations" ,java-fasterxml-jackson-annotations) |
536 | ("java-fasterxml-jackson-core" ,java-fasterxml-jackson-core) |
537 | ("java-fasterxml-jackson-databind" ,java-fasterxml-jackson-databind) |
538 | ("java-fasterxml-jackson-dataformat-xml" ,java-fasterxml-jackson-dataformat-xml) |
539 | ("java-fasterxml-jackson-dataformat-yaml" ,java-fasterxml-jackson-dataformat-yaml) |
540 | ("java-commons-compress" ,java-commons-compress) |
541 | ("java-commons-csv" ,java-commons-csv) |
542 | ("java-conversantmedia-disruptor" ,java-conversantmedia-disruptor) |
543 | ("java-jcommander" ,java-jcommander) |
544 | ("java-stax2-api" ,java-stax2-api) |
545 | ("java-jeromq" ,java-jeromq) |
546 | ("java-junit" ,java-junit))) |
547 | (native-inputs |
548 | `(("hamcrest" ,java-hamcrest-all) |
549 | ("java-commons-io" ,java-commons-io) |
550 | ("java-commons-lang3" ,java-commons-lang3) |
551 | ("slf4j" ,java-slf4j-api))) |
552 | (arguments |
553 | `(#:tests? #f ; tests require more dependencies |
554 | #:test-dir "src/test" |
555 | #:source-dir "src/main/java" |
556 | #:jar-name "log4j-core.jar" |
557 | #:make-flags |
558 | (list (string-append "-Ddist.dir=" (assoc-ref %outputs "out") |
559 | "/share/java")) |
560 | #:phases |
561 | (modify-phases %standard-phases |
562 | (add-after 'unpack 'enter-dir |
563 | (lambda _ (chdir "log4j-core") #t)) |
564 | (add-before 'build 'fix-ambiguous |
565 | (lambda _ |
566 | (substitute* "src/main/java/org/apache/logging/log4j/core/pattern/MapPatternConverter.java" |
567 | (("append\\(sortedMap") "append((CharSequence)sortedMap")) |
568 | #t))))) |
569 | (synopsis "Core component of the Log4j framework") |
570 | (description "This package provides the core component of the Log4j |
571 | logging framework for Java."))) |
572 | |
573 | |
574 | ;; TODO: Update to 2.0.6? |
575 | (define-public java-swoval-apple-file-events |
576 | (package |
577 | (name "java-swoval-apple-file-events") |
578 | (version "1.3.2") |
579 | (source (origin |
580 | (method url-fetch) |
581 | (uri (string-append "https://github.com/swoval/swoval/archive/v" |
582 | version ".tar.gz")) |
583 | (file-name (string-append "scala-swoval-" version ".tar.gz")) |
584 | (sha256 |
585 | (base32 |
586 | "0ivrc4lcali84xp8frkjb2zi1l3lw8pim9xbkfah5iyj120gw6mq")))) |
587 | (build-system ant-build-system) |
588 | (arguments |
589 | `(#:tests? #f; no tests |
590 | #:jar-name "apple-file-events.jar" |
591 | #:source-dir "apple-file-events/jvm/src/main/java")) |
592 | (home-page "") |
593 | (synopsis "") |
594 | (description "") |
595 | (license license:expat))) |
596 | |
597 | (define-public sbt-io |
598 | (package |
599 | (name "sbt-io") |
600 | (version "1.2.2") |
601 | (source |
602 | (origin |
603 | (method url-fetch) |
604 | (uri (string-append "https://github.com/sbt/io/archive/v" |
605 | version ".tar.gz")) |
606 | (file-name (string-append name "-" version ".tar.gz")) |
607 | (sha256 |
608 | (base32 |
609 | "0f9yjrrcr15kx2fn7w8f8swpx2dsx5zn95yg744l9gi2ri2qpyj5")))) |
610 | (build-system ant-build-system) |
611 | (arguments |
612 | `(#:tests? #f |
613 | #:phases |
614 | (modify-phases %standard-phases |
615 | (replace 'build |
616 | (lambda* (#:key inputs #:allow-other-keys) |
617 | (mkdir-p "build/classes") |
618 | (apply invoke "scalac" "-classpath" |
619 | (string-append (getenv "CLASSPATH") ":build/util-interface") |
620 | "-d" "build/classes" |
621 | (append |
622 | (find-files "io/src/main/java" ".*.java$") |
623 | (find-files "io/src/main/scala" ".*.scala$") |
624 | (find-files "io/src/main/contraband-scala" ".*.scala$"))) |
625 | (invoke "jar" "cf" "sbt-io.jar" "-C" "build/classes" ".") |
626 | #t)) |
627 | (replace 'install |
628 | (install-jars "."))))) |
629 | (inputs |
630 | `(("java-native-access" ,java-native-access) |
631 | ("java-native-access-platform" ,java-native-access-platform) |
632 | ("java-swoval-apple-file-events" ,java-swoval-apple-file-events) |
633 | ("scala" ,scala-official))) |
634 | (home-page "https://www.scala-sbt.org/") |
635 | (synopsis "") |
636 | (description "") |
637 | (license license:bsd-3))) |
638 | |
639 | (define-public scala-ssl-config |
640 | (package |
641 | (name "scala-ssl-config") |
642 | (version "0.3.7") |
643 | (source (origin |
644 | (method url-fetch) |
645 | (uri (string-append "https://github.com/lightbend/ssl-config/archive/v" |
646 | version ".tar.gz")) |
647 | (file-name (string-append name "-" version ".tar.gz")) |
648 | (sha256 |
649 | (base32 |
650 | "0sg477705flhcdnhjyl8v9jkhx1xfsnc73md8iva1agylpj5546f")))) |
651 | (build-system ant-build-system) |
652 | (arguments |
653 | `(#:tests? #f |
654 | #:phases |
655 | (modify-phases %standard-phases |
656 | (replace 'build |
657 | (lambda* (#:key inputs #:allow-other-keys) |
658 | (mkdir-p "build/classes") |
659 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
660 | "-d" "build/classes" |
661 | (find-files "ssl-config-core/src/main/scala" ".*.scala$")) |
662 | (invoke "jar" "cf" "okhttp.jar" "-C" "build/classes" ".") |
663 | #t)) |
664 | (replace 'install |
665 | (install-jars "."))))) |
666 | (inputs |
667 | `(("java-config" ,java-config))) |
668 | (native-inputs |
669 | `(("scala" ,scala-official))) |
670 | (home-page "") |
671 | (synopsis "") |
672 | (description "") |
673 | (license license:asl2.0))) |
674 | |
675 | (define-public scala-okhttp |
676 | (package |
677 | (name "scala-okhttp") |
678 | (version "0.3.1") |
679 | (source (origin |
680 | (method url-fetch) |
681 | (uri (string-append "https://github.com/eed3si9n/gigahorse/archive/v" |
682 | version ".tar.gz")) |
683 | (file-name (string-append name "-" version ".tar.gz")) |
684 | (sha256 |
685 | (base32 |
686 | "06ac03vr0cyr63zw0ibdwmswa03crm6i8mb00y69zpkm2jxqq2mb")))) |
687 | (build-system ant-build-system) |
688 | (arguments |
689 | `(#:tests? #f |
690 | #:phases |
691 | (modify-phases %standard-phases |
692 | (replace 'build |
693 | (lambda* (#:key inputs #:allow-other-keys) |
694 | (mkdir-p "build/classes") |
695 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
696 | "-d" "build/classes" |
697 | (append |
698 | (find-files "core/src/main/scala" ".*.scala$") |
699 | (find-files "okhttp/src/main/scala" ".*.scala$") |
700 | (find-files "core/src/main/contraband-scala" ".*.scala$"))) |
701 | (invoke "jar" "cf" "okhttp.jar" "-C" "build/classes" ".") |
702 | #t)) |
703 | (replace 'install |
704 | (install-jars "."))))) |
705 | (inputs |
706 | `(("java-config" ,java-config) |
707 | ("java-reactive-streams" ,java-reactive-streams) |
708 | ("java-slf4j-api" ,java-slf4j-api) |
709 | ("java-okhttp" ,java-okhttp) |
710 | ("java-okio" ,java-okio) |
711 | ("scala-ssl-config" ,scala-ssl-config))) |
712 | (native-inputs |
713 | `(("scala" ,scala-official))) |
714 | (home-page "") |
715 | (synopsis "") |
716 | (description "") |
717 | (license license:asl2.0))) |
718 | |
719 | (define-public sbt-launcher |
720 | (package |
721 | (name "sbt-launcher") |
722 | (version "1.0.4") |
723 | (source (origin |
724 | (method url-fetch) |
725 | (uri (string-append "https://github.com/sbt/launcher/archive/v" version ".tar.gz")) |
726 | (file-name (string-append name "-" version ".tar.gz")) |
727 | (sha256 |
728 | (base32 |
729 | "1a9dfqm47fn2nbqvjl723s0h16jf71cgnilg1i7gz6h4a7i0snak")))) |
730 | (build-system ant-build-system) |
731 | (arguments |
732 | `(#:tests? #f |
733 | #:phases |
734 | (modify-phases %standard-phases |
735 | (replace 'build |
736 | (lambda* (#:key inputs #:allow-other-keys) |
737 | (substitute* "launcher-implementation/src/main/input_sources/CrossVersionUtil.scala" |
738 | (("\\$\\{\\{cross.package0\\}\\}") "xsbt") |
739 | (("\\$\\{\\{cross.package1\\}\\}") "boot")) |
740 | (mkdir-p "build/classes") |
741 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
742 | "-d" "build/classes" |
743 | (append |
744 | (find-files "launcher-interface/src/main/java" ".*.java$") |
745 | (find-files "launcher-implementation/src/main/input_sources" ".*.scala$") |
746 | (find-files "launcher-implementation/src/main/scala" ".*.scala$"))) |
747 | (apply invoke "javac" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") |
748 | "-d" "build/classes" |
749 | (find-files "launcher-interface/src/main/java" ".*.java$")) |
750 | (invoke "jar" "cf" "sbt-launcher.jar" "-C" "build/classes" ".") |
751 | #t)) |
752 | (replace 'install |
753 | (install-jars "."))))) |
754 | (inputs |
755 | `(("java-apache-ivy" ,java-apache-ivy))) |
756 | (native-inputs |
757 | `(("scala" ,scala-official))) |
758 | (home-page "") |
759 | (synopsis "") |
760 | (description "") |
761 | (license license:bsd-3))) |
762 | |
763 | ;; https://index.scala-lang.org/eed3si9n/gigahorse/gigahorse-okhttp/0.3.0?target=_2.12 |
764 | (define-public sbt-librarymanagement |
765 | (package |
766 | (name "sbt-librarymanagement") |
767 | (version "1.2.4") |
768 | (source (origin |
769 | (method url-fetch) |
770 | (uri (string-append "https://github.com/sbt/librarymanagement/archive/v" version ".tar.gz")) |
771 | (file-name (string-append name "-" version ".tar.gz")) |
772 | (sha256 |
773 | (base32 |
774 | "0g37agv3xkq1fjl9a25ybcdk4d5aq1m81rz5d2a8zvny135m73gl")) |
775 | (modules '((guix build utils))) |
776 | (snippet |
777 | `(for-each delete-file (find-files "." ".*.jar"))))) |
778 | (build-system ant-build-system) |
779 | (arguments |
780 | `(#:tests? #f |
781 | #:phases |
782 | (modify-phases %standard-phases |
783 | (add-before 'build 'fix-sjsonnew |
784 | (lambda _ |
785 | (substitute* (find-files "." ".*.scala") |
786 | (("sjsonnew.shaded.") "")) |
787 | #t)) |
788 | (replace 'build |
789 | ,(sbt-building-phase |
790 | `(("" "core") |
791 | ("" "ivy")))) |
792 | (replace 'install |
793 | (install-jars "."))))) |
794 | (inputs |
795 | `(("java-apache-ivy" ,java-apache-ivy) |
796 | ("java-okhttp" ,java-okhttp) |
797 | ("java-okhttp-urlconnection" ,java-okhttp-urlconnection) |
798 | ("java-okio" ,java-okio) |
799 | ("sbt-launcher" ,sbt-launcher) |
800 | ("sbt-util" ,sbt-util) |
801 | ("sbt-io" ,sbt-io) |
802 | ("scala-jawn" ,scala-jawn) |
803 | ("scala-okhttp" ,scala-okhttp) |
804 | ("scala-scalajson" ,scala-scalajson) |
805 | ("scala-sjsonnew" ,scala-sjsonnew) |
806 | ("scala-sjsonnew-support-murmurhash" ,scala-sjsonnew-support-murmurhash) |
807 | ("scala-sjsonnew-support-scalajson" ,scala-sjsonnew-support-scalajson))) |
808 | (native-inputs |
809 | `(("scala" ,scala-official))) |
810 | (home-page "") |
811 | (synopsis "") |
812 | (description "") |
813 | ;; From core/NOTICE |
814 | ;; XXX: WARNING: no license in ivy/ |
815 | (license license:bsd-2))) |
816 | |
817 | ;; LICENSE? |
818 | (define-public scala-protoc-bridge |
819 | (package |
820 | (name "scala-protoc-bridge") |
821 | (version "0.7.3") |
822 | (source |
823 | (origin |
824 | (method url-fetch) |
825 | (uri (string-append "https://github.com/scalapb/protoc-bridge/archive/v" |
826 | version ".tar.gz")) |
827 | (file-name (string-append name "-" version ".tar.gz")) |
828 | (sha256 |
829 | (base32 |
830 | "17xjsa70h0w80rhps00kj42fmghk98c789aaa19g4bii2j1ckry8")))) |
831 | (build-system ant-build-system) |
832 | (arguments |
833 | `(#:phases |
834 | (modify-phases %standard-phases |
835 | (add-before 'build 'fix-script |
836 | (lambda _ |
837 | (substitute* "src/main/scala/protocbridge/frontend/PosixPluginFrontend.scala" |
838 | (("/usr/bin/env sh") (which "sh"))) |
839 | #t)) |
840 | (replace 'build |
841 | (lambda _ |
842 | (mkdir-p "build/classes") |
843 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
844 | "-d" "build/classes" |
845 | (append |
846 | (find-files "src/main/scala" ".*.scala$") |
847 | (find-files "src/main/java" ".*.java$"))) |
848 | (apply invoke "javac" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") |
849 | "-d" "build/classes" |
850 | (find-files "src/main/java" ".*.java$")) |
851 | (mkdir-p "build/jar") |
852 | (invoke "jar" "-cf" "build/jar/protoc-bridge.jar" |
853 | "-C" "build/classes" ".") |
854 | #t)) |
855 | (replace 'check |
856 | (lambda _ |
857 | (mkdir-p "build/test-classes") |
858 | ;(apply invoke "scalac" "-classpath" (string-append (getenv "CLASSPATH") |
859 | ; ":build/classes") |
860 | ; "-d" "build/test-classes" |
861 | ; (find-files "src/test/scala" ".*.scala$")) |
862 | ;; TODO: actually run the tests |
863 | #t)) |
864 | (replace 'install |
865 | (install-jars "build"))))) |
866 | (native-inputs |
867 | `(("scala" ,scala-official))) |
868 | (home-page "") |
869 | (synopsis "") |
870 | (description "") |
871 | (license license:bsd-3))) |
872 | |
873 | (define-public scala-sourcecode |
874 | (package |
875 | (name "scala-sourcecode") |
876 | (version "0.1.5") |
877 | (source (origin |
878 | (method url-fetch) |
879 | (uri (string-append "https://github.com/lihaoyi/sourcecode/archive/v" |
880 | version ".tar.gz")) |
881 | (file-name (string-append name "-" version ".tar.gz")) |
882 | (sha256 |
883 | (base32 |
884 | "1cq15cxsv0j6xdrl566ywmab5il3239ja4cbgm39ihyn0yw2q1q4")))) |
885 | (build-system ant-build-system) |
886 | (arguments |
887 | `(#:tests? #f; in sourcecode/shared/src/test |
888 | #:phases |
889 | (modify-phases %standard-phases |
890 | (add-before 'build 'copy-compat |
891 | (lambda _ |
892 | (with-directory-excursion "sourcecode/shared/src/main" |
893 | (copy-file "scala-2.11/sourcecode/Compat.scala" |
894 | "scala/sourcecode/Compat.scala")) |
895 | #t)) |
896 | (replace 'build |
897 | (lambda _ |
898 | (mkdir-p "build/classes") |
899 | (mkdir-p "build/jar") |
900 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
901 | "-d" "build/classes" |
902 | (find-files "sourcecode/shared/src/main/scala" ".*.scala$")) |
903 | (invoke "jar" "cf" "build/jar/sourcecode.jar" "-C" "build/classes" ".") |
904 | #t)) |
905 | (replace 'install |
906 | (install-jars "build"))))) |
907 | (native-inputs |
908 | `(("scala" ,scala-official))) |
909 | (home-page "") |
910 | (synopsis "") |
911 | (description "") |
912 | (license license:expat))) |
913 | |
914 | (define-public scala-acyclic |
915 | (package |
916 | (name "scala-acyclic") |
917 | (version "0.1.8") |
918 | (source (origin |
919 | (method url-fetch) |
920 | (uri (string-append "https://github.com/lihaoyi/acyclic/archive/v" |
921 | version ".tar.gz")) |
922 | (file-name (string-append name "-" version ".tar.gz")) |
923 | (sha256 |
924 | (base32 |
925 | "0c26qnjfhihn06sf17bxskacjcr51s03ygcmj8fp5vdzgcyfh7dl")))) |
926 | (build-system ant-build-system) |
927 | (arguments |
928 | `(#:tests? #f; in sourcecode/shared/src/test |
929 | #:phases |
930 | (modify-phases %standard-phases |
931 | (add-before 'build 'copy-compat |
932 | (lambda _ |
933 | (with-directory-excursion "src/main" |
934 | (copy-file "scala-2.10_2.12/acyclic/plugin/Compat.scala" |
935 | "scala/acyclic/plugin/Compat.scala")) |
936 | #t)) |
937 | (replace 'build |
938 | (lambda _ |
939 | (mkdir-p "build/classes") |
940 | (mkdir-p "build/jar") |
941 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
942 | "-d" "build/classes" |
943 | (find-files "src/main/scala" ".*.scala$")) |
944 | (copy-recursively "src/main/resources" "build/classes") |
945 | (invoke "jar" "cf" "build/jar/acyclic.jar" "-C" "build/classes" ".") |
946 | #t)) |
947 | (replace 'install |
948 | (install-jars "build"))))) |
949 | (native-inputs |
950 | `(("scala" ,scala-official))) |
951 | (home-page "") |
952 | (synopsis "") |
953 | (description "") |
954 | (license license:expat))) |
955 | |
956 | (define-public scala-fastparse |
957 | (package |
958 | (name "scala-fastparse") |
959 | (version "2.1.0") |
960 | (source (origin |
961 | (method url-fetch) |
962 | (uri (string-append "https://github.com/lihaoyi/fastparse/archive/" |
963 | version ".tar.gz")) |
964 | (file-name (string-append name "-" version ".tar.gz")) |
965 | (sha256 |
966 | (base32 |
967 | "1h8s3izykv3x2g7klihk03mbnjcp23f2613827y62kdk6x9q6yjs")))) |
968 | (build-system ant-build-system) |
969 | (arguments |
970 | `(#:tests? #f; in fastpares/test/src |
971 | #:modules |
972 | ((guix build ant-build-system) |
973 | (guix build java-utils) |
974 | (guix build utils) |
975 | (srfi srfi-1)) |
976 | #:imported-modules |
977 | ((srfi srfi-1) ; for iota |
978 | ,@%ant-build-system-modules) |
979 | #:phases |
980 | (modify-phases %standard-phases |
981 | (add-before 'build 'generate-sources |
982 | (lambda _ |
983 | (define (tuple num) |
984 | (let* ((ts (map (lambda (n) (string-append "T" (number->string n))) |
985 | (iota num 1))) |
986 | (chunks (map (lambda (n) |
987 | (string-append "t._" (number->string n))) |
988 | (iota num 1))) |
989 | (chunkss (string-join chunks ", ")) |
990 | (tsD (string-join (reverse (cons "D" (reverse ts))) ",")) |
991 | (anys (string-join (map (const "Any") ts) ", ")) |
992 | (tss (string-join ts ", "))) |
993 | (format #t " |
994 | val BaseSequencer~a: Sequencer[(~a), Any, (~a, Any)] = |
995 | Sequencer0((t, d) => (~a, d)) |
996 | implicit def Sequencer~a[~a]: Sequencer[(~a), D, (~a)] = |
997 | BaseSequencer~a.asInstanceOf[Sequencer[(~a), D, (~a)]] |
998 | " num anys anys chunkss num tsD tss tsD num tss tsD))) |
999 | (with-output-to-file "fastparse/src/fastparse/SequencerGen.scala" |
1000 | (lambda _ |
1001 | (format #t "package fastparse |
1002 | trait SequencerGen[Sequencer[_, _, _]] extends LowestPriSequencer[Sequencer]{ |
1003 | protected[this] def Sequencer0[A, B, C](f: (A, B) => C): Sequencer[A, B, C] |
1004 | ") |
1005 | (for-each tuple (iota 20 2)) |
1006 | (format #t "} |
1007 | trait LowestPriSequencer[Sequencer[_, _, _]]{ |
1008 | protected[this] def Sequencer0[A, B, C](f: (A, B) => C): Sequencer[A, B, C] |
1009 | implicit def Sequencer1[T1, T2]: Sequencer[T1, T2, (T1, T2)] = Sequencer0{case (t1, t2) => (t1, t2)} |
1010 | } |
1011 | "))) |
1012 | #t)) |
1013 | (replace 'build |
1014 | (lambda _ |
1015 | (mkdir-p "build/classes") |
1016 | (mkdir-p "build/jar") |
1017 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
1018 | "-d" "build/classes" |
1019 | (find-files "fastparse/src" ".*.scala$")) |
1020 | (invoke "jar" "cf" "build/jar/fastparse.jar" "-C" "build/classes" ".") |
1021 | #t)) |
1022 | (replace 'install |
1023 | (install-jars "build"))))) |
1024 | (inputs |
1025 | `(("scala-sourcecode" ,scala-sourcecode))) |
1026 | (native-inputs |
1027 | `(("scala" ,scala-official))) |
1028 | (home-page "") |
1029 | (synopsis "") |
1030 | (description "") |
1031 | (license license:expat))) |
1032 | |
1033 | (define scala-fastparse1 |
1034 | (package |
1035 | (inherit scala-fastparse) |
1036 | (version "1.0.0") |
1037 | (source (origin |
1038 | (method url-fetch) |
1039 | (uri (string-append "https://github.com/lihaoyi/fastparse/archive/" |
1040 | version ".tar.gz")) |
1041 | (file-name (string-append "scala-fastparse-" version ".tar.gz")) |
1042 | (sha256 |
1043 | (base32 |
1044 | "14d44f23hl6ypfwlvnzkzcvv52a0xipm5wkp2glr184aik7w5pnb")))) |
1045 | (arguments |
1046 | `(#:tests? #f; in fastpares/test/src |
1047 | #:modules |
1048 | ((guix build ant-build-system) |
1049 | (guix build java-utils) |
1050 | (guix build utils) |
1051 | (srfi srfi-1)) |
1052 | #:imported-modules |
1053 | ((srfi srfi-1) ; for iota |
1054 | ,@%ant-build-system-modules) |
1055 | #:phases |
1056 | (modify-phases %standard-phases |
1057 | (add-before 'build 'copy-compat |
1058 | (lambda _ |
1059 | (with-directory-excursion "utils/shared/src/main" |
1060 | (copy-file "scala-2.11/fastparse/utils/Compat.scala" |
1061 | "scala/fastparse/utils/Compat.scala")) |
1062 | #t)) |
1063 | (add-before 'build 'generate-sources |
1064 | (lambda _ |
1065 | (define (tuple num) |
1066 | (let* ((ts (map (lambda (n) (string-append "T" (number->string n))) |
1067 | (iota num 1))) |
1068 | (chunks (map (lambda (n) |
1069 | (string-append "t._" (number->string n))) |
1070 | (iota num 1))) |
1071 | (chunkss (string-join chunks ", ")) |
1072 | (tsD (string-join (reverse (cons "D" (reverse ts))) ",")) |
1073 | (anys (string-join (map (const "Any") ts) ", ")) |
1074 | (tss (string-join ts ", "))) |
1075 | (format #t " |
1076 | val BaseSequencer~a: Sequencer[(~a), Any, (~a, Any)] = |
1077 | Sequencer0((t, d) => (~a, d)) |
1078 | implicit def Sequencer~a[~a]: Sequencer[(~a), D, (~a)] = |
1079 | BaseSequencer~a.asInstanceOf[Sequencer[(~a), D, (~a)]] |
1080 | " num anys anys chunkss num tsD tss tsD num tss tsD))) |
1081 | (with-output-to-file |
1082 | "fastparse/shared/src/main/scala/fastparse/core/SequencerGen.scala" |
1083 | (lambda _ |
1084 | (format #t "package fastparse.core |
1085 | trait SequencerGen[Sequencer[_, _, _]] extends LowestPriSequencer[Sequencer]{ |
1086 | protected[this] def Sequencer0[A, B, C](f: (A, B) => C): Sequencer[A, B, C] |
1087 | ") |
1088 | (for-each tuple (iota 20 2)) |
1089 | (format #t "} |
1090 | trait LowestPriSequencer[Sequencer[_, _, _]]{ |
1091 | protected[this] def Sequencer0[A, B, C](f: (A, B) => C): Sequencer[A, B, C] |
1092 | implicit def Sequencer1[T1, T2]: Sequencer[T1, T2, (T1, T2)] = Sequencer0{case (t1, t2) => (t1, t2)} |
1093 | } |
1094 | "))) |
1095 | #t)) |
1096 | (replace 'build |
1097 | (lambda _ |
1098 | (mkdir-p "build/classes") |
1099 | (mkdir-p "build/jar") |
1100 | (apply invoke "scalac" "-classpath" (getenv "CLASSPATH") |
1101 | "-d" "build/classes" |
1102 | (find-files "utils/shared/src/main/scala" ".*.scala$")) |
1103 | (apply invoke "scalac" "-classpath" |
1104 | (string-append (getenv "CLASSPATH") ":build/classes") |
1105 | "-d" "build/classes" |
1106 | (find-files "fastparse/shared/src/main/scala" ".*.scala$")) |
1107 | (invoke "jar" "cf" "build/jar/fastparse.jar" "-C" "build/classes" ".") |
1108 | #t)) |
1109 | (replace 'install |
1110 | (install-jars "build"))))) |
1111 | (inputs |
1112 | `(("scala-acyclic" ,scala-acyclic) |
1113 | ("scala-sourcecode" ,scala-sourcecode))))) |
1114 | |
1115 | ;; LICENSE? |
1116 | (define-public scala-protobuf |
1117 | (package |
1118 | (name "scala-protobuf") |
1119 | (version "0.8.3") |
1120 | (source (origin |
1121 | (method url-fetch) |
1122 | (uri (string-append "https://github.com/scalapb/ScalaPB/archive/v" |
1123 | version ".tar.gz")) |
1124 | (file-name (string-append name "-" version ".tar.gz")) |
1125 | (sha256 |
1126 | (base32 |
1127 | "0x6mfpyhzxh54dxh1pj3x952gyvp05m7vkj0c3p8ssx214r327kj")) |
1128 | (modules '((guix build utils))) |
1129 | (snippet |
1130 | `(delete-file-recursively "third_party")))) |
1131 | (build-system ant-build-system) |
1132 | (arguments |
1133 | `(#:tests? #f; TODO |
1134 | #:phases |
1135 | (modify-phases %standard-phases |
1136 | (add-before 'build 'generate-sources |
1137 | (lambda _ |
1138 | (with-output-to-file "compiler-plugin/src/main/scala/scalapb/compiler/Version.scala" |
1139 | (lambda _ |
1140 | (format #t "package scalapb.compiler |
1141 | object Version { |
1142 | val scalapbVersion = \"~a\" |
1143 | val protobufVersion = \"~a\" |
1144 | val grpcJavaVersion = \"~a\" |
1145 | }" ,version ,(package-version protobuf) "TODO"))) |
1146 | (mkdir-p "compiler-plugin/src/main/scala/scalapb/compiler/internal") |
1147 | (copy-file |
1148 | "scalapb-runtime/shared/src/main/scala/scalapb/Encoding.scala" |
1149 | "compiler-plugin/src/main/scala/scalapb/compiler/internal/Encoding.scala") |
1150 | (substitute* "compiler-plugin/src/main/scala/scalapb/compiler/internal/Encoding.scala" |
1151 | (("package scalapb") "package scalapb.internal")) |
1152 | #t)) |
1153 | (add-before 'build 'merge-runtime |
1154 | (lambda _ |
1155 | (copy-recursively "scalapb-runtime/shared/src" "scalapb-runtime/src") |
1156 | (copy-recursively "scalapb-runtime/jvm/src" "scalapb-runtime/src") |
1157 | #t)) |
1158 | (add-before 'build 'copy-compat |
1159 | (lambda _ |
1160 | (with-directory-excursion "scalapb-runtime/src/main" |
1161 | (copy-file "scala-2.11/scalapb/textformat/ParserCompat.scala" |
1162 | "scala/scalapb/textformat/ParserCompat.scala")) |
1163 | #t)) |
1164 | (replace 'build |
1165 | ,(sbt-building-phase |
1166 | '(("lenses/" "shared") |
1167 | ("" "scalapb-runtime") |
1168 | ("" "compiler-plugin") |
1169 | ("" "scalapbc")))) |
1170 | (replace 'install |
1171 | (install-jars "build")) |
1172 | (add-after 'install 'install-bin |
1173 | (lambda* (#:key inputs outputs #:allow-other-keys) |
1174 | (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) |
1175 | (mkdir-p bin) |
1176 | (with-output-to-file (string-append bin "/scalapbc") |
1177 | (lambda _ |
1178 | (format #t "#!~a |
1179 | java -cp ~a scalapb.ScalaPBC $@\n" (which "bash") |
1180 | (string-join |
1181 | (append |
1182 | (find-files (assoc-ref outputs "out") ".*.jar") |
1183 | (find-files (assoc-ref inputs "java-protobuf") ".*.jar") |
1184 | (find-files (assoc-ref inputs "java-protoc-jar") ".*.jar") |
1185 | (find-files (assoc-ref inputs "scala-fastparse1") ".*.jar") |
1186 | (find-files (assoc-ref inputs "scala-protoc-bridge") ".*.jar") |
1187 | (find-files (assoc-ref inputs "scala-sourcecode") ".*.jar") |
1188 | (find-files (assoc-ref inputs "scala") ".*.jar")) |
1189 | ":")))) |
1190 | (chmod (string-append bin "/scalapbc") #o755)) |
1191 | #t))))) |
1192 | (inputs |
1193 | `(("java-protobuf" ,java-protobuf) |
1194 | ("java-protoc-jar" ,java-protoc-jar) |
1195 | ("scala-fastparse1" ,scala-fastparse1) |
1196 | ("scala-protoc-bridge" ,scala-protoc-bridge) |
1197 | ("scala-sourcecode" ,scala-sourcecode))) |
1198 | (native-inputs |
1199 | `(("protobuf" ,protobuf) |
1200 | ("scala" ,scala-official))) |
1201 | (home-page "") |
1202 | (synopsis "") |
1203 | (description "") |
1204 | (license license:bsd-3))) |
1205 | |
1206 | (define-public sbt-sbinary |
1207 | (package |
1208 | (name "sbt-sbinary") |
1209 | (version "0.5.0") |
1210 | (source |
1211 | (origin |
1212 | (method url-fetch) |
1213 | (uri (string-append "https://github.com/sbt/sbinary/archive/v" |
1214 | version ".tar.gz")) |
1215 | (file-name (string-append "sbt-util-" version ".tar.gz")) |
1216 | (sha256 |
1217 | (base32 |
1218 | "12mcny4flfc6zbgncjwqljrsg6qw7azagkackyqcp4gmv9ssw99f")))) |
1219 | (build-system ant-build-system) |
1220 | (arguments |
1221 | `(#:tests? #f |
1222 | #:phases |
1223 | (modify-phases %standard-phases |
1224 | (add-before 'build 'generate-fmpp |
1225 | (lambda _ |
1226 | (invoke "fmpp" "-U" "all" "-S" "core/src/main/fmpp" "-O" |
1227 | "core/src/main/scala") |
1228 | #t)) |
1229 | (replace 'build |
1230 | (lambda* (#:key inputs #:allow-other-keys) |
1231 | (mkdir-p "build/classes") |
1232 | (apply invoke "scalac" "-classpath" |
1233 | (string-append (getenv "CLASSPATH") ":build/util-interface") |
1234 | "-d" "build/classes" |
1235 | (append |
1236 | (find-files "core/src/main/scala-2.13-" ".*.scala$") |
1237 | (find-files "core/src/main/scala" ".*.scala$"))) |
1238 | (invoke "jar" "cf" "sbt-sbinary.jar" "-C" "build/classes" ".") |
1239 | #t)) |
1240 | (replace 'install |
1241 | (install-jars "."))))) |
1242 | (native-inputs |
1243 | `(("java-fmpp" ,java-fmpp) |
1244 | ("scala" ,scala-official))) |
1245 | (home-page "https://www.scala-sbt.org/") |
1246 | (synopsis "") |
1247 | (description "") |
1248 | (license license:bsd-3))) |
1249 | |
1250 | (define-public sbt-zinc |
1251 | (package |
1252 | (name "sbt-zinc") |
1253 | (version "1.2.5") |
1254 | (source |
1255 | (origin |
1256 | (method url-fetch) |
1257 | (uri (string-append "https://github.com/sbt/zinc/archive/v" |
1258 | version ".tar.gz")) |
1259 | (file-name (string-append name "-" version ".tar.gz")) |
1260 | (sha256 |
1261 | (base32 |
1262 | "1b01nv3dk3g7jx59jnzp2m2va5brhmds4bpgp824fnmp2fdjzgl0")))) |
1263 | (build-system ant-build-system) |
1264 | (arguments |
1265 | `(#:tests? #f |
1266 | #:phases |
1267 | (modify-phases %standard-phases |
1268 | (add-before 'build 'generate-protobuf |
1269 | (lambda _ |
1270 | (invoke "scalapbc" |
1271 | (string-append |
1272 | "-v" |
1273 | (string-delete #\. ,(package-version protobuf))) |
1274 | "--scala_out=internal/zinc-persist/src/main/scala" |
1275 | "internal/zinc-persist/src/main/protobuf/schema.proto") |
1276 | #t)) |
1277 | (add-before 'build 'use-correct-class |
1278 | (lambda _ |
1279 | ;; Because of our way of compiling, some classes are present |
1280 | ;; in excess in the classpath, and sometimes are imported |
1281 | ;; instead of the correct one. e.g. is AnalysisCallback imported |
1282 | ;; as xsbti.AnalysisCallback and inc.AnalysisCallback |
1283 | (with-directory-excursion "internal/zinc-compile-core/src/main/scala" |
1284 | (substitute* "sbt/internal/inc/AnalyzingCompiler.scala" |
1285 | ((": AnalysisCallback") ": xsbti.AnalysisCallback"))) |
1286 | #t)) |
1287 | (replace 'build |
1288 | ,(sbt-building-phase |
1289 | '(("internal/" "compiler-interface") |
1290 | ("internal/" "zinc-classpath") |
1291 | ("internal/" "zinc-classfile") |
1292 | ("internal/" "zinc-apiinfo") |
1293 | ("internal/" "zinc-core") |
1294 | ("internal/" "zinc-persist") |
1295 | ("internal/" "zinc-compile-core") |
1296 | ("internal/" "zinc-ivy-integration") |
1297 | ("" "zinc")))) |
1298 | (replace 'install |
1299 | (install-jars "."))))) |
1300 | (inputs |
1301 | `(("java-log4j-api" ,java-log4j-api-for-sbt) |
1302 | ("java-log4j-core" ,java-log4j-core-for-sbt) |
1303 | ("java-protobuf" ,java-protobuf) |
1304 | ("sbt-io" ,sbt-io) |
1305 | ("sbt-launcher" ,sbt-launcher) |
1306 | ("sbt-librarymanagement" ,sbt-librarymanagement) |
1307 | ("sbt-sbinary" ,sbt-sbinary) |
1308 | ("sbt-util" ,sbt-util) |
1309 | ("scala-protoc-bridge" ,scala-protoc-bridge) |
1310 | ("scala-sjsonnew" ,scala-sjsonnew))) |
1311 | (native-inputs |
1312 | `(("scala-protobuf" ,scala-protobuf) |
1313 | ("scala" ,scala-official))) |
1314 | (home-page "") |
1315 | (synopsis "") |
1316 | (description "") |
1317 | (license license:bsd-3))) |
1318 | |
1319 | (define-public scala-cache |
1320 | (package |
1321 | (name "scala-cache") |
1322 | (version "0.27.0") |
1323 | (source |
1324 | (origin |
1325 | (method url-fetch) |
1326 | (uri (string-append "https://github.com/cb372/scalacache/archive/v" |
1327 | version ".tar.gz")) |
1328 | (file-name (string-append name "-" version ".tar.gz")) |
1329 | (sha256 |
1330 | (base32 |
1331 | "0iqs1zvwr19j9k726f4zf4jzqlx5y1br87ijras668c3wd301h1k")))) |
1332 | (build-system ant-build-system) |
1333 | (arguments |
1334 | `(#:tests? #f |
1335 | #:phases |
1336 | (modify-phases %standard-phases |
1337 | (add-before 'build 'merge-core |
1338 | (lambda _ |
1339 | (copy-recursively "modules/core/jvm" "modules/core") |
1340 | (copy-recursively "modules/core/shared" "modules/core") |
1341 | #t)) |
1342 | (replace 'build |
1343 | ,(sbt-building-phase |
1344 | `(("modules/" "core") |
1345 | ("modules/" "caffeine")))) |
1346 | (replace 'install |
1347 | (install-jars "."))))) |
1348 | (inputs |
1349 | `(("java-caffeine" ,java-caffeine) |
1350 | ("java-slf4j-api" ,java-slf4j-api))) |
1351 | (native-inputs |
1352 | `(("scala" ,scala-official))) |
1353 | (home-page "https://www.scala-sbt.org/") |
1354 | (synopsis "") |
1355 | (description "") |
1356 | (license license:bsd-3))) |
1357 | |
1358 | (define-public sbt |
1359 | (package |
1360 | (name "sbt") |
1361 | (version "1.2.8") |
1362 | (source |
1363 | (origin |
1364 | (method url-fetch) |
1365 | (uri (string-append "https://github.com/sbt/sbt/archive/v" |
1366 | version ".tar.gz")) |
1367 | (file-name (string-append name "-" version ".tar.gz")) |
1368 | (sha256 |
1369 | (base32 |
1370 | "0fpm9jcd84xjxlfdfh2iwz7544ksgqik6591i7nrzlamygmbfadr")))) |
1371 | (build-system ant-build-system) |
1372 | (arguments |
1373 | `(#:tests? #f |
1374 | #:phases |
1375 | (modify-phases %standard-phases |
1376 | (add-before 'build 'fix-sjsonnew |
1377 | (lambda _ |
1378 | (substitute* (find-files "." ".*.scala") |
1379 | (("sjsonnew.shaded.") "")) |
1380 | #t)) |
1381 | (add-before 'build 'copy-resources |
1382 | (lambda _ |
1383 | (copy-recursively "sbt/src/main/resources" "build/classes") |
1384 | #t)) |
1385 | (add-before 'build 'generate-scalakeywords.scala |
1386 | (lambda _ |
1387 | (with-output-to-file "project/WriteKeywords.scala" |
1388 | (lambda _ |
1389 | (format #t "package project |
1390 | object WriteKeywords { |
1391 | def main(arg: Array[String]): Unit = { |
1392 | val g = new scala.tools.nsc.Global(new scala.tools.nsc.Settings) |
1393 | val keywords = g.nme.keywords.map(_.toString) |
1394 | val init = keywords.map(tn => '\"' + tn + '\"').mkString(\"Set(\", \", \", \")\") |
1395 | val ObjectName = \"ScalaKeywords\" |
1396 | val PackageName = \"sbt.internal.util\" |
1397 | val keywordsSrc = s\"\"\" |
1398 | |package $PackageName |
1399 | |object $ObjectName { |
1400 | | val values = $init |
1401 | |} |
1402 | \"\"\".trim.stripMargin |
1403 | val base = \"internal/util-collection/src/main/scala\" |
1404 | val out = base + \"/\" + PackageName.replace('.', '/') + \"/\" + s\"$ObjectName.scala\" |
1405 | val result = new java.io.PrintWriter(new java.io.File(out)) |
1406 | result.write(keywordsSrc) |
1407 | result.close() |
1408 | } |
1409 | }"))) |
1410 | (invoke "scalac" "-classpath" (getenv "CLASSPATH") "project/WriteKeywords.scala") |
1411 | (invoke "java" "-cp" (string-append (getenv "CLASSPATH") ":.") |
1412 | "project.WriteKeywords") |
1413 | #t)) |
1414 | (replace 'build |
1415 | ,(sbt-building-phase |
1416 | `(("internal/" "util-collection") |
1417 | ("internal/" "util-complete") |
1418 | ("testing/" "agent") |
1419 | ("" "testing") |
1420 | ("" "core-macros") |
1421 | ("" "tasks") |
1422 | ("" "tasks-standard") |
1423 | ("" "protocol") |
1424 | ("" "run") |
1425 | ("" "main-command") |
1426 | ("" "main-settings") |
1427 | ("" "main-actions") |
1428 | ("" "main") |
1429 | ("" "sbt")) |
1430 | #t)) |
1431 | (replace 'install |
1432 | (install-jars "."))))) |
1433 | (inputs |
1434 | `(("java-apache-ivy" ,java-apache-ivy) |
1435 | ("java-sbt-ipcsocket" ,java-sbt-ipcsocket) |
1436 | ("java-sbt-test-interface" ,java-sbt-test-interface) |
1437 | ("java-log4j-api" ,java-log4j-api-for-sbt) |
1438 | ("java-log4j-core" ,java-log4j-core-for-sbt) |
1439 | ("java-native-access" ,java-native-access) |
1440 | ("scala" ,scala-official) |
1441 | ("scala-jawn" ,scala-jawn) |
1442 | ("scala-scalajson" ,scala-scalajson) |
1443 | ("scala-sjsonnew" ,scala-sjsonnew) |
1444 | ("scala-sjsonnew-support-murmurhash" ,scala-sjsonnew-support-murmurhash) |
1445 | ("scala-sjsonnew-support-scalajson" ,scala-sjsonnew-support-scalajson) |
1446 | ("sbt-io" ,sbt-io) |
1447 | ("sbt-launcher" ,sbt-launcher) |
1448 | ("sbt-librarymanagement" ,sbt-librarymanagement) |
1449 | ("sbt-util" ,sbt-util) |
1450 | ("sbt-zinc" ,sbt-zinc))) |
1451 | (native-inputs |
1452 | `(("scala-kind-projector" ,scala-kind-projector))) |
1453 | (home-page "https://www.scala-sbt.org/") |
1454 | (synopsis "") |
1455 | (description "") |
1456 | (license license:bsd-3))) |
1457 |