[PATCH] gnu: qmk: Support custom keyboards.

  • Done
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Sergey Trofimov
Owner
unassigned
Submitted by
Sergey Trofimov
Severity
normal

Debbugs page

Sergey Trofimov wrote 1 years ago
(address . guix-patches@gnu.org)(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
940c712802a6bb69dde97dca4b6c01524d0a0a1e.1701289507.git.sarg@sarg.org.ru
* gnu/packages/firmware.scm (make-qmk-firmware/implementation):
Add keyboard-source-directory parameter.
---
gnu/packages/firmware.scm | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)

Toggle diff (46 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 294bbea184..e06b321cde 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1406,14 +1406,16 @@ (define-public qmk
(define* (make-qmk-firmware/implementation keyboard keymap
#:key (description "")
keymap-json
- keymap-source-directory)
+ keymap-source-directory
+ keyboard-source-directory)
"Return a package to build the QMK firmware for KEYBOARD with KEYMAP.
-Keyboard should be the name of a sub-directory under the @file{keyboards}
-directory. For custom keymaps, KEYMAP-JSON, a file-like object of a JSON
-representation of KEYMAP as generated by the @url{https://config.qmk.fm/, QMK
-Configurator} tool or KEYMAP-SOURCE-DIRECTORY, a file-like object directory
-containing the keymap source files files such as @file{keymap.c}, can be
-provided."
+Keyboard should be the name of a sub-directory under the @file{keyboards} directory.
+For custom keymaps, KEYMAP-JSON, a file-like object of a JSON representation of
+KEYMAP as generated by the @url{https://config.qmk.fm/, QMK Configurator} tool or
+KEYMAP-SOURCE-DIRECTORY, a file-like object directory containing the keymap source
+files files such as @file{keymap.c}, can be provided. For keyboards not available in
+upstream repository, provide a file-like object directory containing the whole
+keyboard definition in KEYBOARD-SOURCE-DIRECTORY."
(package
(name (string-append "qmk-firmware-"
(string-replace-substring keyboard "_" "-") "-"
@@ -1472,6 +1474,15 @@ (define* (make-qmk-firmware/implementation keyboard keymap
(base32
"1rmhm4rxvq8skxqn6vc4n4ly1ak6whj7c386zbsci4pxx548n9h4"))))
"lib/lufa")))
+ #$@(if keyboard-source-directory
+ #~((add-after 'unpack 'copy-keyboard-source-directory
+ (lambda _
+ (let ((keyboard-dir #$(string-append "keyboards/" keyboard)))
+ (false-if-exception (delete-file-recursively
+ keyboard-dir))
+ (copy-recursively #$keyboard-source-directory
+ keyboard-dir)))))
+ #~())
#$@(if keymap-source-directory
#~((add-after 'unpack 'copy-keymap-source-directory
(lambda _

base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767
--
2.41.0
Sergey Trofimov wrote 12 months ago
Requesting review
(address . 67534@debbugs.gnu.org)(address . maxim.cournoyer@gmail.com)
87le6b2s5b.fsf@sarg.org.ru
Hi Maxim,

may I ask your review here, as you've authored qmk firmware
package. I'm adding `keyboard-source-directory` to the
`make-qmk-firmware` procedure, so that a custom firmware could be
built without upstreaming a keyboard definition to the main QMK
repo. Here is how I use it:

Best regards,
Sergey
Maxim Cournoyer wrote 11 months ago
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)(address . 67534-done@debbugs.gnu.org)
87v852vsnu.fsf@gmail.com
Hi!

Sergey Trofimov <sarg@sarg.org.ru> writes:

Toggle quote (9 lines)
> Hi Maxim,
>
> may I ask your review here, as you've authored qmk firmware
> package. I'm adding `keyboard-source-directory` to the
> `make-qmk-firmware` procedure, so that a custom firmware could be
> built without upstreaming a keyboard definition to the main QMK
> repo. Here is how I use it:
> https://github.com/sarg/keyboard/blob/91b87a830ef6029c1023c0d8fc877c067b12ab1e/guix.scm

Makes sense. I'll push shortly.

--
Thanks,
Maxim
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 67534
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help