From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AIxqIvS/b19PVgAA0tVLHw (envelope-from ) for ; Sat, 26 Sep 2020 22:25:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yPVkHvS/b1/lXQAA1q6Kng (envelope-from ) for ; Sat, 26 Sep 2020 22:25:56 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5AEBF940C31 for ; Sat, 26 Sep 2020 22:20:56 +0000 (UTC) Received: from localhost ([::1]:35310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMIYp-0008Ll-BL for larch@yhetil.org; Sat, 26 Sep 2020 18:20:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMIY1-0007qG-74 for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMIY0-0003yK-Sz for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMIY0-0004S7-Q6 for guix-patches@gnu.org; Sat, 26 Sep 2020 18:20:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43639] [PATCH 15/15] gnu: Add java-javaparser. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Sep 2020 22:20:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43639 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43639@debbugs.gnu.org Received: via spool by 43639-submit@debbugs.gnu.org id=B43639.160115875016998 (code B ref 43639); Sat, 26 Sep 2020 22:20:04 +0000 Received: (at 43639) by debbugs.gnu.org; 26 Sep 2020 22:19:10 +0000 Received: from localhost ([127.0.0.1]:47953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIX8-0004Q0-4x for submit@debbugs.gnu.org; Sat, 26 Sep 2020 18:19:10 -0400 Received: from lepiller.eu ([89.234.186.109]:49482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMIWu-0004Mg-Ov for 43639@debbugs.gnu.org; Sat, 26 Sep 2020 18:18:57 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 83dec06c for <43639@debbugs.gnu.org>; Sat, 26 Sep 2020 22:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=j+b+xruuTiBIfnAC/XIzA8206 jjJ7oVesK3lxFNlL4A=; b=l0viJj1RvxczQdf5cX+s9X9P0H9cMDTBehIyCVkBn t5x0Na+bE+OFio12cP7ke7lxxAYSdenmHQY3IqUE1/HAMqXBy8ZpwTKpvO+vwLY6 j/ZOkQE4z91lTiW8uw5a9me4EEDsfGgadrMf6h+cuUOZmAkgHGhgGMnjzIEzI5ZW fz5Dn86+e87nz/Cy1XIfB8+9mCAtWnK/w19mn+i/A4YTMOFlzMqIRdFaYOK4LqvB Gu+X5CWE+Go32KXyjBRfA6Fv1l1oGlRFNFQ2yZ2RIpms5egw3Bst9jYqJfFEryS2 rTKrgUcl53gG3abaHfQTVGnkcspSxYtkZgCVkSQyhH6tg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id ad7a4838 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <43639@debbugs.gnu.org>; Sat, 26 Sep 2020 22:18:48 +0000 (UTC) From: Julien Lepiller Date: Sun, 27 Sep 2020 00:18:24 +0200 Message-Id: <20200926221824.20925-15-julien@lepiller.eu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200926221824.20925-1-julien@lepiller.eu> References: <20200927001335.40c2409a@tachikoma.lepiller.eu> <20200926221824.20925-1-julien@lepiller.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-TUID: LUN7zBKu3UHg * 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