more sbt dependencies

Julien LepillerSat Jan 12 23:13:31+0100 2019

20a7523

more sbt dependencies

more/packages/java.scm

67226722
    (description "")
67236723
    (license license:asl2.0)))
67246724
6725+
(define-public java-okhttp-urlconnection
6726+
  (package
6727+
    (inherit java-okhttp)
6728+
    (name "java-okhttp-urlconnection")
6729+
    (arguments
6730+
     `(#:jar-name "okhttp.jar"
6731+
       #:source-dir "okhttp-urlconnection/src/main/java"
6732+
       #:test-dir "okhttp-urlconnection/src/test"
6733+
       ;; TODO: require okhttp-mockwebserver
6734+
       #:tests? #f))
6735+
    (inputs
6736+
     `(("java-okhttp" ,java-okhttp)
6737+
       ,@(package-inputs java-okhttp)))))
6738+
67256739
(define-public java-config
67266740
  (package
67276741
    (name "java-config")

69476961
    (synopsis "")
69486962
    (description "")
69496963
    (license license:asl2.0)))
6964+
6965+
(define-public java-sbt-ipcsocket
6966+
  (package
6967+
    (name "java-sbt-ipcsocket")
6968+
    (version "1.0.0")
6969+
    (source (origin
6970+
              (method url-fetch)
6971+
              (uri (string-append "https://github.com/sbt/ipcsocket/archive/v"
6972+
                                  version ".tar.gz"))
6973+
              (sha256
6974+
               (base32
6975+
                "0zqg1c10dwjzvqb9wngmprs2cfiyw3n1jq8ag0hwk978f1d93a4h"))))
6976+
    (build-system ant-build-system)
6977+
    (arguments
6978+
     `(#:jar-name "ipcsocket.jar"
6979+
       #:source-dir "src/main/java"
6980+
       ;; Cannot create unix domain socket properly in the build environment
6981+
       #:tests? #f))
6982+
    (inputs
6983+
     `(("java-native-access" ,java-native-access)
6984+
       ("java-native-access-platform" ,java-native-access-platform)))
6985+
    (home-page "")
6986+
    (synopsis "")
6987+
    (description "")
6988+
    (license license:asl2.0)))
