diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-01 00:11:45 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-05-03 02:30:15 +0200 |
| commit | 6fd56b39b0aca0ad12ba605282a6c24835196805 (patch) | |
| tree | 0eaa7b64f2844d7b30621ea8a8186549a5a04d5a /gnu/packages/java.scm | |
| parent | c37be4516f5daff9267ab1b1433828cb6c327a53 (diff) | |
gnu: Add java-simplevalidation.
* gnu/packages/patches/java-simplevalidation-1.14.1.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add reference to it.
* gnu/packages/java.scm (java-simplevalidation-1.14.1): New variable.
Change-Id: I2e69ee8c5f6dfa1f0beba3d01c82ddae51de3c5f
Diffstat (limited to 'gnu/packages/java.scm')
| -rw-r--r-- | gnu/packages/java.scm | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 06a1dab57ff..1e29b2eb228 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -12447,6 +12447,124 @@ public Bundle getBundle()")) | |||
| 12447 | (native-inputs | 12447 | (native-inputs |
| 12448 | (list java-junit java-hamcrest-core)))) | 12448 | (list java-junit java-hamcrest-core)))) |
| 12449 | 12449 | ||
| 12450 | (define-public java-simplevalidation-1.14.1 | ||
| 12451 | (package | ||
| 12452 | (name "java-simplevalidation") | ||
| 12453 | (version "1.14.1") | ||
| 12454 | (source | ||
| 12455 | (origin | ||
| 12456 | (method git-fetch) | ||
| 12457 | (uri (git-reference | ||
| 12458 | (url "https://github.com/timboudreau/simplevalidation.git") | ||
| 12459 | (commit "7a9d6adbac685b34746aaa72b20a1e639b89c733"))) | ||
| 12460 | (file-name (git-file-name "java-simplevalidation" version)) | ||
| 12461 | (sha256 | ||
| 12462 | (base32 "1l0h2a6brzh4qrkjjxpiijjspapd1s7wr9pqzzwgh6qisjgb176w")) | ||
| 12463 | (patches | ||
| 12464 | (search-patches "java-simplevalidation-1.14.1.patch")) | ||
| 12465 | (modules '((guix build utils))) | ||
| 12466 | (snippet | ||
| 12467 | '(begin | ||
| 12468 | (for-each delete-file (find-files "." "\\.jar$")) | ||
| 12469 | #t)))) | ||
| 12470 | (build-system ant-build-system) | ||
| 12471 | (arguments | ||
| 12472 | (list | ||
| 12473 | #:jdk openjdk17 | ||
| 12474 | #:tests? #f | ||
| 12475 | #:modules | ||
| 12476 | '((guix build utils) | ||
| 12477 | (guix build ant-build-system) | ||
| 12478 | (guix build java-utils) | ||
| 12479 | (srfi srfi-13)) | ||
| 12480 | #:phases | ||
| 12481 | #~(modify-phases %standard-phases | ||
| 12482 | (replace 'build | ||
| 12483 | (lambda _ | ||
| 12484 | (define build-root (getcwd)) | ||
| 12485 | (define (normalize-path file) | ||
| 12486 | (if (string-prefix? "./" file) | ||
| 12487 | (substring file 2) | ||
| 12488 | file)) | ||
| 12489 | (define (copy-resources source-root class-root) | ||
| 12490 | (with-directory-excursion source-root | ||
| 12491 | (for-each | ||
| 12492 | (lambda (file) | ||
| 12493 | (unless (string-suffix? ".java" file) | ||
| 12494 | (let* ((relative (normalize-path file)) | ||
| 12495 | (destination | ||
| 12496 | (string-append class-root "/" relative))) | ||
| 12497 | (mkdir-p (dirname destination)) | ||
| 12498 | (copy-file file destination)))) | ||
| 12499 | (find-files "." ".*")))) | ||
| 12500 | (define (compile-tree source-root class-root classpath) | ||
| 12501 | (mkdir-p class-root) | ||
| 12502 | (copy-resources source-root class-root) | ||
| 12503 | (with-directory-excursion source-root | ||
| 12504 | (let ((sources (find-files "." "\\.java$"))) | ||
| 12505 | (apply invoke "javac" | ||
| 12506 | (append | ||
| 12507 | (list "-d" class-root) | ||
| 12508 | (if classpath | ||
| 12509 | (list "-cp" classpath) | ||
| 12510 | '()) | ||
| 12511 | sources))))) | ||
| 12512 | (let* ((nbstubs-classes (string-append build-root "/build/nbstubs")) | ||
| 12513 | (core-classes (string-append build-root "/build/core")) | ||
| 12514 | (swing-classes (string-append build-root "/build/swing")) | ||
| 12515 | (nbstubs-jar (string-append build-root | ||
| 12516 | "/build/nbstubs-1.14.1.jar")) | ||
| 12517 | (core-jar (string-append build-root | ||
| 12518 | "/build/simplevalidation-1.14.1.jar")) | ||
| 12519 | (swing-jar | ||
| 12520 | (string-append build-root | ||
| 12521 | "/build/simplevalidation-swing-1.14.1.jar")) | ||
| 12522 | (converter-services | ||
| 12523 | (string-append | ||
| 12524 | swing-classes | ||
| 12525 | "/META-INF/services/org.netbeans.validation.api.conversion.Converter"))) | ||
| 12526 | (compile-tree "nbstubs/src" nbstubs-classes #f) | ||
| 12527 | (invoke "jar" "-cf" nbstubs-jar "-C" nbstubs-classes ".") | ||
| 12528 | (compile-tree "ValidationAPI/src" core-classes #f) | ||
| 12529 | (invoke "jar" "-cf" core-jar "-C" core-classes ".") | ||
| 12530 | (compile-tree "simplevalidation-swing/src/main/java" | ||
| 12531 | swing-classes | ||
| 12532 | (string-append core-classes ":" nbstubs-classes)) | ||
| 12533 | (mkdir-p (dirname converter-services)) | ||
| 12534 | (call-with-output-file converter-services | ||
| 12535 | (lambda (port) | ||
| 12536 | (for-each | ||
| 12537 | (lambda (line) | ||
| 12538 | (display line port) | ||
| 12539 | (newline port)) | ||
| 12540 | '("org.netbeans.validation.api.conversion.swing.SelectedIndicesToButtonModelArrayConverter" | ||
| 12541 | "org.netbeans.validation.api.conversion.swing.SelectedIndicesToListSelectionModelConverter" | ||
| 12542 | "org.netbeans.validation.api.conversion.swing.StringToComboBoxModelConverter" | ||
| 12543 | "org.netbeans.validation.api.conversion.swing.StringToDocumentConverter")))) | ||
| 12544 | (invoke "jar" "-cf" swing-jar "-C" swing-classes ".") | ||
| 12545 | #t))) | ||
| 12546 | (replace 'install | ||
| 12547 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 12548 | ((install-pom-file "pom.xml") | ||
| 12549 | #:inputs inputs | ||
| 12550 | #:outputs outputs) | ||
| 12551 | ((install-from-pom "nbstubs/pom.xml") | ||
| 12552 | #:inputs inputs | ||
| 12553 | #:outputs outputs) | ||
| 12554 | ((install-from-pom "ValidationAPI/pom.xml") | ||
| 12555 | #:inputs inputs | ||
| 12556 | #:outputs outputs) | ||
| 12557 | ((install-from-pom "simplevalidation-swing/pom.xml") | ||
| 12558 | #:inputs inputs | ||
| 12559 | #:outputs outputs) | ||
| 12560 | #t))))) | ||
| 12561 | (home-page "https://github.com/timboudreau/simplevalidation/") | ||
| 12562 | (synopsis "Simple Validation libraries for Swing forms") | ||
| 12563 | (description | ||
| 12564 | "This package builds the Simple Validation core and Swing adapter | ||
| 12565 | libraries from source.") | ||
| 12566 | (license license:asl2.0))) | ||
| 12567 | |||
| 12450 | (define-public java-gson | 12568 | (define-public java-gson |
| 12451 | (package | 12569 | (package |
| 12452 | (name "java-gson") | 12570 | (name "java-gson") |
