unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#37717] [PATCH 0/3] gnu: Add kmonad.
@ 2019-10-12 19:32 Alex Griffin
  2019-10-12 19:33 ` [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops Alex Griffin
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Alex Griffin @ 2019-10-12 19:32 UTC (permalink / raw)
  To: 37717

This patch series adds kmonad, an advanced keyboard remapping utility inspired by the open source QMK keyboard firmware project.

https://github.com/david-janssen/kmonad
-- 
Alex Griffin

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops.
  2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
@ 2019-10-12 19:33 ` Alex Griffin
  2019-10-18 18:23   ` Marius Bakke
  2019-10-12 19:34 ` [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan Alex Griffin
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Alex Griffin @ 2019-10-12 19:33 UTC (permalink / raw)
  To: 37717

[-- Attachment #1: Type: text/plain, Size: 18 bytes --]



-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-ghc-atomic-primops.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-ghc-atomic-primops.patch", Size: 2030 bytes --]

From 77ff329dd34d307f19629086baf44c1623858fa1 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:34:43 -0500
Subject: [PATCH 1/3] gnu: Add ghc-atomic-primops.

* gnu/packages/haskell-xyz.scm (ghc-atomic-primops): New variable.
---
 gnu/packages/haskell-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 2977398880..37df2ed909 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
+;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -381,6 +382,31 @@ over threads in Haskell, in which @code{Async a} is a concurrent thread that
 will eventually deliver a value of type @code{a}.")
     (license license:bsd-3)))
 
