Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at r-updates 63 lines 1.3 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 setuptools, 6 wheel, 7 qt5, 8 python, 9 dill, 10 matplotlib, 11 networkx, 12 numpy, 13 pandas, 14 pillow, 15 pyqt5, 16 scipy, 17 tqdm, 18}: 19buildPythonPackage rec { 20 pname = "uxsim"; 21 version = "1.8.2"; 22 pyproject = true; 23 24 src = fetchFromGitHub { 25 owner = "toruseo"; 26 repo = "UXsim"; 27 tag = "v${version}"; 28 hash = "sha256-aHJ2AAoSm+5viEieAHzhU0EDyS+VQrMWlhm0CkV7/s4="; 29 }; 30 31 patches = [ ./add-qt-plugin-path-to-env.patch ]; 32 33 build-system = [ setuptools ]; 34 35 dependencies = [ 36 dill 37 matplotlib 38 networkx 39 numpy 40 pandas 41 pillow 42 pyqt5 43 scipy 44 tqdm 45 ]; 46 47 pythonImportsCheck = [ "uxsim" ]; 48 49 # QT_PLUGIN_PATH is required to be set for the program to produce its images 50 # our patch sets it to $NIX_QT_PLUGIN_PATH if QT_PLUGIN_PATH is not set 51 # and here we replace this string with the actual path to qt plugins 52 postInstall = '' 53 substituteInPlace $out/${python.sitePackages}/uxsim/__init__.py \ 54 --replace-fail '$NIX_QT_PLUGIN_PATH' '${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}' 55 ''; 56 57 meta = with lib; { 58 description = "Vehicular traffic flow simulator in road network, written in pure Python"; 59 homepage = "https://github.com/toruseo/UXsim"; 60 license = licenses.mit; 61 maintainers = with maintainers; [ vinnymeller ]; 62 }; 63}