From 04ddca26e68af423c2bb3801803e8b476ac48315 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 23 Feb 2018 10:09:50 +0100 Subject: gnu: Add java-cisd-args4j. * gnu/packages/java.scm (java-cisd-args4j): New variable. --- gnu/packages/java.scm | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) (limited to 'gnu/packages') diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 1e2b30d8d9..7ad0c41268 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -2233,6 +2233,120 @@ (define-public java-cisd-base (license (list license:asl2.0 (license:non-copyleft "file://source/c/COPYING")))))) +(define-public java-cisd-args4j + (let ((revision 39162) + (base-version "9.11.2")) + (package + (name "java-cisd-args4j") + (version (string-append base-version "-" (number->string revision))) + (source (origin + (method svn-fetch) + (uri (svn-reference + (url (string-append "http://svnsis.ethz.ch/repos/cisd/" + "args4j/tags/release/" + (version-major+minor base-version) + ".x/" base-version "/args4j/")) + (revision revision))) + (file-name (string-append "java-cisd-args4j-" version "-checkout")) + (sha256 + (base32 + "0hhqznjaivq7ips7mkwas78z42s6djsm20rrs7g1zd59rcsakxn2")))) + (build-system ant-build-system) + (arguments + `(#:make-flags '("-file" "build/build.xml") + #:tests? #f ; there are no tests + ;; There are weird build failures with JDK8, such as: "The type + ;; java.io.ObjectInputStream cannot be resolved. It is indirectly + ;; referenced from required .class files" + #:jdk ,icedtea-7 + #:modules ((guix build ant-build-system) + (guix build utils) + (guix build java-utils) + (sxml simple) + (sxml transform) + (sxml xpath)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-build-resources + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "../build_resources") + (invoke "tar" "xf" (assoc-ref inputs "build-resources") + "-C" "../build_resources" + "--strip-components=1") + (mkdir-p "../build_resources/lib") + #t)) + (add-after 'unpack-build-resources 'fix-dependencies + (lambda* (#:key inputs #:allow-other-keys) + ;; FIXME: There should be a more convenient abstraction for + ;; editing XML files. + (with-directory-excursion "../build_resources/ant/" + (chmod "build-common.xml" #o664) + (call-with-output-file "build-common.xml.new" + (lambda (port) + (sxml->xml + (pre-post-order + (with-input-from-file "build-common.xml" + (lambda _ (xml->sxml #:trim-whitespace? #t))) + `(;; Remove dependency on classycle and custom ant tasks + (taskdef . ,(lambda (tag . kids) + (let ((name ((sxpath '(name *text*)) kids))) + (if (or (member "build-info" name) + (member "dependency-checker" name) + (member "build-java-subprojects" name) + (member "project-classpath" name)) + '() ; skip + `(,tag ,@kids))))) + (typedef . ,(lambda (tag . kids) + (let ((name ((sxpath '(name *text*)) kids))) + (if (member "recursive-jar" name) + '() ; skip + `(,tag ,@kids))))) + (build-java-subprojects . ,(lambda _ '())) + ;; Ignore everything else + (*default* . ,(lambda (tag . kids) `(,tag ,@kids))) + (*text* . ,(lambda (_ txt) txt)))) + port))) + (rename-file "build-common.xml.new" "build-common.xml")) + (substitute* "build/build.xml" + (("\\$\\{lib\\}/cisd-base/cisd-base.jar") + (string-append (assoc-ref inputs "java-cisd-base") + "/share/java/sis-base.jar")) + ;; Remove dependency on svn + (("string revision)) + (("\\$\\{version.number\\}") ,base-version) + ;; Don't use custom ant tasks. + (("recursive-jar") "jar") + (("