+(define-public ghc-atomic-primops
+  (package
+    (name "ghc-atomic-primops")
+    (version "0.8.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/atomic-primops/atomic-primops-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "03n5dmyplrqgbyf8dr91izkxci7gkl3i3fnp82i5ld869zrgjfh0"))))
+    (build-system haskell-build-system)
+    (inputs `(("ghc-primitive" ,ghc-primitive)))
+    (home-page "https://github.com/rrnewton/haskell-lockfree/wiki")
+    (synopsis "Safe approach to CAS and other atomic ops")
+    (description
+     "After GHC 7.4 a new @code{casMutVar#} primop became available, but it's
+difficult to use safely, because pointer equality is a highly unstable property
+in Haskell.  This library provides a safer method based on the concept of
+@code{Ticket}s.")
+    (license license:bsd-3)))
+
 (define-public ghc-atomic-write
   (package
     (name "ghc-atomic-write")
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan.
  2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
  2019-10-12 19:33 ` [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops Alex Griffin
@ 2019-10-12 19:34 ` Alex Griffin
  2019-10-18 18:28   ` Marius Bakke
  2019-10-12 19:38 ` [bug#37717] [PATCH 3/3] gnu: Add kmonad Alex Griffin
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Alex Griffin @ 2019-10-12 19:34 UTC (permalink / raw)
  To: 37717

[-- Attachment #1: Type: text/plain, Size: 18 bytes --]



-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-ghc-unagi-chan.patch --]
[-- Type: text/x-patch; name="0002-gnu-Add-ghc-unagi-chan.patch", Size: 2046 bytes --]

From 12b43fc165aafce2844f8edf9dad99f89bcad943 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:45:35 -0500
Subject: [PATCH 2/3] gnu: Add ghc-unagi-chan.

* gnu/packages/haskell-xyz.scm (ghc-unagi-chan): New variable.
---
 gnu/packages/haskell-xyz.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 37df2ed909..e8a6a1c498 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -10631,6 +10631,39 @@ processes.  It wraps around the @code{process} library, and intends to improve
 upon it.")
     (license license:expat)))
 
+(define-public ghc-unagi-chan
+  (package
+    (name "ghc-unagi-chan")
+    (version "0.4.1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/unagi-chan/unagi-chan-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1lnl5n4jnjmm4chp461glcwkrrw63rjz3fvprwxcy3lkpbkrqvgn"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-atomic-primops" ,ghc-atomic-primops)
+       ("ghc-primitive" ,ghc-primitive)))
+    (arguments
+     `(#:tests? #f ; FIXME: Tests can't find Data.Primitive.Addr
+       #:cabal-revision
+       ("1"
+        "09pqi867wskwgc5lpn197f895mbn1174ydgllvcppcsmrz2b6yr6")))
+    (home-page "http://hackage.haskell.org/package/unagi-chan")
+    (synopsis "Fast concurrent queues with a Chan-like API, and more")
+    (description
+     "This library provides implementations of concurrent FIFO queues (for
+both general boxed and primitive unboxed values) that are fast, perform well
+under contention, and offer a Chan-like interface.  The library may be of
+limited usefulness outside of x86 architectures where the fetch-and-add
+instruction is not available.")
+    (license license:bsd-3)))
+
 (define-public ghc-unbounded-delays
   (package
     (name "ghc-unbounded-delays")
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 3/3] gnu: Add kmonad.
  2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
  2019-10-12 19:33 ` [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops Alex Griffin
  2019-10-12 19:34 ` [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan Alex Griffin
@ 2019-10-12 19:38 ` Alex Griffin
  2019-10-12 22:32 ` Alex Griffin
  2019-10-18 18:47 ` [bug#37717] [PATCH 0/3] " Marius Bakke
  4 siblings, 0 replies; 12+ messages in thread
From: Alex Griffin @ 2019-10-12 19:38 UTC (permalink / raw)
  To: 37717

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

This patch adds KMonad. A KMonad service is probably in order at some point, because to avoid running it as root you need to set up group permissions and udev rules.
-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-kmonad.patch --]
[-- Type: text/x-patch; name="0003-gnu-Add-kmonad.patch", Size: 2989 bytes --]

From c3256cb46c227438ce30dfc2b89a723b367b5d23 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:55:49 -0500
Subject: [PATCH 3/3] gnu: Add kmonad.

* gnu/packages/haskell-apps.scm (kmonad): New variable.
---
 gnu/packages/haskell-apps.scm | 46 +++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index e09285d63a..2c0491fa9b 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2015 John Soo <jsoo1@asu.edu>
+;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -497,6 +498,51 @@ with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
 and mIRC chat codes.")
     (license license:bsd-3)))
 
+(define-public kmonad
+  (package
+    (name "kmonad")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/david-janssen/kmonad.git")
+             (commit "06d7b8c709efa695be35df9bde91275cbb2ba099")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1rjr4h5yq63x3kad6yn4p8v26389sd9dgr5n2w73s1chafapzwwd"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'haddock)             ; Haddock fails to generate docs
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/kmonad-" ,version)))
+               (install-file "README.md" doc)
+               (copy-recursively "doc" doc)
+               (copy-recursively "example" (string-append doc "/example"))
+               #t))))))
+    (inputs
+     `(("ghc-cereal" ,ghc-cereal)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-megaparsec" ,ghc-megaparsec-7)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-unagi-chan" ,ghc-unagi-chan)
+       ("ghc-unliftio" ,ghc-unliftio)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)))
+    (home-page "https://github.com/david-janssen/kmonad")
+    (synopsis "Advanced keyboard manager")
+    (description "KMonad is a keyboard remapping utility that supports
+advanced functionality, such as custom keymap layers and modifiers, macros,
+and conditional mappings that send a different keycode when tapped or held.
+By operating at a lower level than most similar tools, it supports X11,
+Wayland, and Linux console environments alike.")
+    (license license:expat)))
+
 (define-public raincat
   (package
     (name "raincat")
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 3/3] gnu: Add kmonad.
  2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
                   ` (2 preceding siblings ...)
  2019-10-12 19:38 ` [bug#37717] [PATCH 3/3] gnu: Add kmonad Alex Griffin
@ 2019-10-12 22:32 ` Alex Griffin
  2019-10-18 18:37   ` Marius Bakke
  2019-10-18 18:47 ` [bug#37717] [PATCH 0/3] " Marius Bakke
  4 siblings, 1 reply; 12+ messages in thread
From: Alex Griffin @ 2019-10-12 22:32 UTC (permalink / raw)
  To: 37717

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

I went ahead and added the necessary udev rule to the kmonad package. The revised patch is attached. I've tested it and confirmed that if you add your user to the input group, and include kmonad in your system udev rules [1], you can run kmonad as an unprivileged user.

[1]: https://guix.gnu.org/manual/en/html_node/Base-Services.html

-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-gnu-Add-kmonad.patch --]
[-- Type: text/x-patch; name="0003-gnu-Add-kmonad.patch", Size: 3602 bytes --]

From 93c0d7fd68c8bee08162dfb93725675dfd9d8101 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:55:49 -0500
Subject: [PATCH 3/3] gnu: Add kmonad.

* gnu/packages/haskell-apps.scm (kmonad): New variable.
---
 gnu/packages/haskell-apps.scm | 58 +++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index e09285d63a..69a4df2cc2 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2015 John Soo <jsoo1@asu.edu>
+;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -497,6 +498,63 @@ with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
 and mIRC chat codes.")
     (license license:bsd-3)))
 
+(define-public kmonad
+  (package
+    (name "kmonad")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/david-janssen/kmonad.git")
+             (commit "06d7b8c709efa695be35df9bde91275cbb2ba099")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1rjr4h5yq63x3kad6yn4p8v26389sd9dgr5n2w73s1chafapzwwd"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'haddock)             ; Haddock fails to generate docs
+         (add-after 'install 'install-udev-rules
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (rules (string-append out "/lib/udev/rules.d")))
+               (mkdir-p rules)
+               (with-output-to-file (string-append rules "/70-kmonad.rules")
+                 (lambda _
+                   (display
+                    (string-append
+                     "KERNEL==\"uinput\", MODE=\"0660\", "
+                     "GROUP=\"input\", OPTIONS+=\"static_node=uinput\""))
+                   (newline))))))
+         (add-after 'install-udev-rules 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/kmonad-" ,version)))
+               (install-file "README.md" doc)
+               (copy-recursively "doc" doc)
+               (copy-recursively "example" (string-append doc "/example"))
+               #t))))))
+    (inputs
+     `(("ghc-cereal" ,ghc-cereal)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-megaparsec" ,ghc-megaparsec-7)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-unagi-chan" ,ghc-unagi-chan)
+       ("ghc-unliftio" ,ghc-unliftio)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)))
+    (home-page "https://github.com/david-janssen/kmonad")
+    (synopsis "Advanced keyboard manager")
+    (description "KMonad is a keyboard remapping utility that supports
+advanced functionality, such as custom keymap layers and modifiers, macros,
+and conditional mappings that send a different keycode when tapped or held.
+By operating at a lower level than most similar tools, it supports X11,
+Wayland, and Linux console environments alike.")
+    (license license:expat)))
+
 (define-public raincat
   (package
     (name "raincat")
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops.
  2019-10-12 19:33 ` [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops Alex Griffin
@ 2019-10-18 18:23   ` Marius Bakke
  0 siblings, 0 replies; 12+ messages in thread
From: Marius Bakke @ 2019-10-18 18:23 UTC (permalink / raw)
  To: Alex Griffin, 37717

[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]

"Alex Griffin" <a@ajgrf.com> writes:

> From 77ff329dd34d307f19629086baf44c1623858fa1 Mon Sep 17 00:00:00 2001
> From: Alex Griffin <a@ajgrf.com>
> Date: Sat, 12 Oct 2019 13:34:43 -0500
> Subject: [PATCH 1/3] gnu: Add ghc-atomic-primops.
>
> * gnu/packages/haskell-xyz.scm (ghc-atomic-primops): New variable.

[...]

> diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
> index 2977398880..37df2ed909 100644
> --- a/gnu/packages/haskell-xyz.scm
> +++ b/gnu/packages/haskell-xyz.scm
> @@ -381,6 +382,31 @@ over threads in Haskell, in which @code{Async a} is a concurrent thread that
>  will eventually deliver a value of type @code{a}.")
>      (license license:bsd-3)))
>  
> +(define-public ghc-atomic-primops
> +  (package
> +    (name "ghc-atomic-primops")
> +    (version "0.8.3")

Note: we follow the Stackage LTS versions for GHC 7.4, currently 12.26.
So I think we should take version 0.8.2 instead:

https://www.stackage.org/lts-12.26/package/atomic-primops-0.8.2

(hopefully Timothy or someone can correct me if I'm wrong here)

> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://hackage.haskell.org/package/atomic-primops/atomic-primops-"
> +             version
> +             ".tar.gz"))

Can you align these lines a bit?

> +       (sha256
> +        (base32
> +         "03n5dmyplrqgbyf8dr91izkxci7gkl3i3fnp82i5ld869zrgjfh0"))))
> +    (build-system haskell-build-system)
> +    (inputs `(("ghc-primitive" ,ghc-primitive)))
> +    (home-page "https://github.com/rrnewton/haskell-lockfree/wiki")
> +    (synopsis "Safe approach to CAS and other atomic ops")
> +    (description
> +     "After GHC 7.4 a new @code{casMutVar#} primop became available, but it's
> +difficult to use safely, because pointer equality is a highly unstable property
> +in Haskell.  This library provides a safer method based on the concept of
> +@code{Ticket}s.")

Can you try to adjust the first sentence so that it reads better?
Perhaps something along the lines of "GHC 7.4 introduced a new
@code{casMutVar#} PrimOp which is difficult to use safely, because ...".


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan.
  2019-10-12 19:34 ` [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan Alex Griffin
@ 2019-10-18 18:28   ` Marius Bakke
  0 siblings, 0 replies; 12+ messages in thread
From: Marius Bakke @ 2019-10-18 18:28 UTC (permalink / raw)
  To: Alex Griffin, 37717

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

"Alex Griffin" <a@ajgrf.com> writes:

> From 12b43fc165aafce2844f8edf9dad99f89bcad943 Mon Sep 17 00:00:00 2001
> From: Alex Griffin <a@ajgrf.com>
> Date: Sat, 12 Oct 2019 13:45:35 -0500
> Subject: [PATCH 2/3] gnu: Add ghc-unagi-chan.
>
> * gnu/packages/haskell-xyz.scm (ghc-unagi-chan): New variable.

[...]

> +(define-public ghc-unagi-chan
> +  (package
> +    (name "ghc-unagi-chan")
> +    (version "0.4.1.2")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://hackage.haskell.org/package/unagi-chan/unagi-chan-"
> +             version
> +             ".tar.gz"))

I did not find this package in Stackage 12.26, so I guess it's OK to
take this one.  It's nice if you can prettify these lines, though :-)

> +       (sha256
> +        (base32
> +         "1lnl5n4jnjmm4chp461glcwkrrw63rjz3fvprwxcy3lkpbkrqvgn"))))
> +    (build-system haskell-build-system)
> +    (inputs
> +     `(("ghc-atomic-primops" ,ghc-atomic-primops)
> +       ("ghc-primitive" ,ghc-primitive)))
> +    (arguments
> +     `(#:tests? #f ; FIXME: Tests can't find Data.Primitive.Addr

Should this not be provided by 'ghc-primitive'?  Perhaps it is expecting
a different version?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 3/3] gnu: Add kmonad.
  2019-10-12 22:32 ` Alex Griffin
@ 2019-10-18 18:37   ` Marius Bakke
  0 siblings, 0 replies; 12+ messages in thread
From: Marius Bakke @ 2019-10-18 18:37 UTC (permalink / raw)
  To: Alex Griffin, 37717

[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]

"Alex Griffin" <a@ajgrf.com> writes:

> I went ahead and added the necessary udev rule to the kmonad package. The revised patch is attached. I've tested it and confirmed that if you add your user to the input group, and include kmonad in your system udev rules [1], you can run kmonad as an unprivileged user.

Nice work!

> From 93c0d7fd68c8bee08162dfb93725675dfd9d8101 Mon Sep 17 00:00:00 2001
> From: Alex Griffin <a@ajgrf.com>
> Date: Sat, 12 Oct 2019 13:55:49 -0500
> Subject: [PATCH 3/3] gnu: Add kmonad.
>
> * gnu/packages/haskell-apps.scm (kmonad): New variable.

[...]

> +(define-public kmonad
> +  (package
> +    (name "kmonad")
> +    (version "0.2.0")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri (git-reference
> +             (url "https://github.com/david-janssen/kmonad.git")
> +             (commit "06d7b8c709efa695be35df9bde91275cbb2ba099")))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "1rjr4h5yq63x3kad6yn4p8v26389sd9dgr5n2w73s1chafapzwwd"))))
> +    (build-system haskell-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'haddock)             ; Haddock fails to generate docs
> +         (add-after 'install 'install-udev-rules
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (rules (string-append out "/lib/udev/rules.d")))
> +               (mkdir-p rules)
> +               (with-output-to-file (string-append rules "/70-kmonad.rules")
> +                 (lambda _
> +                   (display
> +                    (string-append
> +                     "KERNEL==\"uinput\", MODE=\"0660\", "
> +                     "GROUP=\"input\", OPTIONS+=\"static_node=uinput\""))
> +                   (newline))))))

Nitpicking, but I have a preference for the more explicit
'call-with-output-file', as well as using 'format':

(call-with-output-file (string-append rules ...)
  (lambda (port)
    (format port "KERNEL...~%")))

YMMV.  This phase should return #t, though.

Otherwise LGTM.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 0/3] gnu: Add kmonad.
  2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
                   ` (3 preceding siblings ...)
  2019-10-12 22:32 ` Alex Griffin
@ 2019-10-18 18:47 ` Marius Bakke
  2019-10-26  2:43   ` Alex Griffin
  4 siblings, 1 reply; 12+ messages in thread
From: Marius Bakke @ 2019-10-18 18:47 UTC (permalink / raw)
  To: Alex Griffin, 37717

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

"Alex Griffin" <a@ajgrf.com> writes:

> This patch series adds kmonad, an advanced keyboard remapping utility inspired by the open source QMK keyboard firmware project.
>
> https://github.com/david-janssen/kmonad

Thanks!  kmonad looks like a great tool.

I sent some feedback on the individual patches.  Can you create an
account on Savannah if you haven't already?  Then you can push the next
version yourself.  :-)

Please also send a reply to this message signed by the same GPG key that
you will use to sign commits, and make sure to upload it to Savannah.

Thanks in advance,
Marius

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 0/3] gnu: Add kmonad.
  2019-10-18 18:47 ` [bug#37717] [PATCH 0/3] " Marius Bakke
@ 2019-10-26  2:43   ` Alex Griffin
  2019-10-28 23:11     ` Marius Bakke
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Griffin @ 2019-10-26  2:43 UTC (permalink / raw)
  To: Marius Bakke, 37717


[-- Attachment #1.1.1: Type: text/plain, Size: 1022 bytes --]

On 10/18/19 1:47 PM, Marius Bakke wrote:
> I sent some feedback on the individual patches.  Can you create an
> account on Savannah if you haven't already?  Then you can push the next
> version yourself.  :-)
> 
> Please also send a reply to this message signed by the same GPG key that
> you will use to sign commits, and make sure to upload it to Savannah.

Thanks! I've attached updated patches with the suggested changes,
created a Savannah account, and this email should be signed with my GPG key.

Kmonad 0.3 was released last week, but I don't think it can be updated
in Guix until we move to a newer Stackage.

> Should this not be provided by 'ghc-primitive'?  Perhaps it is
> expecting a different version?

From what I can gather, there were a few commits upstream to add support
for primitive 0.7 without breaking 0.6, but they forgot to make the same
change in the test suite.

https://github.com/jberryman/unagi-chan/commit/b4af3f2b0d76de701ec8ca4a17ab88f776fe80a9

-- 
Alex Griffin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: 0001-gnu-Add-ghc-atomic-primops.patch --]
[-- Type: text/x-patch; name="0001-gnu-Add-ghc-atomic-primops.patch", Size: 2054 bytes --]

From f21859ffccd201e9229e38cdc0be1e7bd4be0cd4 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:34:43 -0500
Subject: [PATCH 1/3] gnu: Add ghc-atomic-primops.

* gnu/packages/haskell-xyz.scm (ghc-atomic-primops): New variable.
---
 gnu/packages/haskell-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 2977398880..e134641de4 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
+;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -381,6 +382,28 @@ over threads in Haskell, in which @code{Async a} is a concurrent thread that
 will eventually deliver a value of type @code{a}.")
     (license license:bsd-3)))
 
