default.nix (991B)
1 { lib, python3Packages, fetchFromGitHub, modbus_tk }: 2 3 python3Packages.buildPythonApplication rec { 4 pname = "modbus_sim_cli"; 5 version = "0-unstable-2019-02-27"; 6 7 src = fetchFromGitHub { 8 owner = "dhoomakethu"; 9 repo = "modbus_sim_cli"; 10 rev = "080d773b7009fa9aa727097d2b2f8049b3f35290"; 11 hash = "sha256-ijW462q+xhw2I7ZXBhALq3xcSIUi/uEWrva+TCxkKzA="; 12 }; 13 14 postPatch = '' 15 sed -i 's/==.*//;/trollius/d' requirements 16 substituteInPlace modbus_sim/utils/config_parser.py \ 17 --replace-fail "yaml.load(conffile.read())" "yaml.safe_load(conffile)" 18 ''; 19 20 propagatedBuildInputs = with python3Packages; [ 21 coloredlogs 22 modbus_tk 23 pyyaml 24 ]; 25 26 preConfigure = '' 27 find modbus_sim -name "*.py" | xargs 2to3 -w 28 ''; 29 30 preBuild = '' 31 export HOME=$TMPDIR 32 ''; 33 34 meta = with lib; { 35 description = "Modbus simulation command line version"; 36 inherit (src.meta) homepage; 37 license = licenses.mit; 38 maintainers = [ maintainers.sikmir ]; 39 }; 40 }