2019-08-30 21:45:56 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, python
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sdcc
|
|
|
|
, libusb1
|
|
|
|
, crcmod
|
|
|
|
}:
|
|
|
|
|
2020-07-08 00:02:09 +01:00
|
|
|
buildPythonPackage rec {
|
2019-08-30 21:45:56 +01:00
|
|
|
pname = "fx2";
|
2020-07-08 00:02:09 +01:00
|
|
|
version = "0.9";
|
2019-08-30 21:45:56 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "whitequark";
|
|
|
|
repo = "libfx2";
|
2020-07-08 00:02:09 +01:00
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-Uk+K7ym92JX4fC3PyTNxd0UvBzoNZmtbscBYjSWChuk=";
|
2019-08-30 21:45:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ sdcc ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libusb1 crcmod ];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd software
|
|
|
|
${python.pythonForBuild.interpreter} setup.py build_ext
|
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/whitequark/libfx2";
|
2019-08-30 21:45:56 +01:00
|
|
|
license = licenses.bsd0;
|
|
|
|
maintainers = with maintainers; [ emily ];
|
|
|
|
};
|
|
|
|
}
|