[PATCH] gnu: Add mtm.

  • Done
  • quality assurance status badge
Details
3 participants
  • luhux
  • Nicolas Goaziou
  • phodina
Owner
unassigned
Submitted by
luhux
Severity
normal
L
L
luhux wrote on 9 Dec 2020 02:33
(address . guix-patches@gnu.org)
PSXP216MB0214487C7C5BF4A7E39CEDBEA0CC0@PSXP216MB0214.KORP216.PROD.OUTLOOK.COM
From 6f1a84e8b4feb3cc3c80095fe2aeec30d7862d9d Mon Sep 17 00:00:00 2001
From: luhux <luhux@outlook.com>
Date: Wed, 9 Dec 2020 00:47:03 +0000
Subject: [PATCH] gnu: Add mtm.

* gnu/packages/suckless.scm (mtm): New variable.
---
gnu/packages/suckless.scm | 61 +++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)

Toggle diff (78 lines)
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 7e297eb9ae..00f90a36ff 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, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright � 2020 luhux <luhux@outlook.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -766,3 +767,63 @@ chat output in the background.")
Single daemon and configuration file. Log to stdout or syslog. No mail
support.")
(license license:expat)))
+
+(define-public mtm
+ (let ((commit "cabd8704b9299d8b354ec8b403a6041bbddd2191")
+ (revision "0"))
+ (package
+ (name "mtm")
+ (version (git-version "1.2.0" revision commit))
+ (source
+ (origin
+ (uri (git-reference
+ (url "https://github.com/deadpixi/mtm")
+ (commit commit)))
+ (method git-fetch)
+ (sha256
+ (base32 "08crai3wxa6npd27y6qd290mj55l0bk8ibm4agyb002kbga8vkc7"))
+ (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
+ "Micro Terminal Multiplexer")
+ (license license:gpl3+)
+ (home-page "https://github.com/deadpixi/mtm"))))
--
2.29.2
P
P
phodina wrote on 3 Nov 2021 15:53
(name . 45130@debbugs.gnu.org)(address . 45130@debbugs.gnu.org)
GwMTp8ygmCCiAMrjCdoEcc6U0YgCYQW94qR3-HtJyctzllh5ZQpoL3wrKruabh-ug8O7uP7SnY4-Pcu0BnqHQk2r1Z9qjWD25Y4H8axy0EQ=@protonmail.com
Hi,

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

Toggle snippet (86 lines)
Subject: [PATCH v2] gnu: Add mtm.

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

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")
--
2.33.1
N
N
Nicolas Goaziou wrote on 6 Nov 2021 10:33
Re: [bug#45130] [PATCH] gnu: Add mtm.
(name . phodina via Guix-patches via)(address . guix-patches@gnu.org)
8735o9r5lu.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (3 lines)
> 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?

Toggle quote (18 lines)
> + (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.

Toggle quote (2 lines)
> + (delete 'configure))))

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

Toggle quote (13 lines)
> + ;; 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,
--
Nicolas Goaziou
P
P
phodina wrote on 10 Nov 2021 14:41
[PATCH v2] gnu: Add mtm.
(name . Nicolas Goaziou)(address . mail@nicolasgoaziou.fr)
cE5kHO_xe3OUPT3UOx1_XjlFSTm0DhGHdwTU308ZeRNIVyk1psCdXUT9-_N_d2dMHuFMnCqm60ylAy1PsIaI1Q9EOSJybPTbDYp8SNAiZoo=@protonmail.com
Hi Nicolas,

here's updated patch. The mtm package is placed in terminals.scm with the suggestions you mentioned above.

---
Kind regards
Petr

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

Toggle diff (83 lines)
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 8d751f6cce..b2c214275e 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -23,11 +23,13 @@
;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
+;;; Copyright @ 2020 luhux <luhux@outlook.com>
;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
;;; Copyright © 2021 ikasero <ahmed@ikasero.com>
;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -424,6 +426,64 @@ (define-public mlterm
Vietnamese, and bi-directional scripts like Arabic and Hebrew.")
(license license:bsd-3)))

+(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"))))
+ (delete 'configure)))) ; 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")))))
+ (home-page "https://github.com/deadpixi/mtm")
+ (synopsis "Micro Terminal Multiplexer")
+ (description
+ "This package provides multiplexer for the terminal focused on simplicity,
+compatibility, size and stability.")
+ (license license:gpl3+)))
+
(define-public picocom
(package
(name "picocom")
--
2.33.1
N
N
Nicolas Goaziou wrote on 15 Nov 2021 11:27
(name . phodina via Guix-patches via)(address . guix-patches@gnu.org)
87ilwtiuhd.fsf@nicolasgoaziou.fr
Hello,

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

Toggle quote (3 lines)
> here's updated patch. The mtm package is placed in terminals.scm with
> the suggestions you mentioned above.

Thank you. I applied it with the minor modifications below.
Toggle quote (4 lines)
> + (build-system gnu-build-system)
> + (inputs
> + `(("ncurses" ,ncurses)))

I moved inputs field after arguments.

Toggle quote (2 lines)
> + (license license:gpl3+)))

I added bsd-3 for vtparser.c

Regards,
--
Nicolas Goaziou
Closed
?