Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 fetchgit, 3 gitUpdater, 4 lib, 5 libftdi1, 6 libgpiod, 7 libjaylink, 8 libusb1, 9 meson, 10 ninja, 11 pciutils, 12 pkg-config, 13 stdenv, 14 withJlink ? true, 15 withGpio ? stdenv.hostPlatform.isLinux, 16}: 17 18stdenv.mkDerivation (finalAttrs: { 19 pname = "flashprog"; 20 version = "1.4"; 21 22 src = fetchgit { 23 url = "https://review.sourcearcade.org/flashprog"; 24 tag = "v${finalAttrs.version}"; 25 hash = "sha256-mpSmPZ306DedRi3Dcck/cDqoumgwFYpljiJtma+LZz4="; 26 }; 27 28 nativeBuildInputs = [ 29 meson 30 ninja 31 pkg-config 32 ]; 33 34 buildInputs = [ 35 libftdi1 36 libusb1 37 ] 38 ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ 39 pciutils 40 ] 41 ++ lib.optionals (withJlink) [ 42 libjaylink 43 ] 44 ++ lib.optionals (withGpio) [ 45 libgpiod 46 ]; 47 48 postPatch = '' 49 # Remove these rules from flashprog to avoid conflicts with libftdi 50 sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001"/d' "util/50-flashprog.rules" 51 sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010"/d' "util/50-flashprog.rules" 52 sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011"/d' "util/50-flashprog.rules" 53 sed -i"" '/ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014"/d' "util/50-flashprog.rules" 54 ''; 55 56 postInstall = '' 57 install -Dm644 ../util/50-flashprog.rules "$out/lib/udev/rules.d/50-flashprog.rules" 58 ''; 59 60 doInstallCheck = true; 61 62 passthru.updateScript = gitUpdater { 63 rev-prefix = "v"; 64 allowedVersions = "^[0-9\\.]+$"; 65 }; 66 67 meta = with lib; { 68 homepage = "https://flashprog.org"; 69 description = "Utility for reading, writing, erasing and verifying flash ROM chips"; 70 changelog = "https://flashprog.org/wiki/Flashprog/v${finalAttrs.version}"; 71 license = with licenses; [ gpl2 ]; 72 maintainers = with maintainers; [ 73 felixsinger 74 funkeleinhorn 75 ]; 76 platforms = platforms.all; 77 mainProgram = "flashprog"; 78 }; 79})