From d6461e376ff1bf9603f5377a5c01c979fd9ec1d4 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Sun, 7 Jun 2026 19:06:09 +0400 Subject: [PATCH 1/2] python313Packages.greatfet: 2025.0.0 -> 2026.0.0 Upstream dropped the `future` dependency in this release as part of removing the remaining Python 2-3 migration imports. Signed-off-by: Brian McGillion --- pkgs/development/python-modules/greatfet/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/greatfet/default.nix b/pkgs/development/python-modules/greatfet/default.nix index 7883daea7aa7..112b72a64a3e 100644 --- a/pkgs/development/python-modules/greatfet/default.nix +++ b/pkgs/development/python-modules/greatfet/default.nix @@ -2,7 +2,6 @@ buildPythonPackage, cmsis-svd, fetchFromGitHub, - future, ipython, lib, prompt-toolkit, @@ -16,14 +15,14 @@ buildPythonPackage rec { pname = "greatfet"; - version = "2025.0.0"; + version = "2026.0.0"; pyproject = true; src = fetchFromGitHub { owner = "greatscottgadgets"; repo = "greatfet"; tag = "v${version}"; - hash = "sha256-tY1ZUtjCeb0+EmmbzKbIcPQrjHc3JzgA/6yDuFwwHu4="; + hash = "sha256-qXPNatakMVtvl26FG1bx+ngCeqRpg1So6qFamKK8WWk="; }; sourceRoot = "${src.name}/host"; @@ -40,7 +39,6 @@ buildPythonPackage rec { dependencies = [ cmsis-svd - future ipython prompt-toolkit pyfwup From f0164823619de0acf55dc4bbfbcfe37f9df8c390 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Sun, 7 Jun 2026 22:11:43 +0400 Subject: [PATCH 2/2] greatfet_firmware: include fw from official pypi Include the latest cross-compiled firmware to match the host SW version. This allows to use the standard `greatfet_firmware --autoflash` command to perform the update. In addition it adds the DFU package for recovery of a corrupt system. Signed-off-by: Brian McGillion --- .../python-modules/greatfet/default.nix | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgs/development/python-modules/greatfet/default.nix b/pkgs/development/python-modules/greatfet/default.nix index 112b72a64a3e..226e9d40d756 100644 --- a/pkgs/development/python-modules/greatfet/default.nix +++ b/pkgs/development/python-modules/greatfet/default.nix @@ -2,6 +2,7 @@ buildPythonPackage, cmsis-svd, fetchFromGitHub, + fetchPypi, ipython, lib, prompt-toolkit, @@ -11,6 +12,7 @@ setuptools, tabulate, tqdm, + unzip, }: buildPythonPackage rec { @@ -25,12 +27,36 @@ buildPythonPackage rec { hash = "sha256-qXPNatakMVtvl26FG1bx+ngCeqRpg1So6qFamKK8WWk="; }; + # The prebuilt LPC firmware image (greatfet_usb.bin) and the DFU recovery + # stub (flash_stub.bin) are release artifacts cross-compiled from firmware/. + # They are absent from the git checkout (their build inputs are now-empty + # submodules) but are shipped in the upstream wheel. Without them + # `greatfet_firmware --autoflash` and DFU-mode firmware recovery are + # unavailable, so vendor them from the wheel to match `pip install greatfet`. + firmwareAssets = fetchPypi { + inherit pname version; + format = "wheel"; + dist = "py3"; + python = "py3"; + hash = "sha256-sH1FAkfdC0HxRLZjfx7b2AYWMh4rtSijFgsU/YnVKq0="; + }; + sourceRoot = "${src.name}/host"; + nativeBuildInputs = [ unzip ]; + postPatch = '' substituteInPlace pyproject.toml \ --replace-fail ', "setuptools-git-versioning<2"' "" \ --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + + # Restore the prebuilt firmware images shipped in the upstream wheel; the + # existing MANIFEST.in (recursive-include greatfet/assets *) then packages + # them into greatfet/assets/ where find_greatfet_asset() looks at runtime. + unzip -j -o ${firmwareAssets} \ + 'greatfet/assets/greatfet_usb.bin' \ + 'greatfet/assets/flash_stub.bin' \ + -d greatfet/assets/ ''; build-system = [ setuptools ];