Subject: [bug#50805] [PATCH] gnu: Add svkbd.

From: Antero Mejr <[email-masked]>
Date: Mon, 7 Mar 2022 11:50:19 -0500

* gnu/packages/suckless.scm (svkbd): New variable.
---
Linted and updated to version 0.4.1.

 gnu/packages/suckless.scm | 46 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/suckless.scm b/gnu/packages/suckless.scm
index 708eb2c338..f75fd8054d 100644
--- a/gnu/packages/suckless.scm
+++ b/gnu/packages/suckless.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2021 Raghav Gururajan <[email-masked]>
 ;;; Copyright © 2021 Alexandru-Sergiu Marton <[email-masked]>
 ;;; Copyright © 2021 Nikolay Korotkiy <[email-masked]>
+;;; Copyright © 2022 Antero Mejr <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1083,3 +1084,48 @@ (define-public sfeed
 various other formats.  There are also some programs and scripts included to
 import and export OPML and to fetch, filter, merge and order feed items.")
     (license license:isc)))
+
+(define-public svkbd
+  (package
+    (name "svkbd")
+    (version "0.4.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://dl.suckless.org/tools/svkbd-"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "0nhgmr38pk1a8zrcrxd1ygh0m843a3bdchkv8phl508x7vy63hpv"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("glibc-utf8-locales" ,glibc-utf8-locales)))
+    (inputs
+     `(("freetype" ,freetype)
+       ("libx11" ,libx11)
+       ("libxtst" ,libxtst)
+       ("libxft" ,libxft)
+       ("libxinerama" ,libxinerama)))
+    (arguments
+     `(#:tests? #f
+       #:make-flags
+       (list (string-append "CC=" ,(cc-for-target))
+             (string-append "PREFIX=" %output))
+       #:phases
+        (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (substitute* "config.mk"
+               (("/usr/local")
+                (assoc-ref outputs "out"))
+               (("/usr/X11R6")
+                (assoc-ref inputs "libx11"))
+               (("/usr/include/freetype2")
+                (string-append (assoc-ref inputs "freetype")
+                               "/include/freetype2")))))
+         (delete 'configure))))         ; no configure script
+    (home-page "https://tools.suckless.org/x/svkbd/")
+    (synopsis "Virtual on-screen keyboard")
+    (description "svkbd is a simple virtual keyboard, intended to be used in
+environments, where no keyboard is available.")
+    (license license:expat)))
-- 
2.32.0