From 2328b47c643bc32bb823045628f4814885d6204d Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Sun, 17 Jan 2016 01:44:15 -0600 Subject: gnu: Add autojump. * gnu/packages/admin.scm (autojump): New variable. --- gnu/packages/admin.scm | 61 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'gnu/packages/admin.scm') diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 6e3024dffd..1f2d0fbf95 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès ;;; Copyright © 2013 Cyril Roelandt ;;; Copyright © 2014, 2015, 2016 Mark H Weaver -;;; Copyright © 2014, 2015 Eric Bavier +;;; Copyright © 2014, 2015, 2016 Eric Bavier ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Alex Sassmannshausen ;;; Copyright © 2015 Eric Dvorsak @@ -1318,3 +1318,62 @@ (define-public cpulimit processes and threads of the specified process may optionally share the same limits.") (license license:gpl2+))) + +(define-public autojump + (package + (name "autojump") + (version "22.2.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/wting/autojump/archive/" + "release-v" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0xglj7nb8xczaqy2dhn78drqdwqj64rqpymxhqmmwwqzfaqassw1")))) + (build-system gnu-build-system) + (native-inputs ;for tests + `(("python-mock" ,python-mock) + ("python-pytest" ,python-pytest))) + (inputs + `(("python" ,python-wrapper))) + (arguments + `(#:phases (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'check + (lambda _ + (zero? + (system* "python" "tests/autojump_utils_test.py")))) + (replace 'install + ;; The install.py script doesn't allow system installation + ;; into an arbitrary prefix, so do our own install. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (share (string-append out "/share/autojump")) + (py (string-append out "/lib/python" + ,(version-major+minor + (package-version python-wrapper)) + "/site-packages")) + (man (string-append out "/share/man/man1"))) + (install-file "bin/autojump" bin) + (for-each (λ (f) (install-file f py)) + (find-files "bin" "\\.py$")) + (for-each (λ (f) (install-file f share)) + (find-files "bin" "autojump\\..*$")) + (substitute* (string-append share "/autojump.sh") + (("/usr/local") out)) + (install-file "docs/autojump.1" man) + (wrap-program (string-append bin "/autojump") + `("PYTHONPATH" ":" prefix (,py))) + #t)))))) + (home-page "https://github.com/wting/autojump") + (synopsis "Shell extension for filesystem navigation") + (description + "Autojump provides a faster way to navigate your filesystem, with a \"cd +command that learns\". It works by maintaining a database of the directories +you use the most from the command line and allows you to \"jump\" to +frequently used directories by typing only a small pattern.") + (license license:gpl3+))) -- cgit v1.2.3