package.nix (1178B)
1 { 2 lib, 3 python312Packages, 4 fetchFromGitHub, 5 writableTmpDirAsHomeHook, 6 }: 7 let 8 python3Packages = python312Packages; 9 in 10 python3Packages.buildPythonApplication { 11 pname = "modbus_sim_cli"; 12 version = "0-unstable-2019-02-27"; 13 pyproject = true; 14 15 src = fetchFromGitHub { 16 owner = "dhoomakethu"; 17 repo = "modbus_sim_cli"; 18 rev = "080d773b7009fa9aa727097d2b2f8049b3f35290"; 19 hash = "sha256-ijW462q+xhw2I7ZXBhALq3xcSIUi/uEWrva+TCxkKzA="; 20 }; 21 22 postPatch = '' 23 sed -i '/trollius/d' requirements 24 substituteInPlace modbus_sim/utils/config_parser.py \ 25 --replace-fail "yaml.load(conffile.read())" "yaml.safe_load(conffile)" 26 ''; 27 28 build-system = with python3Packages; [ setuptools ]; 29 30 nativeBuildInputs = [ writableTmpDirAsHomeHook ]; 31 32 dependencies = with python3Packages; [ 33 coloredlogs 34 modbus-tk 35 pyyaml 36 ]; 37 38 pythonRelaxDeps = true; 39 40 preConfigure = '' 41 find modbus_sim -name "*.py" | xargs 2to3 -w 42 ''; 43 44 meta = { 45 description = "Modbus simulation command line version"; 46 homepage = "https://github.com/dhoomakethu/modbus_sim_cli"; 47 license = lib.licenses.mit; 48 maintainers = [ lib.maintainers.sikmir ]; 49 }; 50 }
