guix-commits
[Top][All Lists]
Advanced

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

02/07: import: go: Improve handling of modules in VCS subdirectories.


From: guix-commits
Subject: 02/07: import: go: Improve handling of modules in VCS subdirectories.
Date: Sat, 18 Sep 2021 17:09:32 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b3907e304d6e66fbd3cffd71446ac8c46d26d849
Author: Sarah Morgensen <iskarian@mgsn.dev>
AuthorDate: Thu Sep 16 18:24:40 2021 -0700

    import: go: Improve handling of modules in VCS subdirectories.
    
    Use the supplied module path (instead of the repository root) as the import
    path for everything except source and homepage URLs.  For modules not in the
    root of a VCS repository, set #:unpack-path to the repository root by 
default.
    
    Partly fixes <https://issues.guix.gnu.org/50595>.
    Reported by Stephen Paul Weber <singpolyma@singpolyma.net>.
    
    * guix/import/go.scm (go-module->guix-package): Use 'module-path'
    instead of 'root-module-path' for #:import-path.  Emit #:unpack-path
    when #:import-path is not equal to 'root-module-path'.
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 guix/import/go.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index c6ecdba..fe7387d 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -619,7 +619,7 @@ hint: use one of the following available versions ~a\n"
          (meta-data (fetch-module-meta-data root-module-path))
          (vcs-type (module-meta-vcs meta-data))
          (vcs-repo-url (module-meta-data-repo-url meta-data goproxy))
-         (synopsis (go-package-synopsis root-module-path))
+         (synopsis (go-package-synopsis module-path))
          (description (go-package-description module-path))
          (licenses (go-package-licenses module-path)))
     (values
@@ -630,7 +630,10 @@ hint: use one of the following available versions ~a\n"
          ,(vcs->origin vcs-type vcs-repo-url version*))
         (build-system go-build-system)
         (arguments
-         '(#:import-path ,root-module-path))
+         '(#:import-path ,module-path
+           ,@(if (string=? module-path root-module-path)
+                 '()
+                 `(#:unpack-path ,root-module-path))))
         ,@(maybe-propagated-inputs
            (map (match-lambda
                   ((name version)



reply via email to

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