mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-31 09:10:08 +00:00
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)
63 lines
1.1 KiB
Nix
63 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
flet-client-flutter,
|
|
|
|
# build-system
|
|
poetry-core,
|
|
|
|
flet,
|
|
flet-desktop,
|
|
flet-web,
|
|
qrcode,
|
|
toml,
|
|
watchdog,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "flet-cli";
|
|
inherit (flet-client-flutter) version src;
|
|
pyproject = true;
|
|
|
|
sourceRoot = "${src.name}/sdk/python/packages/flet-cli";
|
|
|
|
build-system = [ poetry-core ];
|
|
|
|
dependencies = [
|
|
flet
|
|
flet-desktop
|
|
flet-web
|
|
qrcode
|
|
toml
|
|
watchdog
|
|
];
|
|
|
|
pythonRelaxDeps = [
|
|
"qrcode"
|
|
"watchdog"
|
|
];
|
|
|
|
preFixup = ''
|
|
makeWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
|
|
'';
|
|
|
|
postInstall = ''
|
|
mkdir -p $out/bin
|
|
makeWrapper ${flet}/bin/flet $out/bin/flet \
|
|
--prefix PYTHONPATH : $PYTHONPATH
|
|
'';
|
|
|
|
pythonImportsCheck = [ "flet_cli" ];
|
|
|
|
meta = {
|
|
description = "Command-line interface tool for Flet, a framework for building interactive multi-platform applications using 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";
|
|
};
|
|
}
|