ipfs.scm 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
  3. ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  4. ;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
  5. ;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
  6. ;;; Copyright © 2022 Maxime Devos <maximedevos@telenet.be>
  7. ;;;
  8. ;;; This file is part of GNU Guix.
  9. ;;;
  10. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  11. ;;; under the terms of the GNU General Public License as published by
  12. ;;; the Free Software Foundation; either version 3 of the License, or (at
  13. ;;; your option) any later version.
  14. ;;;
  15. ;;; GNU Guix is distributed in the hope that it will be useful, but
  16. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. ;;; GNU General Public License for more details.
  19. ;;;
  20. ;;; You should have received a copy of the GNU General Public License
  21. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. (define-module (gnu packages ipfs)
  23. #:use-module ((guix licenses) #:prefix license:)
  24. #:use-module (guix packages)
  25. #:use-module (guix gexp)
  26. #:use-module (guix git-download)
  27. #:use-module (guix download)
  28. #:use-module (guix build-system go)
  29. #:use-module (gnu packages golang)
  30. #:use-module (gnu packages python)
  31. #:use-module (gnu packages shells)
  32. #:use-module (gnu packages syncthing))
  33. (define-public go-github-com-ipfs-go-ipfs-cmdkit-files
  34. (let ((commit
  35. "386fcf8f18a185ec121676665fe2d9574496048d")
  36. (revision "0"))
  37. (package
  38. (name "go-github-com-ipfs-go-ipfs-cmdkit-files")
  39. (version (git-version "1.1.3" revision commit))
  40. (source
  41. (origin
  42. (method git-fetch)
  43. (uri (git-reference
  44. (url "https://github.com/ipfs/go-ipfs-cmdkit")
  45. (commit commit)))
  46. (file-name (git-file-name name version))
  47. (sha256
  48. (base32
  49. "0qk6fshgdmhp8dip2ksm13j6nywi41m9mn0czkvmw6b697z85l2r"))))
  50. (build-system go-build-system)
  51. (arguments
  52. `(#:go ,go-1.16
  53. #:unpack-path "github.com/ipfs/go-ipfs-cmdkit"
  54. #:import-path "github.com/ipfs/go-ipfs-cmdkit/files"))
  55. (home-page "https://github.com/ipfs/go-ipfs-cmdkit")
  56. (synopsis "Shared types, functions and values for go-ipfs")
  57. (description "@command{cmdkit} offers some types, functions and values
  58. that are shared between @command{go-ipfs/commands} and its rewrite
  59. @command{go-ipfs-cmds}.")
  60. (license license:expat))))
  61. (define-public go-github-com-ipfs-go-ipfs-api
  62. (let ((commit
  63. "dafc2a13a4389ac1a6c2786e34ab70a4f26d3a3f")
  64. (revision "0"))
  65. (package
  66. (name "go-github-com-ipfs-go-ipfs-api")
  67. (version (git-version "1.3.1" revision commit))
  68. (source
  69. (origin
  70. (method git-fetch)
  71. (uri (git-reference
  72. (url "https://github.com/ipfs/go-ipfs-api")
  73. (commit commit)))
  74. (file-name (git-file-name name version))
  75. (sha256
  76. (base32
  77. "06kibnwb037sqynk99j07wm8alvxwx3bari9gdax4jv93396kycj"))))
  78. (build-system go-build-system)
  79. (arguments
  80. '(#:import-path "github.com/ipfs/go-ipfs-api"
  81. ;; TODO: Tests fail, might need network access.
  82. #:tests? #f))
  83. (native-inputs
  84. (list go-github-com-ipfs-go-ipfs-cmdkit-files
  85. go-github-com-libp2p-go-libp2p-metrics
  86. go-github-com-libp2p-go-flow-metrics
  87. go-github-com-libp2p-go-libp2p-peer
  88. go-github-com-libp2p-go-libp2p-protocol
  89. go-github-com-libp2p-go-libp2p-crypto
  90. go-github-com-mitchellh-go-homedir
  91. go-github-com-multiformats-go-multiaddr
  92. go-github-com-multiformats-go-multiaddr-net
  93. go-github-com-btcsuite-btcd-btcec
  94. go-github-com-gogo-protobuf
  95. go-github-com-minio-blake2b-simd
  96. go-github-com-minio-sha256-simd
  97. go-github-com-mr-tron-base58
  98. go-github-com-multiformats-go-multihash
  99. go-golang-org-x-crypto
  100. go-github-com-spaolacci-murmur3
  101. go-github-com-gxed-hashland-keccakpg
  102. go-github-com-whyrusleeping-tar-utils
  103. go-github-com-cheekybits-is))
  104. (home-page "https://github.com/ipfs/go-ipfs-api")
  105. (synopsis "Unofficial Go interface to IPFS's HTTP API")
  106. (description "An unofficial Go interface to IPFS's HTTP API")
  107. (license license:expat))))
  108. (define-public gx
  109. (package
  110. (name "gx")
  111. (version "0.14.3")
  112. (source
  113. (origin
  114. (method git-fetch)
  115. (uri (git-reference
  116. (url "https://github.com/whyrusleeping/gx")
  117. (commit (string-append "v" version))))
  118. (file-name (git-file-name name version))
  119. (sha256
  120. (base32 "1sk20kv3rfsnizgwmcmmr69jb1b2iwzqh9wwwd6wg6x0pnqm8swc"))))
  121. (build-system go-build-system)
  122. (arguments
  123. '(#:import-path "github.com/whyrusleeping/gx"))
  124. (native-inputs
  125. (list go-github-com-blang-semver
  126. go-github-com-gxed-hashland-keccakpg
  127. go-github-com-ipfs-go-ipfs-api
  128. go-github-com-ipfs-go-ipfs-cmdkit-files
  129. go-github-com-libp2p-go-flow-metrics
  130. go-github-com-libp2p-go-libp2p-crypto
  131. go-github-com-libp2p-go-libp2p-metrics
  132. go-github-com-libp2p-go-libp2p-peer
  133. go-github-com-libp2p-go-libp2p-protocol
  134. go-github-com-minio-blake2b-simd
  135. go-github-com-minio-sha256-simd
  136. go-github-com-mitchellh-go-homedir
  137. go-github-com-mr-tron-base58
  138. go-github-com-multiformats-go-multiaddr
  139. go-github-com-multiformats-go-multiaddr-net
  140. go-github-com-multiformats-go-multihash
  141. go-github-com-spaolacci-murmur3
  142. go-github-com-whyrusleeping-tar-utils
  143. go-github-com-btcsuite-btcd-btcec
  144. go-github-com-gogo-protobuf
  145. go-github-com-sabhiram-go-gitignore
  146. go-github-com-urfave-cli
  147. go-github-com-whyrusleeping-json-filter
  148. go-github-com-whyrusleeping-progmeter
  149. go-github-com-whyrusleeping-stump
  150. go-golang-org-x-crypto))
  151. (home-page "https://github.com/whyrusleeping/gx")
  152. (synopsis "Package management tool using IPFS")
  153. (description "@command{gx} is a packaging tool built around the
  154. distributed, content addressed file system IPFS. It aims to be flexible,
  155. powerful and simple.")
  156. (license license:expat)))
  157. (define-public go-github-com-whyrusleeping-gx-util
  158. (package
  159. (inherit gx)
  160. (name "go-github-com-whyrusleeping-gx-util")
  161. (arguments
  162. '(#:unpack-path "github.com/whyrusleeping/gx"
  163. #:import-path "github.com/whyrusleeping/gx/gxutil"))))
  164. (define-public gx-go
  165. (package
  166. (name "gx-go")
  167. (version "1.9.0")
  168. (source
  169. (origin
  170. (method git-fetch)
  171. (uri (git-reference
  172. (url "https://github.com/whyrusleeping/gx-go")
  173. (commit (string-append "v" version))))
  174. (file-name (git-file-name name version))
  175. (sha256
  176. (base32
  177. "0fdy4b3ymqw6hzvvjwq37mfrdmizc8lxm53axw93n3x6118na9jc"))))
  178. (build-system go-build-system)
  179. (arguments
  180. '(#:import-path "github.com/whyrusleeping/gx-go"))
  181. (native-inputs
  182. (list go-github-com-whyrusleeping-gx-util
  183. go-github-com-kr-fs
  184. go-github-com-gxed-hashland-keccakpg
  185. go-github-com-ipfs-go-ipfs-api
  186. go-github-com-ipfs-go-ipfs-cmdkit-files
  187. go-github-com-libp2p-go-flow-metrics
  188. go-github-com-libp2p-go-libp2p-crypto
  189. go-github-com-libp2p-go-libp2p-metrics
  190. go-github-com-libp2p-go-libp2p-peer
  191. go-github-com-libp2p-go-libp2p-protocol
  192. go-github-com-minio-blake2b-simd
  193. go-github-com-minio-sha256-simd
  194. go-github-com-mitchellh-go-homedir
  195. go-github-com-mr-tron-base58
  196. go-github-com-multiformats-go-multiaddr
  197. go-github-com-multiformats-go-multiaddr-net
  198. go-github-com-multiformats-go-multihash
  199. go-github-com-spaolacci-murmur3
  200. go-github-com-whyrusleeping-tar-utils
  201. go-github-com-btcsuite-btcd-btcec
  202. go-github-com-gogo-protobuf
  203. go-github-com-sabhiram-go-gitignore
  204. go-github-com-urfave-cli
  205. go-github-com-whyrusleeping-progmeter
  206. go-github-com-whyrusleeping-stump
  207. go-golang-org-x-crypto))
  208. (home-page "https://github.com/whyrusleeping/gx-go")
  209. (synopsis "Golang subtool for the @command{gx} package manager")
  210. (description "A subtool for the @command{gx} package manager for packages
  211. written in Go.")
  212. (license license:expat)))
  213. (define-public go-ipfs
  214. (package
  215. (name "go-ipfs")
  216. (version "0.11.0")
  217. (source
  218. (origin
  219. (method url-fetch/tarbomb)
  220. (uri (string-append
  221. "https://dist.ipfs.io/go-ipfs/v" version
  222. "/go-ipfs-source.tar.gz"))
  223. (sha256
  224. (base32 "13pmj83hwpz6mk7x52qn0cjnfqxqw2qri3r0k4b270w3bafcccwm"))
  225. (file-name (string-append name "-" version "-source"))
  226. (modules '((guix build utils)))
  227. (snippet '(for-each delete-file-recursively
  228. ;; TODO: unbundle the rest as well
  229. '("vendor/github.com/alecthomas"
  230. ;; "vendor/github.com/blang"
  231. "vendor/github.com/cespare"
  232. ;; TODO: Go files not found
  233. ;; "vendor/github.com/cheggaaa"
  234. "vendor/github.com/davecgh"
  235. "vendor/github.com/dustin"
  236. "vendor/github.com/flynn"
  237. "vendor/github.com/francoispqt"
  238. "vendor/github.com/fsnotify"
  239. "vendor/github.com/gogo"
  240. "vendor/github.com/golang/groupcache"
  241. "vendor/github.com/golang/snappy"
  242. "vendor/github.com/google/uuid"
  243. "vendor/github.com/gorilla"
  244. ;; These should be fine, they are part of
  245. ;; the IPFS project
  246. ;; "vendor/github.com/ipfs"
  247. ;; "vendor/github.com/ipld"
  248. "vendor/github.com/jackpal"
  249. "vendor/github.com/klauspost"
  250. ;; TODO: Go files not found
  251. ;; "vendor/github.com/lucas-clemente"
  252. "vendor/github.com/mattn"
  253. "vendor/github.com/mgutz"
  254. "vendor/github.com/minio"
  255. "vendor/github.com/mitchellh"
  256. "vendor/github.com/mr-tron"
  257. "vendor/github.com/opentracing"
  258. "vendor/github.com/pkg"
  259. "vendor/github.com/pmezard"
  260. "vendor/github.com/prometheus/client_golang"
  261. "vendor/github.com/prometheus/client_model"
  262. "vendor/github.com/prometheus/common"
  263. "vendor/github.com/prometheus/procfs"
  264. "vendor/github.com/spaolacci"
  265. "vendor/github.com/stretchr"
  266. "vendor/github.com/syndtr"
  267. "vendor/golang.org/x"
  268. "vendor/gopkg.in/yaml.v2"
  269. "vendor/gopkg.in/yaml.v3"
  270. "vendor/go.uber.org/atomic"
  271. "vendor/go.uber.org/multierr"
  272. "vendor/go.uber.org/zap"
  273. "vendor/lukechampine.com")))))
  274. (build-system go-build-system)
  275. (arguments
  276. (list
  277. #:unpack-path "github.com/ipfs/go-ipfs"
  278. #:import-path "github.com/ipfs/go-ipfs/cmd/ipfs"
  279. #:phases
  280. #~(modify-phases %standard-phases
  281. ;; https://github.com/ipfs/kubo/blob/master/docs/command-completion.md
  282. (add-after 'install 'install-bashcompletion
  283. (lambda _
  284. (let ((completiondir (string-append #$output
  285. "/etc/bash_completion.d")))
  286. (mkdir-p completiondir)
  287. (with-output-to-file (string-append completiondir "/ipfs")
  288. (lambda _
  289. (invoke #$(if (%current-target-system)
  290. "ipfs"
  291. #~(string-append #$output "/bin/ipfs"))
  292. "commands" "completion" "bash")))))))))
  293. (inputs (list go-github-com-alecthomas-units
  294. ;; TODO: needs to be updated first
  295. ;; go-github-com-blang-semver
  296. go-github-com-cespare-xxhash
  297. go-github-com-cheekybits-genny
  298. go-github-com-cheggaaa-pb-v3
  299. go-github-com-davecgh-go-spew
  300. go-github-com-dustin-go-humanize
  301. go-github-com-flynn-noise
  302. go-github-com-francoispqt-gojay
  303. go-github-com-fsnotify-fsnotify
  304. go-github-com-gogo-protobuf
  305. go-github-com-google-uuid
  306. go-github-com-golang-groupcache-lru
  307. go-github-com-golang-snappy
  308. go-github-com-gorilla-websocket
  309. go-github-com-jackpal-go-nat-pmp
  310. go-github-com-klauspost-compress
  311. go-github-com-klauspost-cpuid
  312. go-github-com-lucas-clemente-quic-go
  313. go-github-com-mattn-go-colorable
  314. go-github-com-mattn-go-isatty
  315. go-github-com-mattn-go-runewidth
  316. go-github-com-mgutz-ansi
  317. go-github-com-minio-blake2b-simd
  318. go-github-com-minio-sha256-simd
  319. go-github-com-mitchellh-go-homedir
  320. go-github-com-mr-tron-base58
  321. go-github-com-opentracing-opentracing-go
  322. go-github-com-pkg-errors
  323. go-github-com-pmezard-go-difflib
  324. go-github-com-prometheus-client-golang
  325. go-github-com-prometheus-client-model
  326. go-github-com-prometheus-common
  327. go-github-com-prometheus-procfs
  328. go-github-com-spaolacci-murmur3
  329. go-github-com-stretchr-testify
  330. go-github-com-syndtr-goleveldb
  331. go-gopkg-in-yaml-v2
  332. go-gopkg-in-yaml-v3
  333. go-go-uber-org-atomic
  334. go-go-uber-org-multierr
  335. go-go-uber-org-zap
  336. go-golang-org-x-crypto
  337. go-golang-org-x-lint
  338. go-golang-org-x-mod
  339. go-golang-org-x-net
  340. go-golang-org-x-oauth2
  341. go-golang-org-x-sync
  342. go-golang-org-x-sys
  343. go-golang-org-x-term
  344. go-golang-org-x-tools
  345. go-golang-org-x-xerrors
  346. go-lukechampine-com-blake3))
  347. (native-inputs
  348. (append (if (%current-target-system)
  349. (list this-package)
  350. '())
  351. (list python-minimal-wrapper zsh)))
  352. (home-page "https://ipfs.io")
  353. (synopsis "Go implementation of IPFS, a peer-to-peer hypermedia protocol")
  354. (description "IPFS is a global, versioned, peer-to-peer file system. It
  355. combines good ideas from Git, BitTorrent, Kademlia, SFS, and the Web. It is
  356. like a single bittorrent swarm, exchanging git objects. IPFS provides an
  357. interface as simple as the HTTP web, but with permanence built in. You can
  358. also mount the world at @code{/ipfs}.")
  359. (license license:expat)))