diff options
| author | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-04-01 00:35:48 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@friendly-machines.com> | 2026-05-03 02:30:23 +0200 |
| commit | 297f6ae22c322866bfbdb2a30418ab00f938ff7d (patch) | |
| tree | 0cd921973de0fde1b1f5b1d6b704f0c30c3214a3 /gnu/packages/java.scm | |
| parent | e882d5315c4dceab0d0bb240918afd6719b37317 (diff) | |
gnu: Add java-bouncycastle@1.77.
* gnu/packages/java.scm (java-bouncycastle-1.77): New variable.
Change-Id: If3a2cad594faec16f8227adde9817f0cb03b33b0
Diffstat (limited to 'gnu/packages/java.scm')
| -rw-r--r-- | gnu/packages/java.scm | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 7740fd7cddf..009b8ca6b16 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm | |||
| @@ -12376,6 +12376,110 @@ package, which was removed from the JDK in Java 11. This is the 1.2.x | |||
| 12376 | transitional release that still uses the @code{javax.activation} namespace.") | 12376 | transitional release that still uses the @code{javax.activation} namespace.") |
| 12377 | (license license:edl1.0))) | 12377 | (license license:edl1.0))) |
| 12378 | 12378 | ||
| 12379 | (define-public java-bouncycastle-1.77 | ||
| 12380 | (package | ||
| 12381 | (inherit java-bouncycastle) | ||
| 12382 | (version "1.77") | ||
| 12383 | (source (origin | ||
| 12384 | (method git-fetch) | ||
| 12385 | (uri (git-reference | ||
| 12386 | (url "https://github.com/bcgit/bc-java") | ||
| 12387 | (commit (string-append "r1rv" (substring version 2 4))))) | ||
| 12388 | (file-name (git-file-name "java-bouncycastle" version)) | ||
| 12389 | (sha256 | ||
| 12390 | (base32 | ||
| 12391 | "1adxic0pgb7gv2yflw72np7zilj6rrhgjcj3xvnmidwp2pc887k1")) | ||
| 12392 | (modules '((guix build utils))) | ||
| 12393 | (snippet | ||
| 12394 | '(begin | ||
| 12395 | (for-each delete-file | ||
| 12396 | (find-files "." "\\.jar$")) | ||
| 12397 | #t)))) | ||
| 12398 | (arguments | ||
| 12399 | `(#:jdk ,openjdk17 | ||
| 12400 | #:tests? #f | ||
| 12401 | #:phases | ||
| 12402 | (modify-phases %standard-phases | ||
| 12403 | (replace 'build | ||
| 12404 | (lambda _ | ||
| 12405 | (let ((suffix (string-append | ||
| 12406 | "-Drelease.suffix=" | ||
| 12407 | ,(string-join (string-split version #\.) "")))) | ||
| 12408 | (mkdir-p "ant/docs") | ||
| 12409 | ;; Build individual targets. Can't use the 'build' | ||
| 12410 | ;; target because it includes 'build-test' which needs | ||
| 12411 | ;; the UnboundID LDAP SDK. | ||
| 12412 | (invoke "ant" "-f" "ant/jdk18+.xml" suffix | ||
| 12413 | "build-provider") | ||
| 12414 | ;; The remaining targets are only in bc+-build.xml. | ||
| 12415 | ;; Call it via ant's -f but pass properties that | ||
| 12416 | ;; jdk18+.xml normally sets. | ||
| 12417 | (let ((props (list suffix | ||
| 12418 | "-Dtarget.prefix=jdk18on" | ||
| 12419 | "-Djdk.name=jdk1.8" | ||
| 12420 | "-Dbc.javac.source=1.8" | ||
| 12421 | "-Dbc.javac.target=1.8" | ||
| 12422 | "-Dbuild.dir=build" | ||
| 12423 | "-Djavadoc.args=-breakiterator" | ||
| 12424 | (string-append "-Dsrc.dir=" | ||
| 12425 | (getcwd) "/build/jdk1.8") | ||
| 12426 | (string-append "-Dartifacts.dir=" | ||
| 12427 | (getcwd) "/build/artifacts/jdk1.8")))) | ||
| 12428 | (for-each | ||
| 12429 | (lambda (target) | ||
| 12430 | (apply invoke "ant" "-f" "ant/bc+-build.xml" | ||
| 12431 | (append props (list target)))) | ||
| 12432 | '("build-util" "build-pkix" "build-pg" "build-mail")))))) | ||
| 12433 | (add-after 'build 'add-osgi-manifests | ||
| 12434 | (lambda _ | ||
| 12435 | ;; The Maven Central jars have OSGi manifest attributes | ||
| 12436 | ;; from maven-bundle-plugin. Add them since we build | ||
| 12437 | ;; with ant. | ||
| 12438 | (for-each | ||
| 12439 | (lambda (name) | ||
| 12440 | (let ((jar (car (find-files "build/artifacts" | ||
| 12441 | (string-append name "-jdk18on.*\\.jar$"))))) | ||
| 12442 | (call-with-output-file "osgi-manifest.mf" | ||
| 12443 | (lambda (port) | ||
| 12444 | (display (string-append | ||
| 12445 | "Bundle-ManifestVersion: 2\n" | ||
| 12446 | "Bundle-SymbolicName: " name "\n" | ||
| 12447 | "Bundle-Version: " ,version "\n") | ||
| 12448 | port))) | ||
| 12449 | (invoke "jar" "ufm" jar "osgi-manifest.mf"))) | ||
| 12450 | '("bcprov" "bcutil" "bcpkix" "bcpg")))) | ||
| 12451 | (add-after 'add-osgi-manifests 'rename-jars | ||
| 12452 | (lambda _ | ||
| 12453 | ;; Ant produces e.g. bcprov-jdk18on-177.jar but | ||
| 12454 | ;; install-from-pom expects bcprov-jdk18on-1.77.jar. | ||
| 12455 | (for-each | ||
| 12456 | (lambda (name) | ||
| 12457 | (let ((src (car (find-files "build/artifacts" | ||
| 12458 | (string-append name "-jdk18on-.*\\.jar$")))) | ||
| 12459 | (dest (string-append "build/artifacts/jdk1.8/jars/" | ||
| 12460 | name "-jdk18on-" ,version ".jar"))) | ||
| 12461 | (unless (string=? src dest) | ||
| 12462 | (rename-file src dest)))) | ||
| 12463 | '("bcprov" "bcutil" "bcpkix" "bcpg")))) | ||
| 12464 | (replace 'install | ||
| 12465 | (lambda* (#:key inputs outputs jar-name #:allow-other-keys) | ||
| 12466 | (for-each | ||
| 12467 | (lambda (name) | ||
| 12468 | (let ((pom-file (string-append name "-pom.xml")) | ||
| 12469 | (artifact (string-append name "-jdk18on"))) | ||
| 12470 | ((generate-pom.xml pom-file "org.bouncycastle" | ||
| 12471 | artifact ,version)) | ||
| 12472 | ((install-from-pom pom-file) | ||
| 12473 | #:inputs inputs #:outputs outputs | ||
| 12474 | #:jar-name (string-append artifact "-" ,version "\\.jar$")))) | ||
| 12475 | '("bcprov" "bcutil" "bcpkix" "bcpg"))))))) | ||
| 12476 | (inputs | ||
| 12477 | (list java-jakarta-activation-1.2 | ||
| 12478 | java-javax-mail)) | ||
| 12479 | (description "Bouncy Castle is a cryptographic library for the Java | ||
| 12480 | programming language. This is version 1.77 which has breaking API changes | ||
| 12481 | compared to 1.67 (removed classes in ASN1, CMC, and other packages)."))) | ||
| 12482 | |||
| 12379 | (define-public java-eclipse-jdt-annotation-2 | 12483 | (define-public java-eclipse-jdt-annotation-2 |
| 12380 | (package | 12484 | (package |
| 12381 | (name "java-eclipse-jdt-annotation") | 12485 | (name "java-eclipse-jdt-annotation") |
