Subject: Re: [bug#54560] [PATCH 01/47] gnu: Add go-google-golang-org-protobuf.

From: Maxime Devos <[email-masked]>
Date: Sat, 26 Mar 2022 10:31:16 +0100

Leo Nikkilä schreef op vr 25-03-2022 om 22:55 [+0000]:
> However, due to how go-build-system correlates these import paths with directory paths, supporting wildcards in `#:import-path` directly would require further changes to the build system.

Looking at go-build-system.scm, it seems that 'unpack, 'install'
and 'install-licenses' need to be modified to drop the "/..." suffix,
if any?  If this is done in go-build-system, then more packages could
benefit and perhaps some existing package definitions could be
simplified.

;; See <https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns>
;; for how wildcard paths work.
(define (unwildcard-import-path import-path
  (if (string-suffix? "/..." import-path)
      (string-drop-right import-path 4)
      import-path))

;; in 'unpack', change  
;; (when (string-null? unpack-path)
;;    (set! unpack-path import-path))
;; to
;; (when (string-null? unpack-path)
;;    (set! unpack-path (unwildcard-import-path unpack-path)))
;;
;; and likewise in 'install' and and 'install-license-files'.

Greetings,
Maxime.