From e0f9d1953abf7648eeb37d989e1ea94211a1e0f7 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:11:54 +0100 Subject: [PATCH 1/6] python312Packages.usb-protocol: init at 0.9.1 --- .../python-modules/usb-protocol/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/usb-protocol/default.nix diff --git a/pkgs/development/python-modules/usb-protocol/default.nix b/pkgs/development/python-modules/usb-protocol/default.nix new file mode 100644 index 000000000000..fa21782fc1cc --- /dev/null +++ b/pkgs/development/python-modules/usb-protocol/default.nix @@ -0,0 +1,57 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + construct, + + # tests + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "usb-protocol"; + version = "0.9.1"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "python-usb-protocol"; + rev = "refs/tags/${version}"; + hash = "sha256-CYbXs/SRC1FAVEzfw0gwf6U0qQ9Q34nyuj5yfjHfDn8="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ construct ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "usb_protocol" + ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/python-usb-protocol/releases/tag/${version}"; + description = "Python library providing utilities, data structures, constants, parsers, and tools for working with the USB protocol"; + homepage = "https://github.com/greatscottgadgets/python-usb-protocol"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5aae1adaa87e..01f963d45cbc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -17308,6 +17308,8 @@ self: super: with self; { usb-monitor = callPackage ../development/python-modules/usb-monitor { }; + usb-protocol = callPackage ../development/python-modules/usb-protocol { }; + usbrelay-py = callPackage ../os-specific/linux/usbrelay/python.nix { }; usbtmc = callPackage ../development/python-modules/usbtmc { }; From de6f807a09eec88ac89861d66fc924aa94862a7a Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:13:55 +0100 Subject: [PATCH 2/6] python312Packages.apollo-fpga: init at 1.1.0 --- .../python-modules/apollo-fpga/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/apollo-fpga/default.nix diff --git a/pkgs/development/python-modules/apollo-fpga/default.nix b/pkgs/development/python-modules/apollo-fpga/default.nix new file mode 100644 index 000000000000..44a0a5a144d0 --- /dev/null +++ b/pkgs/development/python-modules/apollo-fpga/default.nix @@ -0,0 +1,63 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + deprecation, + prompt-toolkit, + pyusb, + pyvcd, + pyxdg, +}: + +buildPythonPackage rec { + pname = "apollo-fpga"; + version = "1.1.0"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "apollo"; + rev = "refs/tags/v${version}"; + hash = "sha256-9BoHGdqjnWkP83zXdjzyoAhYB6n7SJ/zlr8pvqb+9kg="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + deprecation + prompt-toolkit + pyusb + pyvcd + pyxdg + ]; + + # has no tests + doCheck = false; + + pythonImportsCheck = [ + "apollo_fpga" + ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/apollo/releases/tag/v${version}"; + description = "microcontroller-based FPGA / JTAG programmer"; + homepage = "https://github.com/greatscottgadgets/apollo"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 01f963d45cbc..3bfa283153cb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -698,6 +698,8 @@ self: super: with self; { aplpy = callPackage ../development/python-modules/aplpy { }; + apollo-fpga = callPackage ../development/python-modules/apollo-fpga { }; + app-model = callPackage ../development/python-modules/app-model { }; appdirs = callPackage ../development/python-modules/appdirs { }; From 393495aa442c8712876096a2ba5595b64f196802 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:15:23 +0100 Subject: [PATCH 3/6] python312Packages.luna-usb: init at 0.1.2 --- .../python-modules/luna-usb/default.nix | 75 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 77 insertions(+) create mode 100644 pkgs/development/python-modules/luna-usb/default.nix diff --git a/pkgs/development/python-modules/luna-usb/default.nix b/pkgs/development/python-modules/luna-usb/default.nix new file mode 100644 index 000000000000..e5a7b44cd275 --- /dev/null +++ b/pkgs/development/python-modules/luna-usb/default.nix @@ -0,0 +1,75 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + amaranth, + libusb1, + pyserial, + pyusb, + pyvcd, + usb-protocol, + + # tests + pytestCheckHook, + apollo-fpga, +}: +buildPythonPackage rec { + pname = "luna-usb"; + version = "0.1.2"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "luna"; + rev = "refs/tags/${version}"; + hash = "sha256-T9V0rI6vcEpM3kN/duRni6v2plCU4B379Zx07dBGKjk="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + amaranth + libusb1 + pyserial + pyusb + pyvcd + usb-protocol + ]; + + nativeCheckInputs = [ + pytestCheckHook + apollo-fpga + ]; + + pytestFlagsArray = [ + "tests/" + ]; + + pythonImportsCheck = [ + "luna" + ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/luna/releases/tag/${version}"; + description = "Amaranth HDL framework for monitoring, hacking, and developing USB devices"; + homepage = "https://github.com/greatscottgadgets/luna"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + broken = lib.versionAtLeast amaranth.version "0.5"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3bfa283153cb..6213343f5258 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7610,6 +7610,8 @@ self: super: with self; { lunarcalendar = callPackage ../development/python-modules/lunarcalendar { }; + luna-usb = callPackage ../development/python-modules/luna-usb { }; + luqum = callPackage ../development/python-modules/luqum { }; luxor = callPackage ../development/python-modules/luxor { }; From ded0edc6d918e711fcf131e3bc646e51a6ba98af Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:16:20 +0100 Subject: [PATCH 4/6] python312Packages.luna-soc: init at 0.2.0 --- .../python-modules/luna-soc/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/luna-soc/default.nix diff --git a/pkgs/development/python-modules/luna-soc/default.nix b/pkgs/development/python-modules/luna-soc/default.nix new file mode 100644 index 000000000000..277dabe0e89e --- /dev/null +++ b/pkgs/development/python-modules/luna-soc/default.nix @@ -0,0 +1,53 @@ +{ + lib, + fetchFromGitHub, + buildPythonPackage, + pythonOlder, + + # build-system + setuptools, + + # dependencies + luna-usb, +}: + +buildPythonPackage rec { + pname = "luna-soc"; + version = "0.2.0"; + pyproject = true; + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "greatscottgadgets"; + repo = "luna-soc"; + rev = "refs/tags/${version}"; + hash = "sha256-P8P32hM1cVXENcDpCrmPe8BvkMCWdeEgHwbIU94uLe8="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools-git-versioning<2"' "" \ + --replace-fail 'dynamic = ["version"]' 'version = "${version}"' + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ luna-usb ]; + + # has no tests + doCheck = false; + + pythonImportsCheck = [ + "luna_soc" + ]; + + meta = { + changelog = "https://github.com/greatscottgadgets/luna-soc/releases/tag/${version}"; + description = "Amaranth HDL library for building USB-capable SoC designs"; + homepage = "https://github.com/greatscottgadgets/luna-soc"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ carlossless ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6213343f5258..40f4f6b9c077 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7610,6 +7610,8 @@ self: super: with self; { lunarcalendar = callPackage ../development/python-modules/lunarcalendar { }; + luna-soc = callPackage ../development/python-modules/luna-soc { }; + luna-usb = callPackage ../development/python-modules/luna-usb { }; luqum = callPackage ../development/python-modules/luqum { }; From 93b0565dd2230219f71b191334d5765ebc182680 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:17:12 +0100 Subject: [PATCH 5/6] python312Packages.cynthion: init at 0.1.7 --- .../python-modules/cynthion/default.nix | 85 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 87 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 000000000000..a3a4d9dde001 --- /dev/null +++ b/pkgs/development/python-modules/cynthion/default.nix @@ -0,0 +1,85 @@ +{ + 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 ]; + broken = lib.versionAtLeast amaranth.version "0.5"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 40f4f6b9c077..528783d53e41 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 { }; From 57fb63c9314cf30e4c2b0abe5b0096fd73364007 Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Wed, 13 Nov 2024 09:17:27 +0100 Subject: [PATCH 6/6] cynthion: init at 0.1.7 --- pkgs/by-name/cy/cynthion/package.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pkgs/by-name/cy/cynthion/package.nix diff --git a/pkgs/by-name/cy/cynthion/package.nix b/pkgs/by-name/cy/cynthion/package.nix new file mode 100644 index 000000000000..70c767cf8ef7 --- /dev/null +++ b/pkgs/by-name/cy/cynthion/package.nix @@ -0,0 +1,26 @@ +{ + python3, + fetchFromGitHub, +}: + +let + python = python3.override { + self = python3; + packageOverrides = _: super: { + amaranth = super.amaranth.overridePythonAttrs rec { + version = "0.4.1"; + + src = fetchFromGitHub { + owner = "amaranth-lang"; + repo = "amaranth"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-VMgycvxkphdpWIib7aZwh588En145RgYlG2Zfi6nnDo="; + }; + + postPatch = null; + }; + }; + }; +in + +python.pkgs.toPythonApplication python.pkgs.cynthion