From bcf4907be26def12f2eabb2a54311565d20adf2d Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 11 May 2021 12:56:52 +1200 Subject: [PATCH 1/2] Add override for hid See https://github.com/qmk/qmk_firmware/pull/12855 --- overrides.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/overrides.nix b/overrides.nix index 2d9ccf8..eb30456 100644 --- a/overrides.nix +++ b/overrides.nix @@ -369,6 +369,22 @@ self: super: ) else old ); + hid = super.hid.overridePythonAttrs ( + old: { + postPatch = '' + found= + for name in libhidapi-hidraw libhidapi-libusb libhidapi-iohidmanager libhidapi; do + full_path=${pkgs.hidapi.out}/lib/$name${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} + if test -f $full_path; then + found=t + sed -i -e "s|'$name\..*'|'$full_path'|" hid/__init__.py + fi + done + test -n "$found" || { echo "ERROR: No known libraries found in ${pkgs.hidapi.out}/lib, please update/fix this build expression."; exit 1; } + ''; + } + ); + horovod = super.horovod.overridePythonAttrs ( old: { propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ]; From e01a46c563dd70bf279f687015ec826b8bfea765 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Tue, 11 May 2021 12:57:26 +1200 Subject: [PATCH 2/2] Add override for pyusb See https://github.com/qmk/qmk_firmware/pull/12855 --- overrides.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/overrides.nix b/overrides.nix index eb30456..405f110 100644 --- a/overrides.nix +++ b/overrides.nix @@ -1302,6 +1302,16 @@ self: super: } ); + pyusb = super.pyusb.overridePythonAttrs ( + old: { + postPatch = '' + libusb=${pkgs.libusb1.out}/lib/libusb-1.0${pkgs.stdenv.hostPlatform.extensions.sharedLibrary} + test -f $libusb || { echo "ERROR: $libusb doesn't exist, please update/fix this build expression."; exit 1; } + sed -i -e "s|find_library=None|find_library=lambda _:\"$libusb\"|" usb/backend/libusb1.py + ''; + } + ); + pyzmq = super.pyzmq.overridePythonAttrs ( old: { nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ];