Finish sbt, but need to recreate contraband
more/packages/java.scm
7298 | 7298 | `(#:jar-name "caffeine.jar" | |
7299 | 7299 | #:source-dir "caffeine/src/main/java:caffeine/generated-sources" | |
7300 | 7300 | #:test-dir "caffeine/src/test" | |
7301 | + | #:tests? #f; TODO: need mockito2 and more dependencies | |
7301 | 7302 | #:jdk ,openjdk9 | |
7302 | 7303 | #:phases | |
7303 | 7304 | (modify-phases %standard-phases | |
… | |||
7327 | 7328 | ("java-javapoet" ,java-javapoet))) | |
7328 | 7329 | (native-inputs | |
7329 | 7330 | `(("java-hamcrest-all" ,java-hamcrest-all) | |
7330 | - | ("java-mockito-1" ,java-mockito-1) | |
7331 | 7331 | ("java-testng" ,java-testng))) | |
7332 | 7332 | (home-page "") | |
7333 | 7333 | (synopsis "") |
more/packages/scala.scm
24 | 24 | #:use-module (guix git-download) | |
25 | 25 | #:use-module (guix utils) | |
26 | 26 | #:use-module (guix build-system ant) | |
27 | + | #:use-module (guix build-system gnu) | |
27 | 28 | #:use-module (guix build-system trivial) | |
28 | 29 | #:use-module (gnu packages base) | |
29 | 30 | #:use-module (gnu packages bash) | |
… | |||
734 | 735 | (modify-phases %standard-phases | |
735 | 736 | (replace 'build | |
736 | 737 | (lambda* (#:key inputs #:allow-other-keys) | |
738 | + | (define (split n str) | |
739 | + | (if (<= (string-length str) n) | |
740 | + | (list str) | |
741 | + | (cons (substring str 0 n) (split n (substring str n))))) | |
737 | 742 | (substitute* "launcher-implementation/src/main/input_sources/CrossVersionUtil.scala" | |
738 | 743 | (("\\$\\{\\{cross.package0\\}\\}") "xsbt") | |
739 | 744 | (("\\$\\{\\{cross.package1\\}\\}") "boot")) | |
… | |||
747 | 752 | (apply invoke "javac" "-cp" (string-append (getenv "CLASSPATH") ":build/classes") | |
748 | 753 | "-d" "build/classes" | |
749 | 754 | (find-files "launcher-interface/src/main/java" ".*.java$")) | |
750 | - | (invoke "jar" "cf" "sbt-launcher.jar" "-C" "build/classes" ".") | |
755 | + | (mkdir-p "build/classes/META-INF") | |
756 | + | (with-output-to-file "build/classes/META-INF/MANIFEST.MF" | |
757 | + | (lambda _ | |
758 | + | (format #t "Manifest-Version: 1.0\n") | |
759 | + | (format #t "Class-Path: ~a\n" | |
760 | + | (string-join | |
761 | + | (split | |
762 | + | 58 | |
763 | + | (string-join | |
764 | + | (map | |
765 | + | (lambda (jar) | |
766 | + | ;; We can't use absolute paths with java 8 :/ | |
767 | + | (string-append "../../../../../../../../.." jar)) | |
768 | + | (string-split (getenv "CLASSPATH") #\:)) | |
769 | + | " ")) | |
770 | + | "\n ")) | |
771 | + | (format #t "Main-Class: xsbt.boot.Boot\n\n"))) | |
772 | + | (invoke "jar" "cfm" "sbt-launcher.jar" "build/classes/META-INF/MANIFEST.MF" | |
773 | + | "-C" "build/classes" ".") | |
751 | 774 | #t)) | |
752 | 775 | (replace 'install | |
753 | 776 | (install-jars "."))))) | |
… | |||
760 | 783 | (description "") | |
761 | 784 | (license license:bsd-3))) | |
762 | 785 | ||
763 | - | ;; https://index.scala-lang.org/eed3si9n/gigahorse/gigahorse-okhttp/0.3.0?target=_2.12 | |
764 | 786 | (define-public sbt-librarymanagement | |
765 | 787 | (package | |
766 | 788 | (name "sbt-librarymanagement") | |
… | |||
774 | 796 | "0g37agv3xkq1fjl9a25ybcdk4d5aq1m81rz5d2a8zvny135m73gl")) | |
775 | 797 | (modules '((guix build utils))) | |
776 | 798 | (snippet | |
777 | - | `(for-each delete-file (find-files "." ".*.jar"))))) | |
799 | + | `(begin | |
800 | + | (for-each delete-file (find-files "." ".*.jar")) | |
801 | + | #t)))) | |
778 | 802 | (build-system ant-build-system) | |
779 | 803 | (arguments | |
780 | 804 | `(#:tests? #f | |
… | |||
1294 | 1318 | ("internal/" "zinc-persist") | |
1295 | 1319 | ("internal/" "zinc-compile-core") | |
1296 | 1320 | ("internal/" "zinc-ivy-integration") | |
1321 | + | ("" "zinc-compile") | |
1297 | 1322 | ("" "zinc")))) | |
1298 | 1323 | (replace 'install | |
1299 | 1324 | (install-jars "."))))) | |
… | |||
1355 | 1380 | (description "") | |
1356 | 1381 | (license license:bsd-3))) | |
1357 | 1382 | ||
1358 | - | (define-public sbt | |
1383 | + | (define-public sbt-jars | |
1359 | 1384 | (package | |
1360 | - | (name "sbt") | |
1385 | + | (name "sbt-jars") | |
1361 | 1386 | (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")))) | |
1387 | + | (source (origin | |
1388 | + | (method url-fetch) | |
1389 | + | (uri (string-append "https://github.com/sbt/sbt/archive/v" | |
1390 | + | version ".tar.gz")) | |
1391 | + | (file-name (string-append name "-" version ".tar.gz")) | |
1392 | + | (sha256 | |
1393 | + | (base32 | |
1394 | + | "0fpm9jcd84xjxlfdfh2iwz7544ksgqik6591i7nrzlamygmbfadr")) | |
1395 | + | (modules '((guix build utils))) | |
1396 | + | (snippet | |
1397 | + | `(begin | |
1398 | + | (for-each delete-file (find-files "." ".*.jar")) | |
1399 | + | #t)))) | |
1371 | 1400 | (build-system ant-build-system) | |
1372 | 1401 | (arguments | |
1373 | 1402 | `(#:tests? #f | |
… | |||
1415 | 1444 | ,(sbt-building-phase | |
1416 | 1445 | `(("internal/" "util-collection") | |
1417 | 1446 | ("internal/" "util-complete") | |
1447 | + | ("internal/" "util-logic") | |
1418 | 1448 | ("testing/" "agent") | |
1419 | 1449 | ("" "testing") | |
1420 | 1450 | ("" "core-macros") | |
… | |||
1428 | 1458 | ("" "main") | |
1429 | 1459 | ("" "sbt")) | |
1430 | 1460 | #t)) | |
1461 | + | (add-before 'build 'build-launch | |
1462 | + | (lambda* (#:key inputs #:allow-other-keys) | |
1463 | + | (mkdir-p "build/launch") | |
1464 | + | (mkdir-p "build/jar") | |
1465 | + | (with-directory-excursion "build/launch" | |
1466 | + | (invoke "jar" "xf" (string-append | |
1467 | + | (assoc-ref inputs "sbt-launcher") | |
1468 | + | "/share/java/sbt-launcher.jar"))) | |
1469 | + | (copy-recursively "launch/src/main/input_resources" "build/launch") | |
1470 | + | (copy-recursively "launch/src/main/resources" "build/launch") | |
1471 | + | (substitute* "build/launch/sbt/sbt.boot.properties" | |
1472 | + | (("\\$\\{\\{sbt.version\\}\\}") ,version) | |
1473 | + | (("\\$\\{\\{org\\}\\}") "org.scala-sbt")) | |
1474 | + | (invoke "jar" "cmf" "build/launch/META-INF/MANIFEST.MF" | |
1475 | + | "build/jar/sbt-launch.jar" "-C" "build/launch" ".") | |
1476 | + | #t)) | |
1431 | 1477 | (replace 'install | |
1432 | 1478 | (install-jars "."))))) | |
1433 | 1479 | (inputs | |
… | |||
1438 | 1484 | ("java-log4j-core" ,java-log4j-core-for-sbt) | |
1439 | 1485 | ("java-native-access" ,java-native-access) | |
1440 | 1486 | ("scala" ,scala-official) | |
1487 | + | ("scala-cache" ,scala-cache) | |
1441 | 1488 | ("scala-jawn" ,scala-jawn) | |
1442 | 1489 | ("scala-scalajson" ,scala-scalajson) | |
1443 | 1490 | ("scala-sjsonnew" ,scala-sjsonnew) | |
… | |||
1454 | 1501 | (synopsis "") | |
1455 | 1502 | (description "") | |
1456 | 1503 | (license license:bsd-3))) | |
1504 | + | ||
1505 | + | (define-public sbt | |
1506 | + | (package | |
1507 | + | (name "sbt") | |
1508 | + | (version (package-version sbt-jars)) | |
1509 | + | (source (origin | |
1510 | + | (method url-fetch) | |
1511 | + | (uri (string-append "https://github.com/sbt/sbt-launcher-package/" | |
1512 | + | "archive/v" version ".tar.gz")) | |
1513 | + | (file-name (string-append name "-" version ".tar.gz")) | |
1514 | + | (sha256 | |
1515 | + | (base32 | |
1516 | + | "0bcqjambyf4x89ind2hg6ngh6qn46wiwa8q4gcyw65jyl4rsxls9")))) | |
1517 | + | (build-system gnu-build-system) | |
1518 | + | (arguments | |
1519 | + | `(#:tests? #f; no tests | |
1520 | + | #:phases | |
1521 | + | (modify-phases %standard-phases | |
1522 | + | (delete 'configure) | |
1523 | + | (delete 'build) | |
1524 | + | (replace 'install | |
1525 | + | (lambda* (#:key outputs inputs #:allow-other-keys) | |
1526 | + | (delete-file "src/universal/bin/sbt.bat") | |
1527 | + | (let ((out (assoc-ref outputs "out")) | |
1528 | + | (sbt (assoc-ref inputs "sbt-jars")) | |
1529 | + | (scala (assoc-ref inputs "scala")) | |
1530 | + | (icedtea (assoc-ref inputs "icedtea"))) | |
1531 | + | (substitute* "src/universal/bin/sbt-launch-lib.bash" | |
1532 | + | (("java_cmd=.*") (string-append "java_cmd=\"" icedtea "/bin/java\"\n"))) | |
1533 | + | (mkdir-p (string-append out "/lib/local-preloaded")) | |
1534 | + | (for-each | |
1535 | + | (lambda (package) | |
1536 | + | (for-each | |
1537 | + | (lambda (jar) | |
1538 | + | (symlink jar (string-append out "/lib/local-preloaded/" | |
1539 | + | (basename jar)))) | |
1540 | + | (find-files (assoc-ref inputs package) ".*.jar$"))) | |
1541 | + | '("scala" "sbt-jars")) | |
1542 | + | (copy-recursively "src/universal" out) | |
1543 | + | (copy-recursively "src/linux/usr" out) | |
1544 | + | (copy-file (string-append sbt "/share/java/sbt-launch.jar") | |
1545 | + | (string-append out "/bin/sbt-launch.jar"))) | |
1546 | + | #t))))) | |
1547 | + | (inputs | |
1548 | + | `(("icedtea" ,icedtea-8) | |
1549 | + | ("sbt-jars" ,sbt-jars) | |
1550 | + | ("scala" ,scala-official))) | |
1551 | + | (home-page "https://www.scala-sbt.org/") | |
1552 | + | (synopsis "") | |
1553 | + | (description "") | |
1554 | + | (license license:bsd-3))) |