diff options
Diffstat (limited to 'pkgs/development/python-modules/flet-runtime')
-rw-r--r-- | pkgs/development/python-modules/flet-runtime/_setup_runtime.py | 3 | ||||
-rw-r--r-- | pkgs/development/python-modules/flet-runtime/default.nix | 20 |
2 files changed, 15 insertions, 8 deletions
diff --git a/pkgs/development/python-modules/flet-runtime/_setup_runtime.py b/pkgs/development/python-modules/flet-runtime/_setup_runtime.py new file mode 100644 index 000000000000..3a25fb7b959a --- /dev/null +++ b/pkgs/development/python-modules/flet-runtime/_setup_runtime.py @@ -0,0 +1,3 @@ +import os +if 'FLET_VIEW_PATH' not in os.environ: + os.environ["FLET_VIEW_PATH"] = "@flet-client-flutter@/bin" diff --git a/pkgs/development/python-modules/flet-runtime/default.nix b/pkgs/development/python-modules/flet-runtime/default.nix index 9e643fa81289..e2cae32ad418 100644 --- a/pkgs/development/python-modules/flet-runtime/default.nix +++ b/pkgs/development/python-modules/flet-runtime/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, fetchPypi +, flet-client-flutter , poetry-core , pythonRelaxDepsHook , flet-core @@ -10,14 +10,18 @@ buildPythonPackage rec { pname = "flet-runtime"; - version = "0.20.2"; + inherit (flet-client-flutter) version src; + pyproject = true; - src = fetchPypi { - pname = "flet_runtime"; - inherit version; - hash = "sha256-92gyaMME2R7k3AAFKsl7kIv8mVwi8pwQsGLD0ml82Q0="; - }; + sourceRoot = "${src.name}/sdk/python/packages/flet-runtime"; + + postPatch = '' + substitute ${./_setup_runtime.py} src/flet_runtime/_setup_runtime.py \ + --replace @flet-client-flutter@ ${flet-client-flutter} + + echo -e "import flet_runtime._setup_runtime\n$(cat src/flet_runtime/__init__.py)" > src/flet_runtime/__init__.py + ''; nativeBuildInputs = [ poetry-core @@ -43,6 +47,6 @@ buildPythonPackage rec { description = "A base package for Flet desktop and Flet mobile"; homepage = "https://flet.dev/"; license = lib.licenses.asl20; - maintainers = [ lib.maintainers.wegank ]; + maintainers = with lib.maintainers; [ lucasew wegank ]; }; } |