mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 06:14:06 +02:00
init flake
This commit is contained in:
commit
a6d41bbaa3
17 changed files with 623 additions and 0 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
||||||
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
target
|
||||||
|
.direnv
|
||||||
|
.env
|
||||||
|
result*
|
||||||
60
flake.lock
generated
Normal file
60
flake.lock
generated
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1720458735,
|
||||||
|
"narHash": "sha256-riK9sNXfKMZNV4K8Wdh/2FoMDwgPmZe2Fcq2L6Jnz1Y=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "2539810c5b504974830c8b940a912e73faf1ac85",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "release-24.05",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"utils": "utils"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1710146030,
|
||||||
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
31
flake.nix
Normal file
31
flake.nix
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
utils.url = "github:numtide/flake-utils";
|
||||||
|
nixpkgs.url = "nixpkgs/release-24.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
utils,
|
||||||
|
}:
|
||||||
|
utils.lib.eachDefaultSystem (system: let
|
||||||
|
overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
pkgs = (import nixpkgs) {
|
||||||
|
inherit system overlays;
|
||||||
|
};
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
in rec {
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
|
||||||
|
};
|
||||||
|
packages = {
|
||||||
|
inherit (pkgs) packetry cynthion cynthion-udev;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
// {
|
||||||
|
overlays.default = import ./overlay.nix;
|
||||||
|
};
|
||||||
|
}
|
||||||
8
overlay.nix
Normal file
8
overlay.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
final: prev: {
|
||||||
|
packetry = final.callPackage ./pkgs/packetry {};
|
||||||
|
python-cynthion = final.python3.override {
|
||||||
|
packageOverrides = import ./pkgs/python;
|
||||||
|
};
|
||||||
|
cynthion = final.python-cynthion.pkgs.callPackage ./pkgs/cynthion {};
|
||||||
|
cynthion-udev = final.python-cynthion.pkgs.callPackage ./pkgs/cynthion/udev.nix {};
|
||||||
|
}
|
||||||
91
pkgs/cynthion/default.nix
Normal file
91
pkgs/cynthion/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
python3Packages,
|
||||||
|
pkgs,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
libusb1,
|
||||||
|
pyusb,
|
||||||
|
tomli,
|
||||||
|
future,
|
||||||
|
prompt-toolkit,
|
||||||
|
tabulate,
|
||||||
|
tqdm,
|
||||||
|
pyserial,
|
||||||
|
amaranth-041,
|
||||||
|
luna-usb,
|
||||||
|
luna-soc,
|
||||||
|
apollo-fpga,
|
||||||
|
pyfwup,
|
||||||
|
pygreat-2024,
|
||||||
|
zsh,
|
||||||
|
yosys,
|
||||||
|
nextpnr,
|
||||||
|
trellis,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "cynthion";
|
||||||
|
version = "0.1.0";
|
||||||
|
|
||||||
|
outputs = ["out" "udev"];
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = import ./src.nix fetchFromGitHub;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
zsh
|
||||||
|
yosys
|
||||||
|
nextpnr
|
||||||
|
trellis
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
libusb1
|
||||||
|
pyusb
|
||||||
|
tomli
|
||||||
|
future
|
||||||
|
prompt-toolkit
|
||||||
|
tabulate
|
||||||
|
tqdm
|
||||||
|
pyserial
|
||||||
|
amaranth-041
|
||||||
|
luna-usb
|
||||||
|
luna-soc
|
||||||
|
apollo-fpga
|
||||||
|
pyfwup
|
||||||
|
pygreat-2024
|
||||||
|
trellis
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace cynthion/python/Makefile \
|
||||||
|
--replace-fail 'SHELL := /bin/zsh' "SHELL := ${zsh}/bin/zsh"
|
||||||
|
substituteInPlace cynthion/python/src/commands/util.py \
|
||||||
|
--replace-fail "module_path, '../../assets/'" "\"$out/share/assets/\""
|
||||||
|
'';
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
cd cynthion/python
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mkdir -p $udev/lib/udev/rules.d
|
||||||
|
cp assets/54-cynthion.rules $udev/lib/udev/rules.d/54-cynthion.rules
|
||||||
|
|
||||||
|
make bitstreams
|
||||||
|
mkdir -p $out/share
|
||||||
|
ls -l
|
||||||
|
cp -r assets $out/share
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Cynthion is an all-in-one tool for building, testing, monitoring, and experimenting with USB device";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/cynthion";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
6
pkgs/cynthion/src.nix
Normal file
6
pkgs/cynthion/src.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
fetchFromGitHub: fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "cynthion";
|
||||||
|
rev = "db0fb8ecfee1c153219f029c0db627c6805e3d59";
|
||||||
|
hash = "sha256-BrxoRJ8bKBTENJgbYpi/fEHdCYThJEzKftH2Xo3u/3U=";
|
||||||
|
}
|
||||||
18
pkgs/cynthion/udev.nix
Normal file
18
pkgs/cynthion/udev.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenvNoCC,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "cynthion-udev";
|
||||||
|
version = "0.1.0";
|
||||||
|
dontBuild = true;
|
||||||
|
dontFixup = true;
|
||||||
|
|
||||||
|
src = import ./src.nix fetchFromGitHub;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/lib/udev/rules.d
|
||||||
|
cp cynthion/python/assets/54-cynthion.rules $out/lib/udev/rules.d/54-cynthion.rules
|
||||||
|
'';
|
||||||
|
}
|
||||||
45
pkgs/packetry/default.nix
Normal file
45
pkgs/packetry/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
rustPlatform,
|
||||||
|
pkg-config,
|
||||||
|
glib,
|
||||||
|
graphene,
|
||||||
|
gdk-pixbuf,
|
||||||
|
gtk4,
|
||||||
|
wrapGAppsHook,
|
||||||
|
}:
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
version = "0.1.0";
|
||||||
|
pname = "packetry";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "packetry";
|
||||||
|
rev = "7af5d7fd5c3cefe0291ea8eadcec5200dc6362d0";
|
||||||
|
hash = "sha256-jGCSI7aI5HenF5s2SKarABHQyCaRSag9jqnihT1WvGM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
cargoSha256 = "sha256-h9fFP5VGjYKt42oN/VSghfKPco+1DEh+W3fktYO8RVY=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
wrapGAppsHook
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
glib
|
||||||
|
graphene
|
||||||
|
gdk-pixbuf
|
||||||
|
gtk4
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A fast, intuitive USB 2.0 protocol analysis application for use with Cynthion.";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/packetry/";
|
||||||
|
license = licenses.bsd3;
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
}
|
||||||
59
pkgs/python/amaranth.nix
Normal file
59
pkgs/python/amaranth.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
pythonOlder,
|
||||||
|
fetchFromGitHub,
|
||||||
|
pdm-backend,
|
||||||
|
pyvcd,
|
||||||
|
jinja2,
|
||||||
|
importlib-resources,
|
||||||
|
importlib-metadata,
|
||||||
|
git,
|
||||||
|
# for tests
|
||||||
|
pytestCheckHook,
|
||||||
|
symbiyosys,
|
||||||
|
yices,
|
||||||
|
yosys,
|
||||||
|
}:
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "amaranth-041";
|
||||||
|
format = "pyproject";
|
||||||
|
version = "0.4.1";
|
||||||
|
disabled = pythonOlder "3.8";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "amaranth-lang";
|
||||||
|
repo = "amaranth";
|
||||||
|
rev = "refs/tags/v${version}";
|
||||||
|
hash = "sha256-VMgycvxkphdpWIib7aZwh588En145RgYlG2Zfi6nnDo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
git
|
||||||
|
pdm-backend
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs =
|
||||||
|
[
|
||||||
|
jinja2
|
||||||
|
pyvcd
|
||||||
|
]
|
||||||
|
++ lib.optional (pythonOlder "3.9") importlib-resources
|
||||||
|
++ lib.optional (pythonOlder "3.8") importlib-metadata;
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
pytestCheckHook
|
||||||
|
symbiyosys
|
||||||
|
yices
|
||||||
|
yosys
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = ["amaranth"];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A modern hardware definition language and toolchain based on Python";
|
||||||
|
homepage = "https://amaranth-lang.org/docs/amaranth";
|
||||||
|
license = licenses.bsd2;
|
||||||
|
maintainers = with maintainers; [emily thoughtpolice pbsds];
|
||||||
|
};
|
||||||
|
}
|
||||||
54
pkgs/python/apollo-fpga.nix
Normal file
54
pkgs/python/apollo-fpga.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
python3Packages,
|
||||||
|
pkgs,
|
||||||
|
amaranth-041,
|
||||||
|
luna-usb,
|
||||||
|
pyusb,
|
||||||
|
pyvcd,
|
||||||
|
prompt-toolkit,
|
||||||
|
pyxdg,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "apollo-fpga";
|
||||||
|
version = "1.0.6";
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "apollo";
|
||||||
|
rev = "3a0e3a214eb1e6a9434b8e0bf15bcf7cf54f8242";
|
||||||
|
hash = "sha256-t3XtBzinMysIBgONPIGLqFXpzBaCqMfY3sufjtRc7Io=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
amaranth-041
|
||||||
|
luna-usb
|
||||||
|
pyusb
|
||||||
|
pyvcd
|
||||||
|
prompt-toolkit
|
||||||
|
pyxdg
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Amaranth HDL framework for monitoring, hacking, and developing USB devices";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/luna";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
9
pkgs/python/default.nix
Normal file
9
pkgs/python/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
py-final: _py-prev: {
|
||||||
|
amaranth-041 = py-final.callPackage ./amaranth.nix {};
|
||||||
|
luna-usb = py-final.callPackage ./luna-usb.nix {};
|
||||||
|
luna-soc = py-final.callPackage ./luna-soc.nix {};
|
||||||
|
apollo-fpga = py-final.callPackage ./apollo-fpga.nix {};
|
||||||
|
pyfwup = py-final.callPackage ./pyfwup.nix {};
|
||||||
|
pygreat-2024 = py-final.callPackage ./pygreat.nix {};
|
||||||
|
usb-protocol = py-final.callPackage ./usb-protocol.nix {};
|
||||||
|
}
|
||||||
44
pkgs/python/luna-soc.nix
Normal file
44
pkgs/python/luna-soc.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
python3Packages,
|
||||||
|
pkgs,
|
||||||
|
luna-usb,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "luna-soc";
|
||||||
|
version = "0.2.0";
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "luna-soc";
|
||||||
|
rev = "0.2.0";
|
||||||
|
hash = "sha256-P8P32hM1cVXENcDpCrmPe8BvkMCWdeEgHwbIU94uLe8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
luna-usb
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Amaranth HDL framework for monitoring, hacking, and developing USB devices";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/luna";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
52
pkgs/python/luna-usb.nix
Normal file
52
pkgs/python/luna-usb.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
pyvcd,
|
||||||
|
pyusb,
|
||||||
|
libusb1,
|
||||||
|
pyserial,
|
||||||
|
amaranth-041,
|
||||||
|
usb-protocol,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "luna-usb";
|
||||||
|
version = "0.1.1";
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "luna";
|
||||||
|
rev = "0.1.1";
|
||||||
|
hash = "sha256-81GJF3QLERCmvZXYlQvb1vzJFeGMSMNMwuGoaBJE8Zg=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
pyusb
|
||||||
|
libusb1
|
||||||
|
pyserial
|
||||||
|
amaranth-041
|
||||||
|
pyvcd
|
||||||
|
usb-protocol
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Amaranth HDL framework for monitoring, hacking, and developing USB devices";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/luna";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
45
pkgs/python/pyfwup.nix
Normal file
45
pkgs/python/pyfwup.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
python3Packages,
|
||||||
|
pyusb,
|
||||||
|
tqdm,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "pyfwup";
|
||||||
|
version = "0.4.0";
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "pyfwup";
|
||||||
|
rev = "0.4.0";
|
||||||
|
hash = "sha256-JSaAEGobdLqpSj9yvKrAsXfdkHpXSCcuGYRxz2QJqck=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
pyusb
|
||||||
|
tqdm
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "python library providing utilities, data structures, constants, parsers, and tools for working with USB data";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/python-usb-protocol";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
54
pkgs/python/pygreat.nix
Normal file
54
pkgs/python/pygreat.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
isPy3k,
|
||||||
|
fetchFromGitHub,
|
||||||
|
future,
|
||||||
|
pyusb,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
}:
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "pygreat-2024";
|
||||||
|
version = "v2024.0.1";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "libgreat";
|
||||||
|
rev = "v2024.0.1";
|
||||||
|
hash = "sha256-k+0dGBohKglQEFN13mGsw0C6pCeQDRp+CwPW2GuKfuY=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
future
|
||||||
|
pyusb
|
||||||
|
];
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace host/pyproject.toml \
|
||||||
|
--replace-fail '"backports.functools_lru_cache",' "" \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
disabled = !isPy3k;
|
||||||
|
|
||||||
|
preBuild = ''
|
||||||
|
cd host
|
||||||
|
substituteInPlace setup.py --replace "'backports.functools_lru_cache'" ""
|
||||||
|
substituteInPlace pygreat/comms.py --replace "from backports.functools_lru_cache import lru_cache as memoize_with_lru_cache" "from functools import lru_cache as memoize_with_lru_cache"
|
||||||
|
echo "$version" > ../VERSION
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Python library for talking with libGreat devices";
|
||||||
|
homepage = "https://greatscottgadgets.com/greatfet/";
|
||||||
|
license = with licenses; [bsd3];
|
||||||
|
};
|
||||||
|
}
|
||||||
42
pkgs/python/usb-protocol.nix
Normal file
42
pkgs/python/usb-protocol.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildPythonPackage,
|
||||||
|
construct,
|
||||||
|
setuptools,
|
||||||
|
setuptools-git-versioning,
|
||||||
|
}: let
|
||||||
|
in
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "usb-protocol";
|
||||||
|
version = "0.9.1";
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "greatscottgadgets";
|
||||||
|
repo = "python-usb-protocol";
|
||||||
|
rev = "0.9.1";
|
||||||
|
hash = "sha256-CYbXs/SRC1FAVEzfw0gwf6U0qQ9Q34nyuj5yfjHfDn8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
setuptools
|
||||||
|
setuptools-git-versioning
|
||||||
|
];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [
|
||||||
|
construct
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace pyproject.toml \
|
||||||
|
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "python library providing utilities, data structures, constants, parsers, and tools for working with USB data";
|
||||||
|
homepage = "https://github.com/greatscottgadgets/python-usb-protocol";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue