gnu: Add ergodox-firmware-colemak-jc-mod.

* gnu/packages/firmware.scm (make-ergodox-firmware): New procedure
(ergodox-firmware-colemak-jc-mod): New variable.
* gnu/packages/patches/ergodox-firmware-fix-json-target.patch: New file.
* gnu/packages/patches/ergodox-firmware-fix-numpad.patch: Likewise.
* gnu/local.mk (dist_patch_DATA): Register them.
This commit is contained in:
Maxim Cournoyer 2023-09-13 13:42:22 -04:00
parent f110992686
commit 9e4008e36e
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
4 changed files with 1501 additions and 1 deletions

View File

@ -1125,6 +1125,8 @@ dist_patch_DATA = \
%D%/packages/patches/enblend-enfuse-reproducible.patch \
%D%/packages/patches/enjarify-setup-py.patch \
%D%/packages/patches/enlightenment-fix-setuid-path.patch \
%D%/packages/patches/ergodox-firmware-fix-json-target.patch \
%D%/packages/patches/ergodox-firmware-fix-numpad.patch \
%D%/packages/patches/erlang-man-path.patch \
%D%/packages/patches/esmini-no-clutter-log.patch \
%D%/packages/patches/esmini-use-pkgconfig.patch \

View File

@ -85,7 +85,8 @@
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:export (make-qmk-firmware))
#:export (make-ergodox-firmware
make-qmk-firmware))
(define-public ath9k-htc-firmware
(package
@ -1222,6 +1223,80 @@ AR100.")
(define-public crust-pine64-plus
(make-crust-package "pine64_plus"))
;;;
;;; ErgoDox firmware.
;;;
(define* (make-ergodox-firmware/implementation layout #:key override.c
override.h)
"Return an ergodox-firmware package for LAYOUT, optionally using OVERRIDE.C,
a C source file-like object to override LAYOUT which may be accompanied by
OVERRIDE.H, to also override the corresponding layout include file."
(let ((revision "0")
(commit "89b7e2bfdafb2a87e0248846d5c95cc5e9a27858"))
(package
(name (string-append "ergodox-firmware-" layout))
(version (git-version "1" revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/benblazak/ergodox-firmware")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"1z28frxyb21nz90frycrpsbxjp09374wawayvjphnwc8njlvkkpy"))
(patches
(search-patches "ergodox-firmware-fix-json-target.patch"
"ergodox-firmware-fix-numpad.patch"))))
(build-system gnu-build-system)
(arguments
(list
#:tests? #f ;no test suite
#:make-flags
#~(list (string-append "LAYOUT=" #$layout)
;; Simplify the output directory name.
"ROOT=output")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'copy-override-files
(lambda _
(when #$override.c
(copy-file #$override.c
(format #f "src/keyboard/ergodox/layout/~a.c"
#$layout)))
(when #$override.h
(copy-file #$override.h
(format #f "src/keyboard/ergodox/layout/~a.h"
#$layout)))))
;; The Makefile-based build system lacks configure
;; and install targets.
(delete 'configure)
(replace 'install
(lambda _
(with-directory-excursion "output"
(install-file "firmware.hex" #$output)
(install-file "firmware.eep" #$output)
(install-file "firmware--layout.html" #$output)))))))
(native-inputs (list (make-avr-toolchain) python))
(home-page "https://www.ergodox.io")
(synopsis "Firmware for the ErgoDox keyboard")
(description (format #f "This package contains the original firmware for
the ErgoDox keyboard, built using the ~a layout (as defined in the
@file{src/keyboard/ergodox/layout/~@*~a.c} source file). It contains the
@file{firmware.hex} and the @file{firmware.eep} files, which can be loaded to
a target using the @code{teensy-loader-cli} package as well as a
@file{firmware--layout.html} file, useful to easily visualize the
corresponding layout." layout))
(license license:expat))))
(define make-ergodox-firmware
(memoize make-ergodox-firmware/implementation))
(define-public ergodox-firmware-colemak-jc-mod
(make-ergodox-firmware "colemak-jc-mod"))
;;;
;;; QMK Firmware.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
Submitted upstream: https://github.com/benblazak/ergodox-firmware/pull/100
diff --git a/src/lib/key-functions/public/special.c b/src/lib/key-functions/public/special.c
index 42aba45..6488137 100644
--- a/src/lib/key-functions/public/special.c
+++ b/src/lib/key-functions/public/special.c
@@ -102,9 +102,9 @@ void kbfun_2_keys_capslock_press_release(void) {
static uint8_t numpad_layer_id;
static inline void numpad_toggle_numlock(void) {
- _kbfun_press_release(true, KEY_LockingNumLock);
+ _kbfun_press_release(true, KEYPAD_NumLock_Clear);
usb_keyboard_send();
- _kbfun_press_release(false, KEY_LockingNumLock);
+ _kbfun_press_release(false, KEYPAD_NumLock_Clear);
usb_keyboard_send();
}