From 91072287a6b07a9fd6a43c717cc6fcecaa7e77c9 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 23 Oct 2017 21:54:44 +0200 Subject: [PATCH] gnu: Add java-tomcat. * gnu/packages/web.scm (java-tomcat): New variable. --- gnu/packages/web.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index c7b44fafa1..bc0c606f86 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -52,6 +52,7 @@ #:use-module (guix build-system r) #:use-module (guix build-system trivial) #:use-module (guix build-system python) + #:use-module (guix build-system ant) #:use-module (gnu packages) #:use-module (gnu packages apr) #:use-module (gnu packages check) @@ -5384,3 +5385,54 @@ collection creation and deletion, and locking operations.") "Py-ubjson is a Python module providing an Universal Binary JSON encoder/decoder based on the draft-12 specification for UBJSON.") (license l:asl2.0))) + +(define-public java-tomcat + (package + (name "java-tomcat") + (version "8.5.23") + (source (origin + (method url-fetch) + (uri (string-append "mirror://apache/tomcat/tomcat-8/v" + version "/src/apache-tomcat-" version "-src.tar.gz")) + (sha256 + (base32 + "1m6b1dikib46kbgz9gf0p6svi00nsw62b9kgjzn6sda151skbbza")))) + (build-system ant-build-system) + (inputs + `(("java-eclipse-jdt-core" ,java-eclipse-jdt-core))) + (native-inputs + `(("java-junit" ,java-junit))) + (arguments + `(#:build-target "package" + #:tests? #f; requires downloading some files. + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'prevent-download + (lambda _ + ;; This directory must exist + (mkdir "downloads") + ;; We patch build.xml so it doesn't download any dependency, because + ;; we already have all of them. + (substitute* "build.xml" + (("download-compile,") "") + (("depends=\"validate\"") "depends=\"build-prepare\"") + ((",download-validate") "")) + #t)) + (add-after 'unpack 'generate-properties + (lambda _ + ;; This could have been passed to make-flags, but getcwd returns + ;; a different directory then. + (with-output-to-file "build.properties" + (lambda _ + (display + (string-append "base.path=" (getcwd) "/downloads\n")))) + #t)) + (replace 'install + (install-jars "output/build/lib"))))) + (home-page "https://tomcat.apache.org") + (synopsis "Java Servlet, JavaServer Pages, Java Expression Language and Java +WebSocket") + (description "Apache Tomcat is a free implementation of the Java +Servlet, JavaServer Pages, Java Expression Language and Java WebSocket +technologies.") + (license l:asl2.0)))