Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cynthion: init at 0.1.7 #353392

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkgs/by-name/cy/cynthion/package.nix
Original file line number Diff line number Diff line change
@@ -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
63 changes: 63 additions & 0 deletions pkgs/development/python-modules/apollo-fpga/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
85 changes: 85 additions & 0 deletions pkgs/development/python-modules/cynthion/default.nix
Original file line number Diff line number Diff line change
@@ -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";
};
}
53 changes: 53 additions & 0 deletions pkgs/development/python-modules/luna-soc/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
75 changes: 75 additions & 0 deletions pkgs/development/python-modules/luna-usb/default.nix
Original file line number Diff line number Diff line change
@@ -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";
};
}
57 changes: 57 additions & 0 deletions pkgs/development/python-modules/usb-protocol/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
Loading