>From b9488bf5bea2720a8b320ff7009efef665e4be80 Mon Sep 17 00:00:00 2001 From: Julien Lepiller
Date: Thu, 13 Apr 2017 20:13:14 +0200 Subject: [PATCH 3/4] gnu: Add stringtemplate3. * gnu/packages/java.scm (stringtemplate3): New variable. --- gnu/packages/java.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index fc9e137b8..15b45a5e5 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -1220,3 +1220,41 @@ compilers, and translators from grammatical descriptions containing Java, C#, C++, or Python actions. ANTLR provides excellent support for tree construction, tree walking, and translation.") (license license:public-domain))) + +(define-public stringtemplate3 + (package + (name "stringtemplate3") + (version "3.2.1") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/antlr/website-st4/raw/" + "gh-pages/download/stringtemplate-" + version ".tar.gz")) + (sha256 + (base32 + "086yj68np1vqhkj7483diz3km6s6y4gmwqswa7524a0ca6vxn2is")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "stringtemplate-3.2.1.jar" + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'generate-grammar + (lambda _ + (let ((dir "src/org/antlr/stringtemplate/language/")) + (for-each (lambda (file) + (display file) + (newline) + (system* "antlr" "-o" dir (string-append dir file))) + '("template.g" "angle.bracket.template.g" "action.g" + "eval.g" "group.g" "interface.g")))))))) + (native-inputs + `(("antlr" ,antlr2))) + (home-page "http://www.stringtemplate.org") + (synopsis "Template engine to generate formatted text output") + (description "StringTemplate is a java template engine (with ports for C#, +Objective-C, JavaScript, Scala) for generating source code, web pages, emails, +or any other formatted text output. StringTemplate is particularly good at +code generators, multiple site skins, and internationalization / localization. +StringTemplate also powers ANTLR.") + (license license:bsd-3))) -- 2.12.2