diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 2c31632db6..c728e08aa9 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -4263,3 +4263,49 @@ used by other processes.") Porter2 stemmer}. It is written completely using finite state machines to do suffix comparison, rather than the string-based or tree-based approaches.") (license license:asl2.0)))) + +(define-public go-github-com-mattn-go-runewidth + (package + (name "go-runewidth") + (version "0.0.4") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mattn/go-runewidth.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "00b3ssm7wiqln3k54z2wcnxr3k3c7m1ybyhb9h8ixzbzspld0qzs")))) + (build-system go-build-system) + (arguments + '(#:import-path "github.com/mattn/go-runewidth")) + (synopsis "Provides functions to get fixed width of the character or string") + (description + "Provides functions to get fixed width of the character or string.") + (home-page "https://github.com/mattn/go-runewidth") + (license license:expat))) + +(define-public go-github-com-mattn-go-shellwords + (package + (name "go-shellwords") + (version "1.0.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mattn/go-shellwords.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0s6rcswsr6k5dwcng4ck6xhz5xw6j20x1d24ngbbh9qfxxnw0j3j")))) + (build-system go-build-system) + (arguments + '(#:import-path "github.com/mattn/go-shellwords" + #:phases (modify-phases %standard-phases + (delete 'check)))) + (synopsis "Parse line as shell words") + (description + "Go library to parse a line as shell words.") + (home-page "https://github.com/mattn/go-shellwords") + (license license:expat))) diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index b1db32a3dc..68989db4bc 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm @@ -126,6 +126,54 @@ all of the regexes given on the command line in order.") (home-page "https://github.com/rupa/z") (license license:expat))) +(define-public fzf + (package + (name "fzf") + (version "0.18.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/junegunn/fzf.git") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0pwpr4fpw56yzzkcabzzgbgwraaxmp7xzzmap7w1xsrkbj7dl2xl")))) + (build-system go-build-system) + (native-inputs + `(("github.com/mattn/go-isatty" ,go-github-com-mattn-go-isatty) + ("github.com/mattn/go-runewidth" ,go-github-com-mattn-go-runewidth) + ("github.com/mattn/go-shellwords" ,go-github-com-mattn-go-shellwords) + ("golang.org/x/crypto/ssh/terminal" ,go-golang-org-x-crypto-ssh-terminal) + ("golang.org/x/sys/unix" ,go-golang-org-x-sys-unix))) + (propagated-inputs + `(("tmux" ,tmux))) + (arguments + '(#:import-path "github.com/junegunn/fzf" + #:install-source? #f + #:phases + (modify-phases %standard-phases + (replace 'build + (lambda _ + (with-directory-excursion "src/github.com/junegunn/fzf" + (invoke "make")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/share")) + (with-directory-excursion "src/github.com/junegunn/fzf" + (invoke "make" "install") + (copy-recursively "bin" (string-append out "/bin")) + (copy-recursively "man" (string-append out "/share/man")) + (copy-recursively "shell" (string-append out "/share/fzf"))))))))) + (synopsis "Command line fuzzy finder") + (description + "@command{fzf} is a general purpose command line fuzzy finder. It's an +interactive uniz filter for command-line that can be used with any lists; +files, command history, processes, hostnames, bookmarks, git commits, etc..") + (home-page "https://github.com/junegunn/fzf") + (license license:expat))) + (define-public envstore (package (name "envstore")