+(define-public ghc-atomic-primops
+  (package
+    (name "ghc-atomic-primops")
+    (version "0.8.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/atomic-primops"
+                           "/atomic-primops-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0cyr2x6xqz6s233znrz9rnrfj56m9bmnawwnka0lsqqy1hp8gy37"))))
+    (build-system haskell-build-system)
+    (inputs `(("ghc-primitive" ,ghc-primitive)))
+    (home-page "https://github.com/rrnewton/haskell-lockfree/wiki")
+    (synopsis "Safe approach to CAS and other atomic ops")
+    (description
+     "GHC 7.4 introduced a new @code{casMutVar} PrimOp which is difficult to
+use safely, because pointer equality is a highly unstable property in Haskell.
+This library provides a safer method based on the concept of @code{Ticket}s.")
+    (license license:bsd-3)))
+
 (define-public ghc-atomic-write
   (package
     (name "ghc-atomic-write")
-- 
2.23.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.3: 0002-gnu-Add-ghc-unagi-chan.patch --]
[-- Type: text/x-patch; name="0002-gnu-Add-ghc-unagi-chan.patch", Size: 2088 bytes --]

From 1f5fa2c80e1e8e2ae2bfa430f7feefad159fbd40 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:45:35 -0500
Subject: [PATCH 2/3] gnu: Add ghc-unagi-chan.

* gnu/packages/haskell-xyz.scm (ghc-unagi-chan): New variable.
---
 gnu/packages/haskell-xyz.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index e134641de4..2b7fb68bb8 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -10628,6 +10628,37 @@ processes.  It wraps around the @code{process} library, and intends to improve
 upon it.")
     (license license:expat)))
 
+(define-public ghc-unagi-chan
+  (package
+    (name "ghc-unagi-chan")
+    (version "0.4.1.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/unagi-chan"
+                           "/unagi-chan-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1lnl5n4jnjmm4chp461glcwkrrw63rjz3fvprwxcy3lkpbkrqvgn"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-atomic-primops" ,ghc-atomic-primops)
+       ("ghc-primitive" ,ghc-primitive)))
+    (arguments
+     `(#:tests? #f ; FIXME: Tests can't find Data.Primitive.Addr
+       #:cabal-revision
+       ("1"
+        "09pqi867wskwgc5lpn197f895mbn1174ydgllvcppcsmrz2b6yr6")))
+    (home-page "http://hackage.haskell.org/package/unagi-chan")
+    (synopsis "Fast concurrent queues with a Chan-like API, and more")
+    (description
+     "This library provides implementations of concurrent FIFO queues (for
+both general boxed and primitive unboxed values) that are fast, perform well
+under contention, and offer a Chan-like interface.  The library may be of
+limited usefulness outside of x86 architectures where the fetch-and-add
+instruction is not available.")
+    (license license:bsd-3)))
+
 (define-public ghc-unbounded-delays
   (package
     (name "ghc-unbounded-delays")
-- 
2.23.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.4: 0003-gnu-Add-kmonad.patch --]
[-- Type: text/x-patch; name="0003-gnu-Add-kmonad.patch", Size: 3716 bytes --]

From 03602a5602a701554e82383b7032f2d6d02b8e19 Mon Sep 17 00:00:00 2001
From: Alex Griffin <a@ajgrf.com>
Date: Sat, 12 Oct 2019 13:55:49 -0500
Subject: [PATCH 3/3] gnu: Add kmonad.

* gnu/packages/haskell-apps.scm (kmonad): New variable.
---
 gnu/packages/haskell-apps.scm | 59 +++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index c5e1cd6c64..a349c7445d 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2015 John Soo <jsoo1@asu.edu>
+;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -496,6 +497,64 @@ with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
 and mIRC chat codes.")
     (license license:bsd-3)))
 
