Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial IPFS support. #2589

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e1cbf81
gitmodules: Add cl-ipfs-api2.
Ambrevar Sep 23, 2022
ef8ff03
mode/ipfs: Initialize.
Ambrevar Sep 21, 2022
5375227
mode/ipfs: Support redirect to public gateways.
Ambrevar Sep 23, 2022
6f1487a
build-scripts/nyxt: Add cl-ipfs-api2 input.
Ambrevar Sep 23, 2022
d0f5862
mode/ipfs: Add support for adding files.
Ambrevar Sep 24, 2022
f83a38e
gitmodule: Add symbol-munger (for cl-ipfs-api2).
Ambrevar Sep 27, 2022
c0fc3cb
gitmodule: Add collectors (for cl-ipfs-api2).
Ambrevar Sep 27, 2022
be7454f
gitmodule: Add arnesi (for cl-ipfs-api2).
Ambrevar Sep 27, 2022
8515563
gitmodule: Add yason (for cl-ipfs-api2).
Ambrevar Sep 27, 2022
7321bd0
gitmodule: Update cl-ipfs-api2 fork to 20220924.
Ambrevar Sep 27, 2022
d1b875e
mode/ipfs: Fix daemon-running-p.
Ambrevar Sep 27, 2022
89884e1
mode/ipfs: Fix all-uploads.
Ambrevar Sep 27, 2022
42cbb42
mode/ipfs: Fix add.
Ambrevar Sep 27, 2022
667ed72
mode/ipfs: Report when daemon failed to start in upload.
Ambrevar Sep 27, 2022
0581db0
mode/ipfs: Fix list-uploads.
Ambrevar Sep 27, 2022
b273c14
mode/ipfs: Use ipfs-getf.
Ambrevar Sep 27, 2022
87d7a38
mode/ipfs: Add delete-ipfs-file.
Ambrevar Sep 27, 2022
9e12c5e
build-scripts/nyxt: Use Drakma and cl-ipfs-api2 forks.
Ambrevar Oct 26, 2022
cc91e7b
mode/ipfs: Return non-nil if daemon is started externally.
Ambrevar Oct 26, 2022
5433990
mode/ipfs: Refactor start-daemon / daemon-running-p calls.
Ambrevar Oct 26, 2022
80a29a7
mode/ipfs: Add and call ipfs-init.
Ambrevar Oct 26, 2022
4bb6578
mode/ipfs: Kill IPFS on exit.
Ambrevar Oct 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,23 @@
path = _build/ospm
url = https://github.com/atlas-engineer/ospm
shallow = true
[submodule "_build/cl-ipfs-api2"]
path = _build/cl-ipfs-api2
url = https://github.com/ambrevar/cl-ipfs-api2
shallow = true
[submodule "_build/symbol-munger"]
path = _build/symbol-munger
url = https://github.com/AccelerationNet/symbol-munger
shallow = true
[submodule "_build/collectors"]
path = _build/collectors
url = https://github.com/AccelerationNet/collectors
shallow = true
[submodule "_build/arnesi"]
path = _build/arnesi
url = https://github.com/AccelerationNet/arnesi
shallow = true
[submodule "_build/yason"]
path = _build/yason
url = https://github.com/phmarek/yason
shallow = true
1 change: 1 addition & 0 deletions _build/arnesi
Submodule arnesi added at 1e7dc4
1 change: 1 addition & 0 deletions _build/cl-ipfs-api2
Submodule cl-ipfs-api2 added at 63ab33
1 change: 1 addition & 0 deletions _build/collectors
Submodule collectors added at 748f0a
1 change: 1 addition & 0 deletions _build/symbol-munger
Submodule symbol-munger added at e96558
1 change: 1 addition & 0 deletions _build/yason
Submodule yason added at d7bce7
350 changes: 211 additions & 139 deletions build-scripts/nyxt.scm
Original file line number Diff line number Diff line change
Expand Up @@ -72,148 +72,220 @@
(close-pipe pipe)
version))

(define-public sbcl-drakma
(let ((commit "650f48095402cb2e25a069133b158823c920e4e7"))
(package
(name "sbcl-drakma")
(version (git-version "2.0.9" "1" commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Ambrevar/drakma")
(commit commit)))
(file-name (git-file-name "cl-drakma" version))
(sha256
(base32
"001w7nsmz0xqdg700gv38v630dv7h2ggqlm87gfrxmsqwpnswgyi"))))
(build-system asdf-build-system/sbcl)
(inputs
(list sbcl-puri
sbcl-cl-base64
sbcl-chunga
sbcl-flexi-streams
sbcl-cl-ppcre
sbcl-chipz
sbcl-usocket
sbcl-cl+ssl))
(native-inputs
(list sbcl-fiveam))
(home-page "https://edicl.github.io/drakma/")
(synopsis "HTTP client written in Common Lisp")
(description
"Drakma is a full-featured HTTP client implemented in Common Lisp. It
knows how to handle HTTP/1.1 chunking, persistent connections, re-usable
sockets, SSL, continuable uploads, file uploads, cookies, and more.")
(license license:bsd-2))))

