[PATCH] gnu: st: Compile and install terminfo files.

DoneSubmitted by jgart.
Details
2 participants
  • jgart
  • Raghav Gururajan
Owner
unassigned
Severity
normal
J
J
jgart wrote on 6 Nov 2021 09:53
(address . guix-patches@gnu.org)(name . jgart)(address . jgart@dismail.de)
20211106085334.4778-1-jgart@dismail.de
* gnu/packages/suckless.scm (st): Compile and install terminfo files.
[native-inputs]: ncurses's tic program is required to compile the
terminfo files.
---
gnu/packages/suckless.scm | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index b4855ec0a2..912ff12422 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -378,6 +378,9 @@ (define-public st
      `(#:tests? #f                      ; no tests
        #:make-flags
        (list (string-append "CC=" ,(cc-for-target))
+             (string-append "TERMINFO="
+                            (assoc-ref %outputs "out")
+                            "/share/terminfo")
              (string-append "PREFIX=" %output))
        #:phases
        (modify-phases %standard-phases
@@ -385,15 +388,20 @@ (define-public st
          (add-after 'unpack 'inhibit-terminfo-install
            (lambda _
              (substitute* "Makefile"
-               (("\ttic .*") ""))
-             #t)))))
+               (("\ttic .*") ""))))
+         (add-after 'install 'compile-and-install-terminfo-entry
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out  (assoc-ref outputs "out"))
+                      (terminfo (string-append out "/share/terminfo")))
+                 (invoke "tic" "-sx" "st.info" "-o" terminfo)))))))
     (inputs
      `(("libx11" ,libx11)
        ("libxft" ,libxft)
        ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("ncurses" ,ncurses)
+       ("pkg-config" ,pkg-config)))
     (home-page "https://st.suckless.org/")
     (synopsis "Simple terminal emulator")
     (description
-- 
2.33.1
R
R
Raghav Gururajan wrote on 3 Dec 2021 21:08
(no subject)
(address . 51627@debbugs.gnu.org)(address . jgart@dismail.de)
d77e574f-e7e5-8956-e054-8d1dd81b6ba7@raghavgururajan.name
Hi Jorge!
As discussed over XMPP, could you sent a revised patch?
Regards,
RG.
Attachment: OpenPGP_signature
J
J
jgart wrote on 3 Dec 2021 21:21
[PATCH v2] gnu: st: Install terminfo files.
(address . 51627@debbugs.gnu.org)(name . jgart)(address . jgart@dismail.de)
20211203202133.12732-1-jgart@dismail.de
Here is version two of the patch set that adds ncurses to the native-input.

The Makefile already takes care of compiling the terminfo files as long as the
tic binary is available. The tic binary comes from the ncurse package.

* gnu/packages/suckless.scm (st)[native-inputs]: Add ncurses.
[configure-flags](TERMINFO): New flag.
[phases](inhibit-terminfo-install): Remove phase.
---
gnu/packages/suckless.scm | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index b4855ec0a2..fcebe894a7 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -378,22 +378,15 @@ (define-public st
      `(#:tests? #f                      ; no tests
        #:make-flags
        (list (string-append "CC=" ,(cc-for-target))
-             (string-append "PREFIX=" %output))
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-after 'unpack 'inhibit-terminfo-install
-           (lambda _
-             (substitute* "Makefile"
-               (("\ttic .*") ""))
-             #t)))))
+             (string-append "PREFIX=" %output))))
     (inputs
      `(("libx11" ,libx11)
        ("libxft" ,libxft)
        ("fontconfig" ,fontconfig)
        ("freetype" ,freetype)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("ncurses" ,ncurses)
+       ("pkg-config" ,pkg-config)))
     (home-page "https://st.suckless.org/")
     (synopsis "Simple terminal emulator")
     (description
-- 
2.34.0
R
R
Raghav Gururajan wrote on 3 Dec 2021 21:37
(no subject)
(address . 51627-done@debbugs.gnu.org)(address . jgart@dismail.de)
eaccc711-7788-5e5b-4e2a-a272c65c09d7@raghavgururajan.name
Pushed to master as 170cb4c881..19528e39bb, with new make-flag. Thanks!
Regards,
RG.
Attachment: OpenPGP_signature
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 51627@debbugs.gnu.org