+(define-public kmonad
+  (package
+    (name "kmonad")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/david-janssen/kmonad.git")
+             (commit "06d7b8c709efa695be35df9bde91275cbb2ba099")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1rjr4h5yq63x3kad6yn4p8v26389sd9dgr5n2w73s1chafapzwwd"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'haddock)             ; Haddock fails to generate docs
+         (add-after 'install 'install-udev-rules
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (rules (string-append out "/lib/udev/rules.d")))
+               (mkdir-p rules)
+               (call-with-output-file (string-append rules "/70-kmonad.rules")
+                 (lambda (port)
+                   (display
+                    (string-append
+                     "KERNEL==\"uinput\", MODE=\"0660\", "
+                     "GROUP=\"input\", OPTIONS+=\"static_node=uinput\"\n")
+                    port)))
+               #t)))
+         (add-after 'install-udev-rules 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/kmonad-" ,version)))
+               (install-file "README.md" doc)
+               (copy-recursively "doc" doc)
+               (copy-recursively "example" (string-append doc "/example"))
+               #t))))))
+    (inputs
+     `(("ghc-cereal" ,ghc-cereal)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-megaparsec" ,ghc-megaparsec-7)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-unagi-chan" ,ghc-unagi-chan)
+       ("ghc-unliftio" ,ghc-unliftio)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)))
+    (home-page "https://github.com/david-janssen/kmonad")
+    (synopsis "Advanced keyboard manager")
+    (description "KMonad is a keyboard remapping utility that supports
+advanced functionality, such as custom keymap layers and modifiers, macros,
+and conditional mappings that send a different keycode when tapped or held.
+By operating at a lower level than most similar tools, it supports X11,
+Wayland, and Linux console environments alike.")
+    (license license:expat)))
+
 (define-public raincat
   (package
     (name "raincat")
-- 
2.23.0


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [bug#37717] [PATCH 0/3] gnu: Add kmonad.
  2019-10-26  2:43   ` Alex Griffin
@ 2019-10-28 23:11     ` Marius Bakke
  2019-10-30  3:56       ` bug#37717: " Alex Griffin
  0 siblings, 1 reply; 12+ messages in thread
From: Marius Bakke @ 2019-10-28 23:11 UTC (permalink / raw)
  To: Alex Griffin, 37717

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

Alex Griffin <a@ajgrf.com> writes:

> On 10/18/19 1:47 PM, Marius Bakke wrote:
>> I sent some feedback on the individual patches.  Can you create an
>> account on Savannah if you haven't already?  Then you can push the next
>> version yourself.  :-)
>> 
>> Please also send a reply to this message signed by the same GPG key that
>> you will use to sign commits, and make sure to upload it to Savannah.
>
> Thanks! I've attached updated patches with the suggested changes,
> created a Savannah account, and this email should be signed with my GPG key.

Great!  I have added you to the Savannah project now.  \o/

Make sure to read HACKING, and enjoy your new commit superpowers.  :-)

> Kmonad 0.3 was released last week, but I don't think it can be updated
> in Guix until we move to a newer Stackage.

Right.  Rumor has it that a new Stackage LTS 14 branch is coming up,
perhaps you can be an early tester?  ;-)

>> Should this not be provided by 'ghc-primitive'?  Perhaps it is
>> expecting a different version?
>
> From what I can gather, there were a few commits upstream to add support
> for primitive 0.7 without breaking 0.6, but they forgot to make the same
> change in the test suite.
>
> https://github.com/jberryman/unagi-chan/commit/b4af3f2b0d76de701ec8ca4a17ab88f776fe80a9

OK.  Can you adjust the comment to mention that a newer ghc-primitive is
required?  Otherwise LGTM.

Thanks, and welcome!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#37717: [PATCH 0/3] gnu: Add kmonad.
  2019-10-28 23:11     ` Marius Bakke
@ 2019-10-30  3:56       ` Alex Griffin
  0 siblings, 0 replies; 12+ messages in thread
From: Alex Griffin @ 2019-10-30  3:56 UTC (permalink / raw)
  To: Marius Bakke, 37717-done

Just committed kmonad to master, marking this bug as done.

On Mon, Oct 28, 2019, at 11:11 PM, Marius Bakke wrote:
> Great!  I have added you to the Savannah project now.  \o/
> 
> Make sure to read HACKING, and enjoy your new commit superpowers.  :-)

