Subject: [bug#37076] Contributing package wterm

From: ison <[email-masked]>
Date: Sun, 18 Aug 2019 14:58:12 -0600

Here is a package for wterm, a native Wayland terminal emulator based
on St.
I thought terminals.scm was an appropriate place to add it.
>From 3597ca9e62e004a27adff73ebfa572d41089a74d Mon Sep 17 00:00:00 2001
From: ison <[email-masked]>
Date: Sun, 18 Aug 2019 14:48:04 -0600
Subject: [PATCH] Add package wterm to terminals.scm

---
 gnu/packages/terminals.scm | 53 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 9077d295db..fbd0bff843 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -1106,3 +1106,56 @@ and IP roaming.  ET provides the same core functionality as @command{mosh},
 while also supporting native scrolling and @command{tmux} control mode
 (@code{tmux -CC}).")
     (license license:asl2.0)))
+
+(define-public wterm
+  (package
+    (name "wterm")
+    (version "0.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/majestrate/wterm.git")
+             (commit "0ae42717c08a85a6509214e881422c7fbe7ecc45")))
+       (sha256
+         (base32
+          "0g4lzmc1w6na81i6hny32xds4xfig4xzswzfijyi6p93a1226dv0"))
+       (file-name (git-file-name name version ))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("fontconfig" ,fontconfig)
+       ("freetype" ,freetype)
+       ("libdrm" ,libdrm)
+       ("libxkbcommon" ,libxkbcommon)
+       ("ncurses" ,ncurses)
+       ("pixman" ,pixman)
+       ("wayland" ,wayland)))
+    (arguments
+     '(#:tests? #f
+       #:make-flags (list "-j1" ; Without -j1 it fails to find file libwld.a
+                          "CC=gcc"
+                          (string-append "PREFIX=" %output)
+                          (string-append "TERMINFO="
+                                         (assoc-ref %outputs "out")
+                                         "/share/terminfo"))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'terminfo-fix
+           (lambda _
+             (substitute* "Makefile"
+               (("\ttic .*") "\tmkdir -p $(SHARE_PREFIX)/share/terminfo
+\ttic -o $(SHARE_PREFIX)/share/terminfo -s wterm.info\n"))
+             #t)))))
+    (native-search-paths
+      (list (search-path-specification
+              (variable "TERMINFO_DIRS")
+              (files '("share/terminfo")))))
+    (home-page "https://github.com/majestrate/wterm")
+    (synopsis "Terminal emulator for Wayland")
+    (description "wterm is a native Wayland terminal emulator based on
+an st fork using wld. st is a simple terminal emulator for X originally
+made by suckless.")
+    (license license:x11)))
-- 
2.23.0