summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2020-07-02 21:46:37 -0500
committerEric Bavier <bavier@member.fsf.org>2020-07-02 21:46:37 -0500
commitce9ea43373d5eb3a9aef8c9b615b98b56b74ba2c (patch)
tree8d072e25fede9dbe53b6224f83ede425e2dce0d9 /gnu
parent5ce123bd9a1597bdbb8c1a83fb73ae82a0b86f60 (diff)
downloadguix-patches-ce9ea43373d5eb3a9aef8c9b615b98b56b74ba2c.tar
guix-patches-ce9ea43373d5eb3a9aef8c9b615b98b56b74ba2c.tar.gz
gnu: Add ufetch.
* gnu/packages/admin.scm (ufetch): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/admin.scm51
1 files changed, 50 insertions, 1 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9b3bca5482..a4a7f40f29 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2014, 2015, 2016, 2018, 2019 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2020 Eric Bavier <bavier@posteo.net>
;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
;;; Copyright © 2015 Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
@@ -3253,6 +3253,55 @@ generate those nifty terminal theme information and ASCII distribution logos in
everyone's screenshots nowadays.")
(license license:gpl3)))
+(define-public ufetch
+ (let ((commit "98b622023e03fe24dbc137e9a68104dfe1fbd04a")
+ (revision "1"))
+ (package
+ (name "ufetch")
+ (version (git-version "0.2" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/jschx/ufetch.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "09c4zmikza16xpydinnqbi3hmcibfrrn10wij7j0j1wv1pj2sl2l"))))
+ (build-system trivial-build-system)
+ (inputs
+ `(("bash" ,bash)
+ ("tput" ,ncurses)))
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((source (assoc-ref %build-inputs "source"))
+ (output (assoc-ref %outputs "out"))
+ (bindir (string-append output "/bin"))
+ (docdir (string-append output "/share/doc/ufetch-" ,version))
+ (tput (string-append (assoc-ref %build-inputs "tput") "/bin/tput")))
+ (install-file (string-append source "/LICENSE") docdir)
+ (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
+ (mkdir-p bindir)
+ (for-each (lambda (src)
+ (let ((dst (string-append bindir "/" (basename src))))
+ (copy-file src dst)
+ (patch-shebang dst)
+ (substitute* dst (("tput") tput))))
+ (find-files source "ufetch-[[:alpha:]]*$"))
+ ;; Note: the `ufetch` we create below will only work if run under
+ ;; the Guix System. I.e. a user trying to run `ufetch` on a
+ ;; foreign distro will not get great results. The `screenfetch`
+ ;; program does actual runtime detection of the operating system,
+ ;; and would be a better choice in such a situation.
+ (symlink "ufetch-guix" (string-append bindir "/ufetch"))))))
+ (home-page "https://gitlab.com/jschx/ufetch")
+ (synopsis "Tiny system info")
+ (description "This package provides a tiny system info utility.")
+ (license license:isc))))
+
(define-public nnn
(package
(name "nnn")