about summary refs log tree commit diff
path: root/pkgs/development/python-modules/greatfet/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/greatfet/default.nix')
-rw-r--r--pkgs/development/python-modules/greatfet/default.nix55
1 files changed, 39 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/greatfet/default.nix b/pkgs/development/python-modules/greatfet/default.nix
index 54869f592d660..9383ec903700c 100644
--- a/pkgs/development/python-modules/greatfet/default.nix
+++ b/pkgs/development/python-modules/greatfet/default.nix
@@ -1,46 +1,69 @@
 {
-  lib,
-  fetchFromGitHub,
   buildPythonPackage,
-  isPy3k,
+  cmsis-svd,
+  fetchFromGitHub,
   future,
-  pyusb,
   ipython,
+  lib,
+  prompt-toolkit,
+  pyfwup,
   pygreat,
+  pythonOlder,
+  pyusb,
+  setuptools,
+  tabulate,
+  tqdm,
 }:
 
 buildPythonPackage rec {
   pname = "greatfet";
-  version = "2019.5.1.dev0";
+  version = "2024.0.1";
+  pyproject = true;
+
+  disabled = pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "greatscottgadgets";
     repo = "greatfet";
-    rev = "v${version}";
-    sha256 = "054vkx4xkbhxhh5grjbs9kw3pjkv1zapp91ysrqr0c8mg1pc7zxv";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-AKpaJZJTzMY3IQXLvVnLWh3IHeGp759z6tvaBl28BHQ=";
   };
 
-  disabled = !isPy3k;
+  sourceRoot = "${src.name}/host";
 
-  propagatedBuildInputs = [
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace-fail ', "setuptools-git-versioning<2"' "" \
+      --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
+  '';
+
+  build-system = [ setuptools ];
+
+  dependencies = [
+    cmsis-svd
     future
-    pyusb
     ipython
+    prompt-toolkit
+    pyfwup
     pygreat
+    pyusb
+    tabulate
+    tqdm
   ];
 
+  # Tests seem to require devices (or simulators) which are
+  # not available in the build sandbox.
   doCheck = false;
 
-  preBuild = ''
-    cd host
-    echo "$version" > ../VERSION
-  '';
-
   meta = {
     description = "Hardware hacking with the greatfet";
     homepage = "https://greatscottgadgets.com/greatfet";
     license = lib.licenses.bsd3;
     platforms = lib.platforms.all;
-    maintainers = with lib.maintainers; [ mog ];
+    mainProgram = "gf";
+    maintainers = with lib.maintainers; [
+      mog
+      msanft
+    ];
   };
 }