summary refs log tree commit diff
path: root/gnu/packages/ipfs.scm
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-09-14 21:57:08 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-11-09 21:33:42 +0000
commit9e897dabcab40c4b592a311aab0729e86878d0a5 (patch)
tree92f67f075db83dd2e553ad810713b654c89b7324 /gnu/packages/ipfs.scm
parente703f973eb12144f6f7dccdc4c707053ad69d0dc (diff)
downloadguix-9e897dabcab40c4b592a311aab0729e86878d0a5.tar.gz
gnu: kubo: Fix build.
* gnu/packages/ipfs.scm (kubo): Fix build.
[arguments]: <#:phases>: Swap 'fix-embed-go-libp2p-asm-util with
'fix-embed-files, which implements generalized solution to fix embed
files issue.

Change-Id: I1cc9b6eaf7ca72c0cea81387c9b80853b22dcf83
Diffstat (limited to 'gnu/packages/ipfs.scm')
-rw-r--r--gnu/packages/ipfs.scm27
1 files changed, 19 insertions, 8 deletions
diff --git a/gnu/packages/ipfs.scm b/gnu/packages/ipfs.scm
index 3c3604902b..f01f5f53c1 100644
--- a/gnu/packages/ipfs.scm
+++ b/gnu/packages/ipfs.scm
@@ -1102,15 +1102,26 @@ types.")
       #:import-path "github.com/ipfs/kubo/cmd/ipfs"
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'fix-embed-go-libp2p-asn-util
+          ;; 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 _
-              (delete-file
-               "src/github.com/libp2p/go-libp2p-asn-util/sorted-network-list.bin")
-              (copy-file
-               (string-append
-                #$(this-package-input "go-github-com-libp2p-go-libp2p-asn-util")
-                "/src/github.com/libp2p/go-libp2p-asn-util/sorted-network-list.bin")
-               "src/github.com/libp2p/go-libp2p-asn-util/sorted-network-list.bin")))
+              (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
           (add-after 'install 'install-bashcompletion
             (lambda _