(define-public cl-drakma
(sbcl-package->cl-source-package sbcl-drakma))

(define-public sbcl-cl-ipfs-api2
(let ((commit "63ab3308687649b0fb7c0882872d9167a9142266")
(revision "1"))
(package
(name "sbcl-cl-ipfs-api2")
(version (git-version "0.51" revision commit))
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/Ambrevar/cl-ipfs-api2/")
(commit commit)))
(file-name (git-file-name "cl-ipfs-api2" version))
(sha256
(base32 "1b5ms1vx9x646c16hqwq0vqb49caj1n26vr0v25yf1y6gjjg0sla"))))
(build-system asdf-build-system/sbcl)
(arguments
'(#:tests? #f)) ; There are no tests.
(inputs
(list sbcl-arnesi
sbcl-drakma
sbcl-yason))
(home-page "https://github.com/JadedCtrl/cl-ipfs-api2/")
(synopsis "Bindings for the IPFS HTTP API")
(description
"@code{cl-sbcl-cl-ipfs-api2} is a pretty simple set of IPFS bindings
for Common Lisp, using the HTTP API for (almost) everything, except for pubsub
(which uses the locally installed go-ipfs program).")
(license license:lgpl3))))

(define-public cl-ipfs-api2
(sbcl-package->cl-source-package sbcl-cl-ipfs-api2))

