lol

python3Packages.uxsim: 1.1.1 -> 1.3.0

+16 -34
+6 -19
pkgs/development/python-modules/uxsim/add-qt-plugin-path-to-env.patch
··· 1 diff --git a/uxsim/__init__.py b/uxsim/__init__.py 2 - index 01e1ad1..de1f0fd 100644 3 --- a/uxsim/__init__.py 4 +++ b/uxsim/__init__.py 5 - @@ -1,8 +1,14 @@ 6 - -from .uxsim import * 7 - -from .utils import * 8 +import os 9 - + 10 from .analyzer import * 11 - +from .utils import * 12 - +from .uxsim import * 13 - + 14 - +# Only set our own plugin path if it's not already set 15 - +if not os.getenv("QT_PLUGIN_PATH"): 16 - + os.environ["QT_PLUGIN_PATH"] = "$NIX_QT_PLUGIN_PATH" 17 - 18 - __version__ = "1.1.1" 19 - __author__ = "Toru Seo" 20 - __copyright__ = "Copyright (c) 2023 Toru Seo" 21 - -__license__ = "MIT License" 22 - \ No newline at end of file 23 - +__license__ = "MIT License" 24 -
··· 1 diff --git a/uxsim/__init__.py b/uxsim/__init__.py 2 + index cf661c5..540e6f8 100644 3 --- a/uxsim/__init__.py 4 +++ b/uxsim/__init__.py 5 + @@ -1,3 +1,6 @@ 6 +import os 7 + +if not os.getenv("QT_PLUGIN_PATH"): 8 + + os.environ["QT_PLUGIN_PATH"] = "$NIX_QT_PLUGIN_PATH" 9 + from .uxsim import * 10 + from .utils import * 11 from .analyzer import *
+10 -15
pkgs/development/python-modules/uxsim/default.nix
··· 5 setuptools, 6 wheel, 7 qt5, 8 - hackgen-font, 9 - python3, 10 matplotlib, 11 numpy, 12 pandas, ··· 17 }: 18 buildPythonPackage rec { 19 pname = "uxsim"; 20 - version = "1.1.1"; 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "toruseo"; 25 repo = "UXsim"; 26 - rev = "v${version}"; 27 - hash = "sha256-qPAFodvx+Z7RsRhzdTq1TRsbvrUFaqRJZxYg3FM6q8A="; 28 }; 29 30 - patches = [ 31 - ./add-qt-plugin-path-to-env.patch 32 - ]; 33 34 nativeBuildInputs = [ 35 setuptools ··· 37 ]; 38 39 propagatedBuildInputs = [ 40 matplotlib 41 numpy 42 pandas ··· 46 tqdm 47 ]; 48 49 - pythonImportsCheck = ["uxsim"]; 50 - 51 52 # QT_PLUGIN_PATH is required to be set for the program to produce its images 53 # our patch sets it to $NIX_QT_PLUGIN_PATH if QT_PLUGIN_PATH is not set 54 # and here we replace this string with the actual path to qt plugins 55 postInstall = '' 56 - substituteInPlace $out/${python3.sitePackages}/uxsim/__init__.py \ 57 --replace-fail '$NIX_QT_PLUGIN_PATH' '${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}' 58 - 59 - mkdir -p $out/${python3.sitePackages}/uxsim/files 60 - ln -s ${hackgen-font}/share/fonts/hackgen/HackGen-Regular.ttf $out/${python3.sitePackages}/uxsim/files/ 61 ''; 62 63 meta = with lib; { 64 description = "Vehicular traffic flow simulator in road network, written in pure Python"; 65 homepage = "https://github.com/toruseo/UXsim"; 66 license = licenses.mit; 67 - maintainers = with maintainers; [vinnymeller]; 68 }; 69 }
··· 5 setuptools, 6 wheel, 7 qt5, 8 + python, 9 + dill, 10 matplotlib, 11 numpy, 12 pandas, ··· 17 }: 18 buildPythonPackage rec { 19 pname = "uxsim"; 20 + version = "1.3.0"; 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "toruseo"; 25 repo = "UXsim"; 26 + rev = "refs/tags/v${version}"; 27 + hash = "sha256-2lN2Cu0XXiYdLiE7phpGqhkBDjkmxLJt4ILb6ORWdCI="; 28 }; 29 30 + patches = [ ./add-qt-plugin-path-to-env.patch ]; 31 32 nativeBuildInputs = [ 33 setuptools ··· 35 ]; 36 37 propagatedBuildInputs = [ 38 + dill 39 matplotlib 40 numpy 41 pandas ··· 45 tqdm 46 ]; 47 48 + pythonImportsCheck = [ "uxsim" ]; 49 50 # QT_PLUGIN_PATH is required to be set for the program to produce its images 51 # our patch sets it to $NIX_QT_PLUGIN_PATH if QT_PLUGIN_PATH is not set 52 # and here we replace this string with the actual path to qt plugins 53 postInstall = '' 54 + substituteInPlace $out/${python.sitePackages}/uxsim/__init__.py \ 55 --replace-fail '$NIX_QT_PLUGIN_PATH' '${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}' 56 ''; 57 58 meta = with lib; { 59 description = "Vehicular traffic flow simulator in road network, written in pure Python"; 60 homepage = "https://github.com/toruseo/UXsim"; 61 license = licenses.mit; 62 + maintainers = with maintainers; [ vinnymeller ]; 63 }; 64 }