1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-13 10:30:43 +02:00

gnu: build/go: Apply default 'fix-embed-files phase.

These changes remove redundant phases where files, requiring to be embed
during build or check phases, are copied to the build directory as
proposed in <https://issues.guix.gnu.org/73299>.

* gnu/packages/backup.scm (restic-rest-server) [arguments]: <#:phases>:
Remove 'fix-embed-files phase.
* gnu/packages/configuration-management.scm (chezmoi): Likewise.
* gnu/packages/packages/golang-build.scm (go-github-com-golang-protobuf): Likewise.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-loads,
go-github-com-go-openapi-runtime, go-github-com-golang-groupcache): Likewise.
* gnu/packages/golang-xyz.scm (go-github-com-dgraph-io-badger): Likewise.
* gnu/packages/golang.scm (go-github-com-ssgelm-cookiejarparser): Likewise.
* gnu/packages/ipfs.scm (go-github-com-ipfs-go-ds-badger,
go-github-com-libp2p-go-libp2p, kubo): Likewise.
* gnu/packages/irc.scm (soju): Likewise.
* gnu/packages/networking.scm (nebula): Likewise.
* gnu/packages/prometheus.scm (go-github-com-nbrownus-go-metrics-prometheus,
go-github-com-prometheus-client-golang, go-github-com-prometheus-common,
go-github-com-prometheus-common-sigv4, go-github-com-prometheus-exporter-toolkit,
go-github-com-prometheus-statsd-exporter): Likewise
* gnu/packages/version-control.scm (git-lfs): Likewise.
* gnu/packages/web.scm (miniflux): Likewise.

* gnu/packages/golang-crypto.scm (go-filippo-io-age): [arguments]:
<#:phases>: Remove 'copy-input-to-vendor-direcotyr and
'remove-vendor-directory phases.
* gnu/packages/golang-web.scm (go-github-com-go-openapi-analysis,
go-github-com-go-openapi-analysis, go-github-com-go-openapi-validate): Likewise.
* gnu/packages/golang.scm (go-github-com-charmbracelet-glamour): Likewise.
* gnu/packages/textutils.scm (vale): Likewise.

Change-Id: Ic2ec01c8caf86f3ae69d7a1812c1e0b78a549e91
This commit is contained in:
Sharlatan Hellseher 2024-09-19 14:00:56 +01:00
parent 922d017081
commit 9ff0a39943
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5
14 changed files with 31 additions and 593 deletions

View file

@ -1058,24 +1058,6 @@ precious backup space.
#:unpack-path "github.com/restic/rest-server" #:unpack-path "github.com/restic/rest-server"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
;; Unit tests seems to break with Guix' non-standard TMPDIR. ;; Unit tests seems to break with Guix' non-standard TMPDIR.
(add-before 'check 'set-tmpdir (add-before 'check 'set-tmpdir
(lambda _ (lambda _

View file

@ -50,6 +50,7 @@
(arguments (arguments
(list (list
#:import-path "github.com/twpayne/chezmoi" #:import-path "github.com/twpayne/chezmoi"
#:embed-files #~(list ".*\\.xml")
#:install-source? #f #:install-source? #f
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
@ -80,25 +81,7 @@
"secretkeepassxc.txt" "secretkeepassxc.txt"
"secretlastpass.txt" "secretlastpass.txt"
"secretonepassword.txt" "secretonepassword.txt"
"secretpass.txt")))) "secretpass.txt")))))))
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append "\\.xml$"))))))))
(native-inputs (native-inputs
(list go-github-com-masterminds-sprig-v3 (list go-github-com-masterminds-sprig-v3
go-github-com-bmatcuk-doublestar-v2 go-github-com-bmatcuk-doublestar-v2

View file

@ -103,24 +103,6 @@ functions that have a name matched by regex:.")
#:import-path "github.com/golang/protobuf" #:import-path "github.com/golang/protobuf"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Workaround for go-build-system's lack of Go modules ;; XXX: Workaround for go-build-system's lack of Go modules
;; support. ;; support.
(delete 'build) (delete 'build)

View file

@ -137,33 +137,10 @@ can be ignored.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "filippo.io/age" #:embed-files #~(list "armor.*" "header_crlf" "hmac_.*" "scrypt.*"
#:phases "stanza_.*" "stream_.*" "version_unsupported"
#~(modify-phases %standard-phases "x25519.*" "x25519_.*")
;; FIXME: src/c2sp.org/CCTV/age/age.go:13:12: pattern testdata: #:import-path "filippo.io/age"))
;; cannot embed directory testdata: contains no embeddable files
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-native-input "go-c2sp-org-cctv-age")
"/src/c2sp.org")
"vendor/c2sp.org"))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(delete-file-recursively "vendor")))))))
(native-inputs (native-inputs
(list go-c2sp-org-cctv-age (list go-c2sp-org-cctv-age
go-github-com-rogpeppe-go-internal)) go-github-com-rogpeppe-go-internal))

