@@ 905,3 905,188 @@ that can be filtered by folders.")
license:agpl3+
;; fuse-sys crate (not vendored, shared repo)
license:gpl3+))))
+
+(define-public rust-parinfer
+ ;; 0.4.3 depends on an older emacs crate with way more transitive dependencies
+ ;; so i'm using current dev version
+ (let ((commit "e1eb440366211d1925bcd59561d8a1c2a75ae362")
+ (revision "0"))
+ (package
+ (name "rust-parinfer")
+ (version (git-version "0.4.3" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/eraserhd/parinfer-rust")
+ (commit commit)))
+ (sha256
+ (base32
+ "01gyanwwjqq4pmw3i1rl7lncrdfd5xlgl59z2ncqwhpvq6b7dp22"))))
+ (build-system cargo-build-system)
+ ;; this should go in bindgen, but of course due to the way
+ ;; cargo-build-system works, bindgen is actually built here
+ ;; so the libclang-path workaround needs to happen here as well.
+ (inputs
+ `(("clang" ,clang)))
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-before 'build 'libclang-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((libclang-path
+ (string-append
+ (assoc-ref inputs "clang")
+ "/lib/")))
+ (setenv "LIBCLANG_PATH" libclang-path)))))
+ #:cargo-inputs
+ (("rust-getopts" ,rust-getopts-0.2)
+ ("rust-libc" ,rust-libc-0.2)
+ ("rust-emacs" ,rust-emacs-0.16)
+ ("rust-serde" ,rust-serde-1)
+ ("rust-serde-json" ,rust-serde-json-1)
+ ("rust-serde-derive" ,rust-serde-derive-1)
+ ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)
+ ("rust-unicode-width" ,rust-unicode-width-0.1))))
+ (home-page
+ "https://github.com/eraserhd/parinfer-rust/")
+ (synopsis
+ "Parinfer implementation for Emacs, Kakoune, Vim, and Neovim")
+ (description
+ "Full-featured, super fast implementation of Shaun Lebron’s parinfer.
+This repo has Vim, Neovim, and Kakoune plugins, and an Emacs plugin is
+available. The Rust library can be called from other editors that can load
+dynamic libraries. This plugin, unlike others available for Vim, implements
+\"smart\" mode. Rather than switching between \"paren\" mode and \"indent\"
+mode, parinfer uses information about how the user is changing the file to
+decide what to do.")
+ (license license:bsd-3))))
+
+(define-public rust-bindgen-0.56
+ (package
+ (name "rust-bindgen")
+ (version "0.56.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "bindgen" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0fajmgk2064ca1z9iq1jjkji63qwwz38z3d67kv6xdy0xgdpk8rd"))))
+ (build-system cargo-build-system)
+ (inputs
+ `(("clang" ,clang)))
+ (arguments
+ ;; no idea why this is needed. no, pkg-config does not work.
+ `(#:skip-build?
+ #t
+ #:cargo-inputs
+ (("rust-bitflags" ,rust-bitflags-1)
+ ("rust-cexpr" ,rust-cexpr-0.4)
+ ("rust-clang-sys" ,rust-clang-sys-1)
+ ("rust-clap" ,rust-clap-2)
+ ("rust-env-logger" ,rust-env-logger-0.8)
+ ("rust-lazy-static" ,rust-lazy-static-1)
+ ("rust-lazycell" ,rust-lazycell-1)
+ ("rust-log" ,rust-log-0.4)
+ ("rust-peeking-take-while"
+ ,rust-peeking-take-while-0.1)
+ ("rust-proc-macro2" ,rust-proc-macro2-1)
+ ("rust-quote" ,rust-quote-1)
+ ("rust-regex" ,rust-regex-1)
+ ("rust-rustc-hash" ,rust-rustc-hash-1)
+ ("rust-shlex" ,rust-shlex-0.1)
+ ("rust-which" ,rust-which-3))))
+ (home-page
+ "https://rust-lang.github.io/rust-bindgen/")
+ (synopsis
+ "Automatically generates Rust FFI bindings to C and C++ libraries.")
+ (description
+ "Automatically generates Rust FFI bindings to C and C++ libraries.")
+ (license license:bsd-3)))
+
+(define-public rust-emacs-module-0.16
+ (package
+ (name "rust-emacs-module")
+ (version "0.16.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "emacs_module" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0s8qrh0ggjmqr04zkcf7s4ijmpd44rjcag78npnq64jv10lxvsry"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:skip-build?
+ #t
+ #:cargo-inputs
+ (("rust-bindgen" ,rust-bindgen-0.56))))
+ (home-page
+ "https://github.com/ubolonton/emacs-module-rs")
+ (synopsis "Raw FFI for emacs-module")
+ (description "Raw FFI for emacs-module")
+ (license license:bsd-3)))
+
+(define-public rust-emacs-macros-0.15
+ (package
+ (name "rust-emacs-macros")
+ (version "0.15.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "emacs-macros" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0xz4scnxrvssa5cb4avw0xyiphzl1ms03zjpxvyc1v0iy471cc8b"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:skip-build?
+ #t
+ #:cargo-inputs
+ (("rust-darling" ,rust-darling-0.10)
+ ("rust-proc-macro2" ,rust-proc-macro2-1)
+ ("rust-quote" ,rust-quote-1)
+ ("rust-syn" ,rust-syn-1))))
+ (home-page
+ "https://github.com/ubolonton/emacs-module-rs")
+ (synopsis "Proc macros for emacs modules")
+ (description "Proc macros for emacs modules")
+ (license license:bsd-3)))
+
+(define-public rust-emacs-0.16
+ (package
+ (name "rust-emacs")
+ (version "0.16.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "emacs" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0qy8iybajqnmbb9i15w5hyps97xz8v8v6crwxqwhk7cd6kin0nss"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:cargo-inputs
+ (("rust-anyhow" ,rust-anyhow-1)
+ ("rust-ctor" ,rust-ctor-0.1)
+ ("rust-emacs-macros" ,rust-emacs-macros-0.15)
+ ("rust-emacs-module" ,rust-emacs-module-0.16)
+ ("rust-once-cell" ,rust-once-cell-1)
+ ("rust-rustc-version" ,rust-rustc-version-0.2)
+ ("rust-thiserror" ,rust-thiserror-1))))
+ (home-page
+ "https://github.com/ubolonton/emacs-module-rs")
+ (synopsis
+ "Rust library for creating Emacs's dynamic modules")
+ (description
+ "Rust library for creating Emacs's dynamic modules")
+ (license license:bsd-3)))
+