Files
Rine Amakawa 6b01148e2e treewide: fix python makeWrapperArgs with __structuredAttrs
buildPythonPackage and buildPythonApplication now default to
__structuredAttrs = true, so makeWrapperArgs reaches wrapPythonPrograms
as a real bash array. Elements are no longer word-split or
shell-expanded, which breaks three common patterns:

- several arguments packed into one string, such as
  "--prefix PATH : ${...}", which makeWrapper rejects with
  "makeWrapper doesn't understand the arg ..."
- "\${gappsWrapperArgs[@]}" or "\${qtWrapperArgs[@]}" as list
  elements, which also fail the build
- build-time shell variables ($out, $PYTHONPATH, $GI_TYPELIB_PATH, ...)
  and shell quoting inside elements. These build fine but end up as
  literal strings in the wrapper, e.g. beets got
  export GI_TYPELIB_PATH='$GI_TYPELIB_PATH', and gam's --run lines
  became single-quoted commands that abort the wrapper.

Split packed strings into one element per argument, append the
gapps/qt wrapper args in preFixup, use placeholder "out" instead of
$out, move other build-time variables into preFixup, and drop the
now-literal quotes.

Also fix the makeWrapperArgs example in the python propagated-inputs
warning.

Assisted-by: Claude Code (Claude Opus 5.5)
2026-10-27 14:36:08 +09:00

97 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
flet-client-flutter,
# build-system
setuptools,
# dependencies
fastapi,
httpx,
msgpack,
oauthlib,
packaging,
qrcode,
repath,
cookiecutter,
uvicorn,
watchdog,
websocket-client,
websockets,
# tests
numpy,
pillow,
pytest-asyncio,
pytestCheckHook,
scikit-image,
}:
buildPythonPackage rec {
pname = "flet";
inherit (flet-client-flutter) version src;
pyproject = true;
sourceRoot = "${src.name}/sdk/python/packages/flet";
build-system = [ setuptools ];
preFixup = ''
makeWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
'';
_flet_version = ''
flet_version = "${version}"
def update_version():
pass
'';
_flet_utils_pip = ''
def install_flet_package(name: str):
pass
'';
postPatch = ''
# nerf out nagging about pip
echo "$_flet_version" > src/flet/version.py
echo "$_flet_utils_pip" >> src/flet/utils/pip.py
'';
dependencies = [
cookiecutter
fastapi
httpx
msgpack
oauthlib
packaging
qrcode
repath
uvicorn
watchdog
websocket-client
websockets
];
nativeCheckInputs = [
numpy
pillow
pytest-asyncio
pytestCheckHook
scikit-image
];
pythonImportsCheck = [ "flet" ];
meta = {
broken = true;
description = "Framework that enables you to easily build realtime web, mobile, and desktop apps in Python";
homepage = "https://flet.dev/";
changelog = "https://github.com/flet-dev/flet/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
heyimnova
];
mainProgram = "flet";
};
}