2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sdcc
|
|
|
|
, libusb1
|
|
|
|
, crcmod
|
|
|
|
}:
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "fx2";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "unstable-2023-09-20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "whitequark";
|
|
|
|
repo = "libfx2";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "73fa811818d56a86b82c12e07327946aeddd2b3e";
|
|
|
|
hash = "sha256-AGQPOVTdaUCUeVVNQTBmoNvz5CGxcBOK7+oL+X8AcIw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ sdcc ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libusb1 crcmod ];
|
|
|
|
|
|
|
|
preBuild = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
make -C firmware
|
2020-04-24 23:36:52 +00:00
|
|
|
cd software
|
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/share/libfx2
|
|
|
|
cp -R ../firmware/library/{.stamp,lib,include,fx2{rules,conf}.mk} \
|
|
|
|
$out/share/libfx2
|
|
|
|
'';
|
|
|
|
|
|
|
|
# installCheckPhase tries to run build_ext again and there are no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Chip support package for Cypress EZ-USB FX2 series microcontrollers";
|
|
|
|
homepage = "https://github.com/whitequark/libfx2";
|
|
|
|
license = licenses.bsd0;
|
|
|
|
maintainers = with maintainers; [ emily ];
|
|
|
|
};
|
|
|
|
}
|