mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-13 22:50:23 -05:00
import: go: Recognize major version suffixes.
Do not treat major version suffixes (such as "/v3") as repository subdirectories. See <https://golang.org/ref/mod#major-version-suffixes>. * guix/import/go.scm (go-module->guix-package): When determining the unpack path, compare 'root-module-path' to 'module-path-sans-suffix' instead of 'module-path'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
ac43ead774
commit
834ff65e85
1 changed files with 3 additions and 1 deletions
|
@ -612,6 +612,8 @@ (define* (go-module->guix-package module-path #:key
|
||||||
(dependencies (if pin-versions?
|
(dependencies (if pin-versions?
|
||||||
dependencies+versions
|
dependencies+versions
|
||||||
(map car dependencies+versions)))
|
(map car dependencies+versions)))
|
||||||
|
(module-path-sans-suffix
|
||||||
|
(match:prefix (string-match "([\\./]v[0-9]+)?$" module-path)))
|
||||||
(guix-name (go-module->guix-package-name module-path))
|
(guix-name (go-module->guix-package-name module-path))
|
||||||
(root-module-path (module-path->repository-root module-path))
|
(root-module-path (module-path->repository-root module-path))
|
||||||
;; The VCS type and URL are not included in goproxy information. For
|
;; The VCS type and URL are not included in goproxy information. For
|
||||||
|
@ -631,7 +633,7 @@ (define* (go-module->guix-package module-path #:key
|
||||||
(build-system go-build-system)
|
(build-system go-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:import-path ,module-path
|
'(#:import-path ,module-path
|
||||||
,@(if (string=? module-path root-module-path)
|
,@(if (string=? module-path-sans-suffix root-module-path)
|
||||||
'()
|
'()
|
||||||
`(#:unpack-path ,root-module-path))))
|
`(#:unpack-path ,root-module-path))))
|
||||||
,@(maybe-propagated-inputs
|
,@(maybe-propagated-inputs
|
||||||
|
|
Loading…
Reference in a new issue