diff mbox series

[bug#45130] gnu: Add mtm.

Message ID GwMTp8ygmCCiAMrjCdoEcc6U0YgCYQW94qR3-HtJyctzllh5ZQpoL3wrKruabh-ug8O7uP7SnY4-Pcu0BnqHQk2r1Z9qjWD25Y4H8axy0EQ=@protonmail.com
State Accepted
Headers show
Series [bug#45130] gnu: Add mtm. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

phodina Nov. 3, 2021, 2:53 p.m. UTC
Hi,

here's updated version of the patch where the version uses newest tag instead of commit. Otherwise LGTM.

--8<---------------cut here---------------start------------->8---

Subject: [PATCH v2] gnu: Add mtm.

* gnu/packages/suckless.scm (mtm): New variable.

--
2.33.1

Comments

Nicolas Goaziou Nov. 6, 2021, 9:33 a.m. UTC | #1
Hello,

phodina via Guix-patches via <guix-patches@gnu.org> writes:

> here's updated version of the patch where the version uses newest tag
> instead of commit. Otherwise LGTM.

Is there any reason to put the variable in suckless.scm?

> +         (replace 'install
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out")))
> +               ;; install binary
> +               (mkdir-p (string-append out "bin/"))
> +               (install-file "mtm" (string-append out "/bin"))
> +               ;; install manpage
> +               (mkdir-p (string-append out "share/man/man1"))
> +               (install-file "mtm.1" (string-append out "/share/man/man1"))
> +               ;; install terminfo
> +               (mkdir-p (string-append out "share/terminfo"))
> +               (invoke (string-append (assoc-ref inputs "ncurses") "/bin/tic")
> +                       "-x" "-s" "-o"
> +                       (string-append
> +                        out "/share/terminfo")
> +                       "mtm.ti"))
> +             #t))

We can remove the trailing #t.

> +         (delete 'configure))))

There's probably a missing comment "no configure script"

> +    ;; FIXME: This should only be located in 'ncurses'.  Nonetheless it is
> +    ;; provided for usability reasons.  See <https://bugs.gnu.org/22138>.
> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "TERMINFO_DIRS")
> +            (files '("share/terminfo")))))
> +    (synopsis "Micro Terminal Multiplexer")
> +    (description
> +     "This package provides multiplexer for the terminal focused on simplicity,
> +compatibility, size and stability.")
> +    (license license:gpl3+)
> +    (home-page "https://github.com/deadpixi/mtm")))

Nitpick: the home-page field is usually above the synopsis.

Regards,
diff mbox series

Patch

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index b4855ec0a2..0e21af24e5 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -8,6 +8,7 @@ 
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright @ 2020 luhux <luhux@outlook.com>
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
 ;;;
@@ -700,6 +701,65 @@  (define-public noice
      "Noice is a small curses-based file browser.")
     (license license:bsd-2)))

+(define-public mtm
+  (package
+    (name "mtm")
+    (version "1.2.1")
+    (source
+     (origin
+       (uri (git-reference
+             (url "https://github.com/deadpixi/mtm")
+             (commit version)))
+       (method git-fetch)
+       (sha256
+        (base32 "0gibrvah059z37jvn1qs4b6kvd4ivk2mfihmcpgx1vz6yg70zghv"))
+       (file-name (git-file-name name version))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("ncurses" ,ncurses)))
+    (arguments
+     `(#:tests? #f                      ; no tests
+       #:make-flags
+       (list (string-append "CC=" ,(cc-for-target))
+             (string-append "DESTDIR=" (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-headers
+           (lambda _
+             (substitute* "config.def.h"
+               (("ncursesw/curses.h")
+                "curses.h"))))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               ;; install binary
+               (mkdir-p (string-append out "bin/"))
+               (install-file "mtm" (string-append out "/bin"))
+               ;; install manpage
+               (mkdir-p (string-append out "share/man/man1"))
+               (install-file "mtm.1" (string-append out "/share/man/man1"))
+               ;; install terminfo
+               (mkdir-p (string-append out "share/terminfo"))
+               (invoke (string-append (assoc-ref inputs "ncurses") "/bin/tic")
+                       "-x" "-s" "-o"
+                       (string-append
+                        out "/share/terminfo")
+                       "mtm.ti"))
+             #t))
+         (delete 'configure))))
+    ;; FIXME: This should only be located in 'ncurses'.  Nonetheless it is
+    ;; provided for usability reasons.  See <https://bugs.gnu.org/22138>.
+    (native-search-paths
+     (list (search-path-specification
+            (variable "TERMINFO_DIRS")
+            (files '("share/terminfo")))))
+    (synopsis "Micro Terminal Multiplexer")
+    (description
+     "This package provides multiplexer for the terminal focused on simplicity,
+compatibility, size and stability.")
+    (license license:gpl3+)
+    (home-page "https://github.com/deadpixi/mtm")))
+
 (define-public human
   (package
     (name "human")