aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2017-05-15 23:35:51 +0200
committerRicardo Wurmus <rekado@elephly.net>2017-05-15 23:35:51 +0200
commit3ad9039515f62cebdc07b6a6635c3672dfe67604 (patch)
tree7e504e0439ce693489cce015d4a3e5d572f9665c /gnu
parent4511e0db23b32d78675816da2343454f32fb2bf8 (diff)
downloadguix-3ad9039515f62cebdc07b6a6635c3672dfe67604.tar.gz
guix-3ad9039515f62cebdc07b6a6635c3672dfe67604.zip
gnu: antlr2: Simplify build phases.
* gnu/packages/java.scm (antl2)[arguments]: Simplify build phases.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/java.scm40
1 files changed, 10 insertions, 30 deletions
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 4793b30538..cc57158d3c 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -3118,41 +3118,21 @@ This is a part of the Apache Commons Project.")
(build-system gnu-build-system)
(arguments
`(#:tests? #f
+ #:imported-modules ((guix build ant-build-system)
+ (guix build syscalls)
+ ,@%gnu-build-system-modules)
+ #:modules (((guix build ant-build-system) #:prefix ant:)
+ (guix build gnu-build-system)
+ (guix build utils))
#:phases
(modify-phases %standard-phases
(add-after 'install 'strip-jar-timestamps
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (jar1 (string-append out "/lib/antlr.jar"))
- (jar2 (string-append out "/share/antlr-2.7.7/antlr.jar")))
- ;; XXX: copied from (guix build ant-build-system)
- (define (strip-jar jar dir)
- (let ((manifest (string-append dir "/META-INF/MANIFEST.MF")))
- (mkdir-p dir)
- (and (with-directory-excursion dir
- (zero? (system* "jar" "xf" jar)))
- (delete-file jar)
- (for-each (lambda (file)
- (let ((s (lstat file)))
- (unless (eq? (stat:type s) 'symlink)
- (utime file 0 0 0 0))))
- (find-files dir #:directories? #t))
- (with-directory-excursion dir
- (let* ((files (find-files "." ".*" #:directories? #t)))
- (unless (zero? (apply system*
- `("zip" "-X" ,jar ,manifest
- ,@files)))
- (error "'zip' failed"))))
- (utime jar 0 0)
- #t)))
- (strip-jar jar1 "temp1")
- (strip-jar jar2 "temp2"))))
+ (assoc-ref ant:%standard-phases 'strip-jar-timestamps))
(add-after 'configure 'fix-bin-ls
(lambda _
- (for-each (lambda (file)
- (substitute* file
- (("/bin/ls") "ls")))
- (find-files "." "Makefile")))))))
+ (substitute* (find-files "." "Makefile")
+ (("/bin/ls") "ls"))
+ #t)))))
(native-inputs
`(("which" ,which)
("zip" ,zip)