Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 python, 5 fetchFromGitHub, 6 sdcc, 7 libusb1, 8 setuptools-scm, 9 crcmod, 10}: 11 12buildPythonPackage rec { 13 pname = "fx2"; 14 version = "0.13"; 15 format = "setuptools"; 16 17 src = fetchFromGitHub { 18 owner = "whitequark"; 19 repo = "libfx2"; 20 rev = "v${version}"; 21 hash = "sha256-PtWxjT+97+EeNMN36zOT1+ost/w3lRRkaON3Cl3dpp4="; 22 }; 23 24 nativeBuildInputs = [ 25 setuptools-scm 26 sdcc 27 ]; 28 29 propagatedBuildInputs = [ 30 libusb1 31 crcmod 32 ]; 33 34 preBuild = '' 35 make -C firmware 36 cd software 37 ''; 38 39 preInstall = '' 40 mkdir -p $out/share/libfx2 41 cp -R ../firmware/library/{.stamp,lib,include,fx2{rules,conf}.mk} \ 42 $out/share/libfx2 43 ''; 44 45 # installCheckPhase tries to run build_ext again and there are no tests 46 doCheck = false; 47 48 meta = with lib; { 49 description = "Chip support package for Cypress EZ-USB FX2 series microcontrollers"; 50 mainProgram = "fx2tool"; 51 homepage = "https://github.com/whitequark/libfx2"; 52 license = licenses.bsd0; 53 maintainers = [ ]; 54 }; 55}