(define-public nyxt
(package
(name "nyxt")
(version (nyxt-git-version))
(source (local-file %source-dir #:recursive? #t #:select? (git-predicate %source-dir)))
(build-system gnu-build-system) ; TODO: Use glib-or-gtk-build-system instead?
(arguments
(list
#:make-flags #~(list "nyxt" "NYXT_SUBMODULES=false"
(string-append "DESTDIR=" #$output)
"PREFIX=")
#:strip-binaries? #f ; Stripping breaks SBCL binaries.
#:phases
#~(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'fix-common-lisp-cache-folder
(lambda _
(setenv "HOME" "/tmp")
#t))
(add-before 'check 'configure-tests
(lambda _
(setenv "NYXT_TESTS_NO_NETWORK" "1")
(setenv "NYXT_TESTS_ERROR_ON_FAIL" "1")
#t))
(add-after 'install 'wrap-program
(lambda _
(let* ((bin (string-append #$output "/bin/nyxt"))
(libs (list #$(this-package-input "gsettings-desktop-schemas")))
(path (string-join
(map (lambda (lib)
(string-append lib "/lib"))
libs)
":"))
(gi-path (getenv "GI_TYPELIB_PATH"))
(xdg-path (string-join
(map (lambda (lib)
(string-append lib "/share"))
libs)
":")))
(wrap-program bin
`("GIO_EXTRA_MODULES" prefix
(,(string-append #$(this-package-input "glib-networking") "/lib/gio/modules")))
`("GI_TYPELIB_PATH" prefix (,gi-path))
`("LD_LIBRARY_PATH" ":" prefix (,path))
`("XDG_DATA_DIRS" ":" prefix (,xdg-path)))
#t))))))
;; We use `cl-*' inputs and not `sbcl-*' ones so that CCL users can also use
;; this Guix manifests.
;;
;; Another reason is to not fail when an input dependency is found in
;; ~/common-lisp, which would trigger a rebuild of the SBCL input in the
;; store, which is read-only and would thus fail.
;;
;; The official Guix package should use `sbcl-*' inputs though.
(native-inputs
(list cl-lisp-unit2
sbcl
;; Only for development, unneeded for the upstream Guix package:
cl-trivial-benchmark))
(inputs
(list cl-alexandria
cl-bordeaux-threads
cl-base64
cl-calispel
cl-containers
cl-css
cl-closer-mop
cl-clss
cl-cluffer
cl-custom-hash-table
cl-dexador
cl-dissect
cl-trivial-custom-debugger
cl-enchant
cl-flexi-streams
cl-fset
cl-gopher
cl-html-diff
cl-hu.dwim.defclass-star
cl-iolib
cl-json
cl-local-time
cl-lparallel
cl-log4cl
cl-mk-string-metrics
cl-moptilities
cl-named-readtables
cl-ndebug
cl-nfiles
cl-nhooks
cl-nkeymaps
cl-osicat ; Not needed for SBCL, remove it in Guix upstream package.
cl-ospm
cl-parenscript
cl-phos
cl-plump
cl-ppcre
cl-prevalence
cl-py-configparser
cl-qrencode
cl-quri
cl-serapeum
cl-spinneret
cl-str
cl-slime-swank
cl-slynk
cl-tld
cl-trivia
cl-trivial-clipboard
cl-trivial-features
cl-trivial-garbage
cl-trivial-package-local-nicknames
cl-trivial-types
cl-unix-opts
;; System deps
gcc-toolchain ; Needed for cl-iolib
cl-cffi-gtk
cl-webkit
glib-networking
gsettings-desktop-schemas
cl-gobject-introspection
gtk+ ; For the main loop
webkitgtk ; Required when we use its typelib
gobject-introspection
pkg-config))
(propagated-inputs
(list
;; Useful for video playback in all-inclusive Guix profiles.
;; For now upstream Guix does not include the GST plugins.
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
;; For spell-checking. Same, upstream Guix does not include it in the package.
aspell
aspell-dict-en))
(synopsis "Extensible web browser in Common Lisp")
(home-page "https://nyxt.atlas.engineer")
(description "Nyxt is a keyboard-oriented, extensible web browser
(name "nyxt")
(version (nyxt-git-version))
(source (local-file %source-dir #:recursive? #t #:select? (git-predicate %source-dir)))
(build-system gnu-build-system) ; TODO: Use glib-or-gtk-build-system instead?
(arguments
(list
#:make-flags #~(list "nyxt" "NYXT_SUBMODULES=false"
(string-append "DESTDIR=" #$output)
"PREFIX=")
#:strip-binaries? #f ; Stripping breaks SBCL binaries.
#:phases
#~(modify-phases %standard-phases
(delete 'configure)
(add-before 'build 'fix-common-lisp-cache-folder
(lambda _
(setenv "HOME" "/tmp")
#t))
(add-before 'check 'configure-tests
(lambda _
(setenv "NYXT_TESTS_NO_NETWORK" "1")
(setenv "NYXT_TESTS_ERROR_ON_FAIL" "1")
#t))
(add-after 'install 'wrap-program
(lambda _
(let* ((bin (string-append #$output "/bin/nyxt"))
(libs (list #$(this-package-input "gsettings-desktop-schemas")))
(path (string-join
(map (lambda (lib)
(string-append lib "/lib"))
libs)
":"))
(gi-path (getenv "GI_TYPELIB_PATH"))
(xdg-path (string-join
(map (lambda (lib)
(string-append lib "/share"))
libs)
":")))
(wrap-program bin
`("GIO_EXTRA_MODULES" prefix
(,(string-append #$(this-package-input "glib-networking") "/lib/gio/modules")))
`("GI_TYPELIB_PATH" prefix (,gi-path))
`("LD_LIBRARY_PATH" ":" prefix (,path))
`("XDG_DATA_DIRS" ":" prefix (,xdg-path)))
#t))))))
;; We use `cl-*' inputs and not `sbcl-*' ones so that CCL users can also use
;; this Guix manifests.
;;
;; Another reason is to not fail when an input dependency is found in
;; ~/common-lisp, which would trigger a rebuild of the SBCL input in the
;; store, which is read-only and would thus fail.
;;
;; The official Guix package should use `sbcl-*' inputs though.
(native-inputs
(list cl-lisp-unit2
sbcl
;; Only for development, unneeded for the upstream Guix package:
cl-trivial-benchmark))
(inputs
(list cl-alexandria
cl-bordeaux-threads
cl-base64
cl-calispel
cl-containers
cl-css
cl-closer-mop
cl-clss
cl-cluffer
cl-custom-hash-table
cl-dexador
cl-dissect
cl-trivial-custom-debugger
cl-enchant
cl-flexi-streams
cl-fset
cl-gopher
cl-html-diff
cl-hu.dwim.defclass-star
cl-iolib
cl-ipfs-api2
cl-json
cl-local-time
cl-lparallel
cl-log4cl
cl-mk-string-metrics
cl-moptilities
cl-named-readtables
cl-ndebug
cl-nfiles
cl-nhooks
cl-nkeymaps
cl-osicat ; Not needed for SBCL, remove it in Guix upstream package.
cl-ospm
cl-parenscript
cl-phos
cl-plump
cl-ppcre
cl-prevalence
cl-py-configparser
cl-qrencode
cl-quri
cl-serapeum
cl-spinneret
cl-str
cl-slime-swank
cl-slynk
cl-tld
cl-trivia
cl-trivial-clipboard
cl-trivial-features
cl-trivial-garbage
cl-trivial-package-local-nicknames
cl-trivial-types
cl-unix-opts
;; System deps
gcc-toolchain ; Needed for cl-iolib
cl-cffi-gtk
cl-webkit
glib-networking
gsettings-desktop-schemas
cl-gobject-introspection
gtk+ ; For the main loop
webkitgtk ; Required when we use its typelib
gobject-introspection
pkg-config))
(propagated-inputs
(list
;; Useful for video playback in all-inclusive Guix profiles.
;; For now upstream Guix does not include the GST plugins.
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
;; For spell-checking. Same, upstream Guix does not include it in the package.
aspell
aspell-dict-en))
(synopsis "Extensible web browser in Common Lisp")
(home-page "https://nyxt.atlas.engineer")
(description "Nyxt is a keyboard-oriented, extensible web browser
designed for power users. The application has familiar Emacs and VI
keybindings and is fully configurable and extensible in Common Lisp.")
(license license:bsd-3)))
(license license:bsd-3)))

nyxt
Loading