diff mbox series

[bug#48892] gnu: Add xkbset.

Message ID 8bHcC11E1nCm3IcYXyjT8kdLXscTRtadOPwnuABvrLCbarM8i42900GRRYpvewZFMVbPibP_oNC8iFRm8i3hF6h6UncuC6D8ohS5oaIKJvA=@apatience.com
State Accepted
Headers show
Series [bug#48892] gnu: Add xkbset. | expand

Checks

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

Commit Message

Paul A. Patience June 7, 2021, 12:37 a.m. UTC
Empty Message

Comments

M June 7, 2021, 10:04 a.m. UTC | #1
Paul A. Patience schreef op ma 07-06-2021 om 00:37 [+0000]:
> +       (let ((out (assoc-ref %outputs "out")))
> +         `("CC=gcc"
> +           ,(string-append "X11PREFIX=" out)
> +           ,(string-append "X11BASE=" (assoc-ref %build-inputs "libX11"))
> +           ,(string-append "INSTALL_MAN1=" out "/share/man/man1")))

You should do

  `(,,(string-append "CC=" (cc-for-target))
    ,(string-append "X11PREFIX=" ...) ...)

to make sure cross-compilation will work.
(Try ./pre-inst-env guix build xkbset --target=aarch64-linux-gnu.)

Also, libx11 is usualy named "libx11" (no capital letters)
in package inputs, and very infrequently "libX11". I would use "libx11".

Greetings,
Maxime.
diff mbox series

Patch

From fa94f75cd3b620cdd8c6826dbe6fc268863b1344 Mon Sep 17 00:00:00 2001
From: "Paul A. Patience" <paul@apatience.com>
Date: Sun, 6 Jun 2021 20:34:52 -0400
Subject: [PATCH] gnu: Add xkbset.

* gnu/packages/xorg.scm (xkbset): New variable.
---
 gnu/packages/xorg.scm | 56 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm
index 9156fb3163..a8032c9526 100644
--- a/gnu/packages/xorg.scm
+++ b/gnu/packages/xorg.scm
@@ -28,6 +28,7 @@ 
 ;;; Copyright © 2020 Jean-Baptiste Note <jean-baptiste.note@m4x.org>
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
+;;; Copyright © 2021 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +89,7 @@ 
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages spice)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages video)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
@@ -3980,6 +3982,60 @@  make keyboards more accessible to people with physical impairments.")
 requested commands if they occur.")
     (license license:x11)))
 
+(define-public xkbset
+  (package
+    (name "xkbset")
+    (version "0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://faculty.missouri.edu/~stephen/software/"
+                           name "/" name "-" version ".tar.gz"))
+       (sha256
+        (base32 "199mlm127zk1lr8nrq22n68l2l8cjwc4cgwd67rg1i6497n2y0xc"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("libX11" ,libx11)
+       ("perl" ,perl)
+       ("perl-tk" ,perl-tk)))
+    (arguments
+     `(#:tests? #f                      ; There are none.
+       #:make-flags
+       (let ((out (assoc-ref %outputs "out")))
+         `("CC=gcc"
+           ,(string-append "X11PREFIX=" out)
+           ,(string-append "X11BASE=" (assoc-ref %build-inputs "libX11"))
+           ,(string-append "INSTALL_MAN1=" out "/share/man/man1")))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'install 'create-install-directories
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (mkdir-p out)
+               (with-directory-excursion out
+                 (for-each mkdir-p '("bin" "share/man/man1"))))
+             #t))
+         (add-after 'install 'wrap-perl-script
+           (lambda* (#:key outputs #:allow-other-keys)
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/bin/xkbset-gui")
+               `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))
+             #t))
+         (replace 'install-license-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "COPYRIGHT"
+                           (string-append (assoc-ref outputs "out")
+                                          "/share/doc/" ,name "-" ,version))
+             #t)))))
+    (home-page "https://faculty.missouri.edu/~stephen/software/")
+    (synopsis "User-preference utility for XKB extensions for X")
+    (description
+     "This is a program to help manage many of the XKB features of the X
+Window System. This includes such features as MouseKeys, AccessX,
+StickyKeys, BounceKeys, and SlowKeys. It includes a GUI program to help
+with MouseKeys-acceleration management.")
+    (license license:bsd-3)))
 
 (define-public xkbutils
   (package
-- 
2.31.1