guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: java-utils: Use 'strip-store-file-name'.


From: Ludovic Courtès
Subject: 02/02: java-utils: Use 'strip-store-file-name'.
Date: Fri, 19 Oct 2018 17:19:22 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit 418f1b241486ef7f98fdce1e6f8e53f2e7863fd9
Author: Alex Vong <address@hidden>
Date:   Thu Oct 18 03:08:31 2018 +0800

    java-utils: Use 'strip-store-file-name'.
    
    See the discussion at
    <https://lists.gnu.org/archive/html/guix-devel/2018-10/msg00250.html>.
    
    * guix/build/java-utils.scm (package-name-version): Remove it.
    (install-javadoc): Use 'strip-store-file-name' instead of
    'package-name-version'.
    
    Signed-off-by: Ludovic Courtès <address@hidden>
---
 guix/build/java-utils.scm | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/guix/build/java-utils.scm b/guix/build/java-utils.scm
index 128be1e..8200638 100644
--- a/guix/build/java-utils.scm
+++ b/guix/build/java-utils.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Hartmut Goebel <address@hidden>
 ;;; Copyright © 2016 Ricardo Wurmus <address@hidden>
+;;; Copyright © 2018 Alex Vong <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,12 +24,6 @@
             install-jars
             install-javadoc))
 
-;; Copied from haskell-build-system.scm
-(define (package-name-version store-dir)
-  "Given a store directory STORE-DIR return 'name-version' of the package."
-  (let* ((base (basename store-dir)))
-    (string-drop base (+ 1 (string-index base #\-)))))
-
 (define* (ant-build-javadoc #:key (target "javadoc") (make-flags '())
                             #:allow-other-keys)
   (apply invoke `("ant" ,target ,@make-flags)))
@@ -48,8 +43,9 @@ is used in case the build.xml does not include an install 
target."
 install javadocs when this is not done by the install target."
   (lambda* (#:key outputs #:allow-other-keys)
     (let* ((out (assoc-ref outputs "out"))
+           (name-version (strip-store-file-name out))
            (docs (string-append (or (assoc-ref outputs "doc") out)
-                                "/share/doc/" (package-name-version out) "/")))
+                                "/share/doc/" name-version "/")))
       (mkdir-p docs)
       (copy-recursively apidoc-directory docs)
       #t)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]