View file

@ -1596,6 +1596,7 @@ language.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:import-path "github.com/go-openapi/analysis" #:import-path "github.com/go-openapi/analysis"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
@ -1606,35 +1607,11 @@ language.")
;; Tests requiring network access. ;; Tests requiring network access.
(("TestFlatten_RemoteAbsolute") (("TestFlatten_RemoteAbsolute")
"OffTestFlatten_RemoteAbsolute"))))) "OffTestFlatten_RemoteAbsolute")))))
;; FIXME: pattern schemas/*.json: cannot embed irregular file
;; schemas/jsonschema-draft-04.json
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-go-openapi-spec")
"/src/github.com")
"vendor/github.com"))))
(replace 'check (replace 'check
(lambda* (#:key tests? import-path #:allow-other-keys) (lambda* (#:key tests? import-path #:allow-other-keys)
(when tests? (when tests?
(with-directory-excursion (string-append "src/" import-path) (with-directory-excursion (string-append "src/" import-path)
(invoke "go" "test" "-v" "./..."))))) (invoke "go" "test" "-v" "./..."))))))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(delete-file-recursively "vendor")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -1749,28 +1726,8 @@ prototyped in @url{https://github.com/xeipuuv/gojsonreference}.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/go-openapi/loads" #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:phases #:import-path "github.com/go-openapi/loads"))
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src"
"^(jsonschema-draft-04|schema)\\.json$")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -1802,27 +1759,8 @@ Supports JSON and YAML documents.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/go-openapi/runtime" #:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:phases #:import-path "github.com/go-openapi/runtime"))
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" "\\.json$")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -1957,6 +1895,7 @@ projects.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:embed-files #~(list "jsonschema-draft-04\\.json" "schema\\.json")
#:import-path "github.com/go-openapi/validate" #:import-path "github.com/go-openapi/validate"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
@ -1967,41 +1906,7 @@ projects.")
(for-each delete-file (for-each delete-file
(list "benchmark_test.go" (list "benchmark_test.go"
"example_validator_test.go" "example_validator_test.go"
"doc_test.go"))))) "doc_test.go"))))))))
;; FIXME: pattern schemas/*.json: cannot embed irregular file
;; schemas/jsonschema-draft-04.json
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-go-openapi-loads")
"/src/github.com")
"vendor/github.com")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-go-openapi-spec")
"/src/github.com")
"vendor/github.com")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-go-openapi-analysis")
"/src/github.com")
"vendor/github.com"))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(delete-file-recursively "vendor")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -2169,27 +2074,7 @@ from CloudFlare's github.com/cloudflare/cfssl/revoke.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/golang/groupcache" #:import-path "github.com/golang/groupcache"))
#:phases
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$")))))))
(propagated-inputs (propagated-inputs
(list go-github-com-golang-protobuf)) (list go-github-com-golang-protobuf))
(home-page "https://github.com/golang/groupcache") (home-page "https://github.com/golang/groupcache")

View file

@ -2110,25 +2110,6 @@ encoding/decoding. It has no dependencies.")
#:import-path "github.com/dgraph-io/badger" #:import-path "github.com/dgraph-io/badger"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb)$")))))
(add-after 'unpack 'patch-failing-tests (add-after 'unpack 'patch-failing-tests
(lambda* (#:key unpack-path tests? #:allow-other-keys) (lambda* (#:key unpack-path tests? #:allow-other-keys)
(with-directory-excursion (string-append "src/" unpack-path) (with-directory-excursion (string-append "src/" unpack-path)
@ -4595,24 +4576,6 @@ allocator. This is primarily useful for long lived buffers that usually sit emp
#:import-path "github.com/libp2p/go-msgio" #:import-path "github.com/libp2p/go-msgio"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Replace when go-build-system supports nested path. ;; XXX: Replace when go-build-system supports nested path.
(replace 'check (replace 'check
(lambda* (#:key import-path tests? #:allow-other-keys) (lambda* (#:key import-path tests? #:allow-other-keys)
@ -5164,24 +5127,6 @@ other directories. It is optimized for filewalking.")
#:import-path "github.com/matttproud/golang_protobuf_extensions/v2" #:import-path "github.com/matttproud/golang_protobuf_extensions/v2"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Activate when go-build-system supports submodules. ;; XXX: Activate when go-build-system supports submodules.
(delete 'build) (delete 'build)
;; XXX: Replace when go-build-system supports nested path. ;; XXX: Replace when go-build-system supports nested path.
@ -5776,33 +5721,8 @@ list of sentences.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/niklasfasching/go-org" #:embed-files #~(list ".*\\.xml")
#:phases #:import-path "github.com/niklasfasching/go-org"))
#~(modify-phases %standard-phases
;; FIXME: Pattern embedded: cannot embed directory embedded:
;; contains no embeddable files.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-alecthomas-chroma-v2")
"/src/github.com")
"vendor/github.com"))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(delete-file-recursively "vendor")))))))
(propagated-inputs (propagated-inputs
(list go-golang-org-x-net (list go-golang-org-x-net
go-github-com-pmezard-go-difflib go-github-com-pmezard-go-difflib

View file

@ -5899,6 +5899,7 @@ size of the terminal.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:embed-files #~(list ".*\\.xml")
#:import-path "github.com/charmbracelet/glamour" #:import-path "github.com/charmbracelet/glamour"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
@ -5912,31 +5913,7 @@ size of the terminal.")
#o644) #o644)
(substitute* "src/github.com/charmbracelet/glamour/glamour_test.go" (substitute* "src/github.com/charmbracelet/glamour/glamour_test.go"
((" generate = false") ((" generate = false")
" generate = true")))) " generate = true")))))))
;; FIXME: Pattern embedded: cannot embed directory embedded:
;; contains no embeddable files.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-input "go-github-com-alecthomas-chroma-v2")
"/src/github.com")
"vendor/github.com"))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(delete-file-recursively "vendor")))))))
(propagated-inputs (propagated-inputs
(list go-github-com-alecthomas-chroma-v2 (list go-github-com-alecthomas-chroma-v2
go-github-com-microcosm-cc-bluemonday go-github-com-microcosm-cc-bluemonday
@ -7763,16 +7740,8 @@ of the current user.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/ssgelm/cookiejarparser" #:embed-files #~(list "children" "nodes" "text")
#:phases #:import-path "github.com/ssgelm/cookiejarparser"))
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-embed-x-net
(lambda _
(delete-file-recursively "src/golang.org/x/net/publicsuffix/data")
(copy-recursively
#$(file-append (this-package-input "go-golang-org-x-net")
"/src/golang.org/x/net/publicsuffix/data")
"src/golang.org/x/net/publicsuffix/data"))))))
(propagated-inputs (list go-golang-org-x-net)) (propagated-inputs (list go-golang-org-x-net))
(home-page "https://github.com/ssgelm/cookiejarparser") (home-page "https://github.com/ssgelm/cookiejarparser")
(synopsis "Parse a curl cookiejar with Go") (synopsis "Parse a curl cookiejar with Go")

View file

@ -354,27 +354,7 @@ throughout its lifetime.")
(list (list
;; XXX: Tests time out, figure out workaround. ;; XXX: Tests time out, figure out workaround.
#:tests? #f #:tests? #f
#:import-path "github.com/ipfs/go-ds-badger" #:import-path "github.com/ipfs/go-ds-badger"))
#:phases
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$")))))))
(propagated-inputs (propagated-inputs
(list go-github-com-dgraph-io-badger (list go-github-com-dgraph-io-badger
go-github-com-ipfs-go-datastore go-github-com-ipfs-go-datastore
@ -854,30 +834,8 @@ their levels to be controlled individually.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:import-path "github.com/libp2p/go-libp2p" #:embed-files #~(list "sorted-network-list.bin")
#:phases #:import-path "github.com/libp2p/go-libp2p"))
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each
(lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb"
"|sorted-network-list.bin)$"))))))))
(propagated-inputs (propagated-inputs
(list go-github-com-benbjohnson-clock (list go-github-com-benbjohnson-clock
go-github-com-davidlazar-go-crypto go-github-com-davidlazar-go-crypto
@ -1098,30 +1056,11 @@ types.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:embed-files #~(list "sorted-network-list.bin")
#:unpack-path "github.com/ipfs/kubo" #:unpack-path "github.com/ipfs/kubo"
#:import-path "github.com/ipfs/kubo/cmd/ipfs" #:import-path "github.com/ipfs/kubo/cmd/ipfs"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb"
"|sorted-network-list.bin)$")))))
;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md ;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md
(add-after 'install 'install-bashcompletion (add-after 'install 'install-bashcompletion
(lambda _ (lambda _

View file

@ -1160,24 +1160,6 @@ what.")
#:import-path "codeberg.org/emersion/soju" #:import-path "codeberg.org/emersion/soju"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
(add-after 'unpack 'adjust-makefile (add-after 'unpack 'adjust-makefile
(lambda* (#:key import-path #:allow-other-keys) (lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path) (with-directory-excursion (string-append "src/" import-path)

View file

@ -4779,24 +4779,6 @@ IPv6 Internet connectivity - it also works over IPv4.")
#:install-source? #f #:install-source? #f
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
(replace 'build (replace 'build
(lambda* (#:key import-path #:allow-other-keys) (lambda* (#:key import-path #:allow-other-keys)
;; Suggested option to provide build time flags is not supported ;; Suggested option to provide build time flags is not supported

View file

@ -112,27 +112,7 @@ x/net/trace)} tracing wrappers @code{net.Conn}, both inbound
;; The project looks abandoned, tests failed with a new go-metrics, see ;; The project looks abandoned, tests failed with a new go-metrics, see
;; <https://github.com/nbrownus/go-metrics-prometheus/pull/2>. ;; <https://github.com/nbrownus/go-metrics-prometheus/pull/2>.
#:tests? #f #:tests? #f
#:import-path "github.com/nbrownus/go-metrics-prometheus" #:import-path "github.com/nbrownus/go-metrics-prometheus"))
#:phases
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -169,25 +149,6 @@ registry.")
#:import-path "github.com/prometheus/client_golang" #:import-path "github.com/prometheus/client_golang"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb)$")))))
(add-after 'unpack 'remove-examples-and-tutorials (add-after 'unpack 'remove-examples-and-tutorials
(lambda* (#:key import-path #:allow-other-keys) (lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path) (with-directory-excursion (string-append "src/" import-path)
@ -278,25 +239,6 @@ Prometheus metrics.")
#:import-path "github.com/prometheus/common" #:import-path "github.com/prometheus/common"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb)$")))))
;; XXX: Workaround for go-build-system's lack of Go modules support. ;; XXX: Workaround for go-build-system's lack of Go modules support.
(delete 'build) (delete 'build)
(replace 'check (replace 'check
@ -408,27 +350,7 @@ metrics.")
(arguments (arguments
(list (list
#:import-path "github.com/prometheus/common/sigv4" #:import-path "github.com/prometheus/common/sigv4"
#:unpack-path "github.com/prometheus/common" #:unpack-path "github.com/prometheus/common"))
#:phases
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$")))))))
(native-inputs (native-inputs
(list go-github-com-stretchr-testify)) (list go-github-com-stretchr-testify))
(propagated-inputs (propagated-inputs
@ -463,22 +385,6 @@ from the default AWS credential chain.")
#:import-path "github.com/prometheus/exporter-toolkit" #:import-path "github.com/prometheus/exporter-toolkit"
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'fix-embed-editions-defaults-binpb
(lambda _
(let* ((import-path "google.golang.org/protobuf")
(subdir "internal/editiondefaults")
(embed-file "editions_defaults.binpb")
(embed-file-path
(string-append "src/"
import-path "/"
subdir "/"
embed-file)))
(delete-file-recursively embed-file-path)
(copy-file
(string-append
#$(this-package-native-input "go-google-golang-org-protobuf")
"/" embed-file-path)
embed-file-path))))
;; XXX: Workaround for go-build-system's lack of Go modules support. ;; XXX: Workaround for go-build-system's lack of Go modules support.
(delete 'build) (delete 'build)
(replace 'check (replace 'check
@ -572,29 +478,7 @@ kernel, and process metrics from the @file{/proc} pseudo file system.")
(arguments (arguments
(list (list
#:import-path "github.com/prometheus/statsd_exporter" #:import-path "github.com/prometheus/statsd_exporter"
#:phases #:embed-files #~(list "landing_page.css" "landing_page.html")))
#~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" (string-append
".*(editions_defaults.binpb"
"|landing_page.css"
"|landing_page.html)$"))))))))
(native-inputs (native-inputs
(list go-github-com-stvp-go-udp-testing)) (list go-github-com-stvp-go-udp-testing))
(propagated-inputs (propagated-inputs

View file

@ -1517,6 +1517,7 @@ of a Unix terminal to HTML code.")
(arguments (arguments
(list (list
#:install-source? #f #:install-source? #f
#:embed-files #~(list ".*\\.gob")
#:import-path "github.com/errata-ai/vale/cmd/vale" #:import-path "github.com/errata-ai/vale/cmd/vale"
#:unpack-path "github.com/errata-ai/vale" #:unpack-path "github.com/errata-ai/vale"
#:phases #:phases
@ -1536,26 +1537,6 @@ of a Unix terminal to HTML code.")
(("TestLocalZip") "OffTestLocalZip") (("TestLocalZip") "OffTestLocalZip")
(("TestNoPkgFound") "OffTestNoPkgFound") (("TestNoPkgFound") "OffTestNoPkgFound")
(("TestV3Pkg") "OffTestV3Pkg"))))) (("TestV3Pkg") "OffTestV3Pkg")))))
;; FIXME: Pattern embedded: cannot embed directory embedded:
;; contains no embeddable files.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module which is sourced during setup environment phase, but
;; easy resolved after coping to expected directory "vendor" within
;; the current package, see details in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-before 'build 'copy-input-to-vendor-directory
(lambda* (#:key unpack-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" unpack-path)
(mkdir "vendor")
(copy-recursively
(string-append
#$(this-package-native-input "go-github-com-jdkato-twine")
"/src/github.com")
"vendor/github.com"))))
;; XXX: Workaround for go-build-system's lack of Go modules ;; XXX: Workaround for go-build-system's lack of Go modules
;; support. ;; support.
(replace 'check (replace 'check
@ -1563,11 +1544,7 @@ of a Unix terminal to HTML code.")
(when tests? (when tests?
(with-directory-excursion (string-append "src/" unpack-path) (with-directory-excursion (string-append "src/" unpack-path)
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
(invoke "go" "test" "-v" "./..."))))) (invoke "go" "test" "-v" "./..."))))))))
(add-before 'install 'remove-vendor-directory
(lambda* (#:key unpack-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" unpack-path)
(delete-file-recursively "vendor")))))))
(native-inputs (native-inputs
(list go-github-com-masterminds-sprig-v3 (list go-github-com-masterminds-sprig-v3
go-github-com-adrg-strutil go-github-com-adrg-strutil

View file

@ -3686,6 +3686,7 @@ will reconstruct the object along its delta-base chain and return it.")
(build-system go-build-system) (build-system go-build-system)
(arguments (arguments
(list (list
#:embed-files #~(list "children" "nodes" "text")
#:import-path "github.com/git-lfs/git-lfs" #:import-path "github.com/git-lfs/git-lfs"
#:install-source? #f #:install-source? #f
#:phases #:phases
@ -3695,13 +3696,6 @@ will reconstruct the object along its delta-base chain and return it.")
(substitute* "src/github.com/git-lfs/git-lfs/lfs/hook.go" (substitute* "src/github.com/git-lfs/git-lfs/lfs/hook.go"
(("/bin/sh") (("/bin/sh")
(search-input-file inputs "bin/sh"))))) (search-input-file inputs "bin/sh")))))
(add-after 'unpack 'fix-embed-x-net
(lambda _
(delete-file-recursively "src/golang.org/x/net/publicsuffix/data")
(copy-recursively
#$(file-append (this-package-input "go-golang-org-x-net")
"/src/golang.org/x/net/publicsuffix/data")
"src/golang.org/x/net/publicsuffix/data")))
;; Only build the man pages if ruby-asciidoctor is available. ;; Only build the man pages if ruby-asciidoctor is available.
#$@(if (this-package-native-input "ruby-asciidoctor") #$@(if (this-package-native-input "ruby-asciidoctor")
#~((add-before 'build 'man-gen #~((add-before 'build 'man-gen

View file

@ -367,24 +367,6 @@ and its related documentation.")
#$version)) #$version))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
;; TODO: Implement it in go-build-system.
;;
;; This happens due to Golang can't determine the valid directory of
;; the module of embed file which is symlinked during setup
;; environment phase, but easy resolved after coping file from the
;; store to the build directory of the current package, see details
;; in Golang source:
;;
;; - URL: <https://github.com/golang/go/blob/>
;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454
;; - file: src/cmd/go/internal/load/pkg.go#L2059
(add-after 'unpack 'fix-embed-files
(lambda _
(for-each (lambda (file)
(let ((file-store-path (readlink file)))
(delete-file file)
(copy-recursively file-store-path file)))
(find-files "src" ".*(editions_defaults.binpb)$"))))
;; XXX: Replace when go-build-system supports nested path. ;; XXX: Replace when go-build-system supports nested path.
(replace 'check (replace 'check
(lambda* (#:key import-path tests? #:allow-other-keys) (lambda* (#:key import-path tests? #:allow-other-keys)