unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: 43639@debbugs.gnu.org
Subject: [bug#43639] [PATCH 15/15] gnu: Add java-javaparser.
Date: Sun, 27 Sep 2020 00:18:24 +0200	[thread overview]
Message-ID: <20200926221824.20925-15-julien@lepiller.eu> (raw)
In-Reply-To: <20200926221824.20925-1-julien@lepiller.eu>

* gnu/packages/java.scm (java-javaparser): New variable.
---
 gnu/packages/java.scm | 95 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 8b6f3f945b..c96fee2bb5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -13441,3 +13441,98 @@ in Java, usable from Groovy, Kotlin, Scala, etc.")
 used in JVM-based languages.  They serve as an additional documentation and
 can be interpreted by IDEs and static analysis tools to improve code analysis.")
     (license license:expat)))
+
+(define-public java-javaparser
+  (package
+    (name "java-javaparser")
+    (version "3.16.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/javaparser/javaparser")
+                     (commit (string-append "javaparser-parent-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1a4jk12ffa31fa0y8vda0739vpfj1206p0nha842b7bixbvwamv9"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  (for-each delete-file
+                            (find-files "." "\\.jar$"))
+                  #t))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:tests? #f; tests require jbehave and junit5
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fill-template
+           (lambda _
+             (with-directory-excursion "javaparser-core/src/main"
+               (copy-file "java-templates/com/github/javaparser/JavaParserBuild.java"
+                          "java/com/github/javaparser/JavaParserBuild.java")
+               (substitute* "java/com/github/javaparser/JavaParserBuild.java"
+                 (("\\$\\{project.version\\}") ,version)
+                 (("\\$\\{project.name\\}") "javaparser")
+                 (("\\$\\{project.build.finalName\\}") "javaparser")
+                 (("\\$\\{maven.version\\}") "fake")
+                 (("\\$\\{maven.build.version\\}") "fake")
+                 (("\\$\\{build.timestamp\\}") "0")
+                 (("\\$\\{java.vendor\\}") "Guix")
+                 (("\\$\\{java.vendor.url\\}") "https://gnu.org/software/guix")
+                 (("\\$\\{java.version\\}") "1.8")
+                 (("\\$\\{os.arch\\}") "any")
+                 (("\\$\\{os.name\\}") "GuixSD")
+                 (("\\$\\{os.version\\}") "not available")))
+             #t))
+         (add-before 'build 'generate-javacc
+           (lambda _
+             (with-directory-excursion "javaparser-core/src/main/java"
+               (invoke "java" "javacc" "../javacc/java.jj"))
+             #t))
+         (add-before 'build 'copy-javacc-support
+           (lambda _
+             (with-directory-excursion "javaparser-core/src/main"
+               (copy-recursively "javacc-support" "java"))
+             #t))
+         (replace 'build
+           (lambda _
+             (define (build name)
+               (format #t "Building ~a~%" name)
+               (delete-file-recursively "build/classes")
+               (mkdir-p "build/classes")
+               (apply invoke "javac"
+                      "-cp" (string-append (getenv "CLASSPATH") ":"
+                                           (string-join (find-files "build/jar" ".")
+                                                        ":"))
+                      "-d" "build/classes"
+                      (find-files (string-append name "/src/main/java")
+                                  ".*.java"))
+               (invoke "jar" "-cf" (string-append "build/jar/" name ".jar")
+                       "-C" "build/classes" "."))
+             (mkdir-p "build/classes")
+             (mkdir-p "build/test-classes")
+             (mkdir-p "build/jar")
+             (build "javaparser-core")
+             (build "javaparser-core-serialization")
+             (build "javaparser-core-generators")
+             (build "javaparser-core-metamodel-generator")
+             (build "javaparser-symbol-solver-core")
+             #t))
+         (replace 'install
+           (install-jars "build/jar")))))
+    (inputs
+     `(("java-guava" ,java-guava)
+       ("java-jboss-javassist" ,java-jboss-javassist)
+       ("java-jsonp-api" ,java-jsonp-api)))
+    (native-inputs
+     `(("javacc" ,javacc)))
+    (home-page "http://javaparser.org/")
+    (synopsis "Parser for Java")
+    (description
+     "This project contains a set of libraries implementing a Java 1.0 - Java
+11 Parser with advanced analysis functionalities.")
+    (license (list
+               ;; either lgpl or asl
+               license:lgpl3+
+               license:asl2.0))))
-- 
2.28.0





  parent reply	other threads:[~2020-09-26 22:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26 22:13 [bug#43639] [PATCH] [staging] gnu: groovy: Update to 3.0.5 Julien Lepiller
2020-09-26 22:18 ` [bug#43639] [PATCH 01/15] gnu: Add java-treelayout Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 02/15] gnu: Add java-antlr4-runtime Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 03/15] gnu: Add antlr4 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 04/15] gnu: ant/java8: Update to 1.10.8 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 05/15] gnu: ant: Update to 1.9.15 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 06/15] gnu: Add java-asm-8 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 07/15] gnu: Add java-asm-tree-8 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 08/15] gnu: Add java-asm-analysis-8 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 09/15] gnu: Add java-asm-util-8 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 10/15] gnu: Add java-antlr4-runtime-4.1 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 11/15] gnu: Add antlr4-4.1 Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 12/15] gnu: Add java-tunnelvisionlabs-antlr4-runtime-annotations Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 13/15] gnu: Add java-tunnelvisionlabs-antlr4-runtime Julien Lepiller
2020-09-26 22:18   ` [bug#43639] [PATCH 14/15] gnu: Add java-tunnelvisionlabs-antlr4 Julien Lepiller
2020-09-26 22:18   ` Julien Lepiller [this message]
2020-09-26 22:23 ` [bug#43639] [PATCH 16/16] gnu: groovy: Update to 3.0.5 Julien Lepiller
2020-10-14  1:44 ` bug#43639: [PATCH] [staging] " Julien Lepiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200926221824.20925-15-julien@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=43639@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).