unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#67534] [PATCH] gnu: qmk: Support custom keyboards.
@ 2023-11-29 20:32 Sergey Trofimov
  2024-03-21 21:16 ` [bug#67534] Requesting review Sergey Trofimov
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Trofimov @ 2023-11-29 20:32 UTC (permalink / raw)
  To: 67534; +Cc: Sergey Trofimov, Efraim Flashner, Vagrant Cascadian

* 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(-)

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





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

* [bug#67534] Requesting review
  2023-11-29 20:32 [bug#67534] [PATCH] gnu: qmk: Support custom keyboards Sergey Trofimov
@ 2024-03-21 21:16 ` Sergey Trofimov
  2024-04-01  0:21   ` bug#67534: " Maxim Cournoyer
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Trofimov @ 2024-03-21 21:16 UTC (permalink / raw)
  To: 67534; +Cc: maxim.cournoyer


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

Best regards,
Sergey




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

* bug#67534: Requesting review
  2024-03-21 21:16 ` [bug#67534] Requesting review Sergey Trofimov
@ 2024-04-01  0:21   ` Maxim Cournoyer
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Cournoyer @ 2024-04-01  0:21 UTC (permalink / raw)
  To: Sergey Trofimov; +Cc: 67534-done

Hi!

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

> 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




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

end of thread, other threads:[~2024-04-01  0:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 20:32 [bug#67534] [PATCH] gnu: qmk: Support custom keyboards Sergey Trofimov
2024-03-21 21:16 ` [bug#67534] Requesting review Sergey Trofimov
2024-04-01  0:21   ` bug#67534: " Maxim Cournoyer

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).