6989+
6990+
(define-public java-sbt-test-interface
6991+
  (package
6992+
    (name "java-sbt-test-interface")
6993+
    (version "1.0")
6994+
    (source (origin
6995+
              (method url-fetch)
6996+
              (uri (string-append "https://github.com/sbt/test-interface/archive/v"
6997+
                                  version ".tar.gz"))
6998+
              (sha256
6999+
               (base32
7000+
                "0lqsaik33d7wfq8d69mq4s6jb16rb2fmnhv2wjqisrxi0m4nmffw"))))
7001+
    (build-system ant-build-system)
7002+
    (arguments
7003+
     `(#:jar-name "test-interface.jar"
7004+
       #:source-dir "src/main/java"
7005+
       ;; TODO: tests are written in scala
7006+
       #:tests? #f))
7007+
    (home-page "")
7008+
    (synopsis "")
7009+
    (description "")
7010+
    (license license:asl2.0)))
7011+
7012+
(define-public java-caffeine
7013+
  (package
7014+
    (name "java-caffeine")
7015+
    (version "2.6.2")
7016+
    (source (origin
7017+
              (method url-fetch)
7018+
              (uri (string-append "https://github.com/ben-manes/caffeine/archive/v"
7019+
                                  version ".tar.gz"))
7020+
              (sha256
7021+
               (base32
7022+
                "1kaxz4fpjpgyv4n2zhlb3q0f8mn5ji68wilzwhf9dsbq4l12zkx4"))))
7023+
    (build-system ant-build-system)
7024+
    (arguments
7025+
     `(#:jar-name "caffeine.jar"
7026+
       #:source-dir "caffeine/src/main/java"
7027+
       #:phases
7028+
       (modify-phases %standard-phases
7029+
         (add-before 'build 'generate-javapoet
7030+
           (lambda _
7031+
             (mkdir-p "build/javapoet")
7032+
             (apply invoke "javac" "-cp" (getenv "CLASSPATH")
7033+
                    "-d" "build/javapoet"
7034+
                    (find-files "caffeine/src/javaPoet" ".*.java$"))
7035+
             #t)))))
7036+
    (inputs
7037+
     `(("java-jsr305" ,java-jsr305)
7038+
       ("java-javapoet" ,java-javapoet)))
7039+
    (home-page "")
7040+
    (synopsis "")
7041+
    (description "")
7042+
    (license license:asl2.0)))

more/packages/scala.scm

8484
8585
;; TODO: put it in guix/build/java-utils.scm
8686
;; TODO: remove contraband-* directories and regenerate them from contraband/
87-
(define (sbt-building-phase subprojects)
87+
(define* (sbt-building-phase subprojects #:optional (kind-projector? #f))
8888
  `(lambda* (#:key inputs #:allow-other-keys)
8989
     (define (build-subproject prefix name)
9090
       (let ((build-directory (string-append "build/" name))
91+
             (kind-projector (assoc-ref inputs "scala-kind-projector"))
9192
             (jar-name (string-append
9293
                         (if (> (string-length prefix) 0)
9394
                           (string-replace prefix "-" (- (string-length prefix) 1))

119120
                              (find-files "build" "." #:directories? #t))
120121
                      ":"))
121122
                  "-d" build-directory "-language:experimental.macros"
123+
                  (if ,kind-projector?
124+
                    (string-append "-Xplugin:" kind-projector
125+
                                   "/share/java/kind-projector.jar")
126+
                    "")
122127
                  (append scala-files java-files)))
123128
         (unless (eq? java-files '())
124129
           (apply invoke "javac" "-classpath"

775780
     `(#:tests? #f
776781
       #:phases
777782
       (modify-phases %standard-phases
778-
         (replace 'build
779-
           (lambda* (#:key inputs #:allow-other-keys)
780-
             (mkdir-p "build/classes")
781-
             (apply invoke "scalac" "-classpath" (getenv "CLASSPATH")
782-
                    "-d" "build/classes"
783-
                    (append
784-
                      (find-files "core/src/main/java" ".*.java$")
785-
                      (find-files "core/src/main/scala" ".*.scala$")
786-
                      (find-files "core/src/main/contraband-scala" ".*.scala$")))
787-
             (invoke "jar" "cf" "sbt-librarymanagement.jar" "-C" "build/classes" ".")
783+
         (add-before 'build 'fix-sjsonnew
784+
           (lambda _
785+
             (substitute* (find-files "." ".*.scala")
786+
               (("sjsonnew.shaded.") ""))
788787
             #t))
788+
         (replace 'build
789+
           ,(sbt-building-phase
790+
              `(("" "core")
791+
                ("" "ivy"))))
789792
         (replace 'install
790793
           (install-jars ".")))))
791794
    (inputs
792-
     `(("sbt-launcher" ,sbt-launcher)
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)
793800
       ("sbt-util" ,sbt-util)
794801
       ("sbt-io" ,sbt-io)
802+
       ("scala-jawn" ,scala-jawn)
795803
       ("scala-okhttp" ,scala-okhttp)
796-
       ("scala-sjsonnew" ,scala-sjsonnew)))
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)))
797808
    (native-inputs
798809
     `(("scala" ,scala-official)))
799810
    (home-page "")
800811
    (synopsis "")
801812
    (description "")
802813
    ;; From core/NOTICE
814+
    ;; XXX: WARNING: no license in ivy/
803815
    (license license:bsd-2)))
804816
805817
;; LICENSE?

10181030
    (description "")
10191031
    (license license:expat)))
10201032
1021-
(define-public scala-fastparse1
1033+
(define scala-fastparse1
10221034
  (package
10231035
    (inherit scala-fastparse)
10241036
    (version "1.0.0")

12621274
                     "--scala_out=internal/zinc-persist/src/main/scala"
12631275
                     "internal/zinc-persist/src/main/protobuf/schema.proto")
12641276
             #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))
12651287
         (replace 'build
12661288
           ,(sbt-building-phase
12671289
              '(("internal/" "compiler-interface")

12711293
                ("internal/" "zinc-core")
12721294
                ("internal/" "zinc-persist")
12731295
                ("internal/" "zinc-compile-core")
1296+
                ("internal/" "zinc-ivy-integration")
12741297
                ("" "zinc"))))
12751298
         (replace 'install
12761299
           (install-jars ".")))))

12931316
    (description "")
12941317
    (license license:bsd-3)))
12951318
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+
12961358
(define-public sbt
12971359
  (package
12981360
    (name "sbt")

13111373
     `(#:tests? #f
13121374
       #:phases
13131375
       (modify-phases %standard-phases
1376+
         (add-before 'build 'fix-sjsonnew
1377+
           (lambda _
1378+
             (substitute* (find-files "." ".*.scala")
1379+
               (("sjsonnew.shaded.") ""))
1380+
             #t))
13141381
         (add-before 'build 'copy-resources
13151382
           (lambda _
13161383
             (copy-recursively "sbt/src/main/resources" "build/classes")

13451412
                     "project.WriteKeywords")
13461413
             #t))
13471414
         (replace 'build
1348-
           (lambda* (#:key inputs #:allow-other-keys)
1349-
             (define (build-subproject prefix name)
1350-
               (let ((build-directory (string-append "build/" name))
1351-
                     (jar-name (string-append name ".jar"))
1352-
                     (kind-projector (assoc-ref inputs "scala-kind-projector")))
1353-
                 (mkdir-p build-directory)
1354-
                 (format #t "Building project ~a...~%" name)
1355-
                 (apply invoke "scalac" "-classpath"
1356-
                        ;; 13:36 < snape> roptat: I think you could use 'readdir', as in 'files-in-directory' from guix/build/union.scm
1357-
                        (apply string-append (getenv "CLASSPATH")
1358-
                               (map (lambda (file) (string-append ":" file))
1359-
                                    (find-files "build" "." #:directories? #t)))
1360-
                        "-d" build-directory
1361-
                        (string-append "-Xplugin:" kind-projector
1362-
                                       "/share/java/kind-projector.jar")
1363-
                        (find-files (string-append prefix name "/src/main/scala")
1364-
                                    ".*.scala$"))
1365-
                 (invoke "jar" "cf" jar-name "-C" build-directory ".")))
1366-
             (build-subproject "internal/" "util-collection")
1367-
             (build-subproject "internal/" "util-complete")
1368-
             (build-subproject "" "core-macros")
1369-
             (build-subproject "" "tasks")
1370-
             (build-subproject "" "tasks-standard")
1371-
             (build-subproject "" "protocol")
1372-
             (build-subproject "" "main-command")
1373-
             (build-subproject "" "main-settings")
1374-
             (build-subproject "" "sbt")
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"))
13751430
             #t))
13761431
         (replace 'install
13771432
           (install-jars ".")))))
13781433
    (inputs
1379-
     `(("java-log4j-api" ,java-log4j-api-for-sbt)
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)
13801438
       ("java-log4j-core" ,java-log4j-core-for-sbt)
1439+
       ("java-native-access" ,java-native-access)
13811440
       ("scala" ,scala-official)
1441+
       ("scala-jawn" ,scala-jawn)
1442+
       ("scala-scalajson" ,scala-scalajson)
13821443
       ("scala-sjsonnew" ,scala-sjsonnew)
1444+
       ("scala-sjsonnew-support-murmurhash" ,scala-sjsonnew-support-murmurhash)
1445+
       ("scala-sjsonnew-support-scalajson" ,scala-sjsonnew-support-scalajson)
13831446
       ("sbt-io" ,sbt-io)
13841447
       ("sbt-launcher" ,sbt-launcher)
13851448
       ("sbt-librarymanagement" ,sbt-librarymanagement)