> Thanks, and welcome! 

Thanks, I'm excited to be part of the project!

> Right.  Rumor has it that a new Stackage LTS 14 branch is coming up,
> perhaps you can be an early tester?  ;-)

Sure, I'll keep an eye out for it.

-- 
Alex Griffin

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-10-30  3:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-12 19:32 [bug#37717] [PATCH 0/3] gnu: Add kmonad Alex Griffin
2019-10-12 19:33 ` [bug#37717] [PATCH 1/3] gnu: Add ghc-atomic-primops Alex Griffin
2019-10-18 18:23   ` Marius Bakke
2019-10-12 19:34 ` [bug#37717] [PATCH 2/3] gnu: Add ghc-unagi-chan Alex Griffin
2019-10-18 18:28   ` Marius Bakke
2019-10-12 19:38 ` [bug#37717] [PATCH 3/3] gnu: Add kmonad Alex Griffin
2019-10-12 22:32 ` Alex Griffin
2019-10-18 18:37   ` Marius Bakke
2019-10-18 18:47 ` [bug#37717] [PATCH 0/3] " Marius Bakke
2019-10-26  2:43   ` Alex Griffin
2019-10-28 23:11     ` Marius Bakke
2019-10-30  3:56       ` bug#37717: " Alex Griffin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).