From dbdf14da0eaf0393813daab4ba26f48ed9c61e07 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:17:12 +0100 Subject: [PATCH] python312Packages.cynthion: init at 0.1.7 --- .../python-modules/cynthion/default.nix | 86 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 88 insertions(+) create mode 100644 pkgs/development/python-modules/cynthion/default.nix diff --git a/pkgs/development/python-modules/cynthion/default.nix b/pkgs/development/python-modules/cynthion/default.nix new file mode 100644 index 00000000000000..2eb071e4dec6c4 --- /dev/null +++ b/pkgs/development/python-modules/cynthion/default.nix @@ -0,0 +1,86 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + amaranth, + apollo-fpga, + future, + libusb1, + luna-soc, + luna-usb, + prompt-toolkit, + pyfwup, + pygreat, + pyserial, + pyusb, + tabulate, + tomli, + tqdm, + + # tests + pytestCheckHook, +}: +buildPythonPackage rec { + pname = "cynthion"; + version = "0.1.7"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "cynthion"; + rev = "refs/tags/${version}"; + hash = "sha256-2nVfODAg4t5hoSKUEP4IN23R+JGe3lw/rpfjW/UIsYw="; + }; + + sourceRoot = "${src.name}/cynthion/python"; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + amaranth + apollo-fpga + future + libusb1 + luna-soc + luna-usb + prompt-toolkit + pyfwup + pygreat + pyserial + pyusb + tabulate + tomli + tqdm + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "cynthion" ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/cynthion/releases/tag/${version}"; + description = "Python package and utilities for the Great Scott Gadgets Cynthion USB Test Instrument"; + homepage = "https://github.com/greatscottgadgets/cynthion"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + broken = lib.versionAtLeast amaranth.version "0.5"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 40f4f6b9c0773b..528783d53e4180 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2826,6 +2826,8 @@ self: super: with self; { cymruwhois = callPackage ../development/python-modules/cymruwhois { }; + cynthion = callPackage ../development/python-modules/cynthion { }; + cypari2 = callPackage ../development/python-modules/cypari2 { }; cypherpunkpay = callPackage ../development/python-modules/cypherpunkpay { };