diff mbox series

[bug#61794,17/18] gnu: Add java-byte-buddy-dep.

Message ID ce2bea8a7366382c70f0227ca5e2652c283ec2e7.1677357041.git.julien@lepiller.eu
State New
Headers show
Series [bug#61794,01/18] gnu: java-objenesis: Update to 3.3. | expand

Commit Message

Julien Lepiller Feb. 25, 2023, 8:30 p.m. UTC
* gnu/packages/java.scm (java-byte-buddy-dep): New variable.
---
 gnu/packages/java.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index e47462ce04..9940641fe9 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -10978,6 +10978,48 @@  (define-public java-xerial-core
 streams, etc.")
     (license license:asl2.0)))
 
+(define-public java-byte-buddy-dep
+  (package
+    (name "java-byte-buddy-dep")
+    (version "1.14.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/raphw/byte-buddy")
+                     (commit (string-append "byte-buddy-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "03jmsnkjb9d3z9brqs8fc512hhs5b5iab3a5wbax9zi03dskgvh2"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:jar-name "byte-buddy-dep.jar"
+       #:source-dir "byte-buddy-dep/src/main/java"
+       #:test-dir "byte-buddy-dep/src/test"
+       #:tests? #f; would build java files that are incompatible with current jdk
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'remove-annotations
+           (lambda _
+             (with-directory-excursion "byte-buddy-dep/src/main/java/net/bytebuddy"
+               (substitute* (find-files "." ".*.java")
+                 (("@EqualsAndHashCode.*") "")
+                 (("import lombok.EqualsAndHashCode;") "")
+                 (("@SuppressFBWarnings.*") "")
+                 (("import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;") ""))
+               (substitute* '("description/type/TypeDescription.java"
+                              "dynamic/loading/ClassInjector.java")
+                 (("^  *value = .*") "")
+                 (("^  *justification = .*") ""))))))))
+    (inputs
+      (list java-asm-9 java-asm-commons-9 java-jsr305 java-native-access))
+    (home-page "http://bytebuddy.net/")
+    (synopsis "Runtime code generation for the Java virtual machine")
+    (description "Byte Buddy is a code generation and manipulation library for
+creating and modifying Java classes during the runtime of a Java application
+and without the help of a compiler.")
+    (license license:asl2.0)))
+
 (define-public java-powermock-reflect
   (package
     (name "java-powermock-reflect")