From e71af63875c8b49219c7100cbdafd794fa3df131 Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 24 Dec 2024 17:13:58 +0700 Subject: [PATCH 1/4] python3Packages.contourpy: fix cross build --- .../python-modules/contourpy/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkgs/development/python-modules/contourpy/default.nix b/pkgs/development/python-modules/contourpy/default.nix index de2f96a8a93d7..c6fdbfe5373b3 100644 --- a/pkgs/development/python-modules/contourpy/default.nix +++ b/pkgs/development/python-modules/contourpy/default.nix @@ -1,13 +1,16 @@ { lib, + buildPackages, buildPythonPackage, fetchFromGitHub, pythonOlder, + python3, # build meson, meson-python, ninja, + nukeReferences, pybind11, # propagates @@ -21,7 +24,9 @@ # tests matplotlib, pillow, + pytest-xdist, pytestCheckHook, + wurlitzer, }: let @@ -42,6 +47,7 @@ let nativeBuildInputs = [ meson ninja + nukeReferences pybind11 ]; @@ -63,6 +69,8 @@ let matplotlib pillow pytestCheckHook + pytest-xdist + wurlitzer ]; passthru.tests = { @@ -73,6 +81,12 @@ let pythonImportsCheck = [ "contourpy" ]; + # remove references to buildPackages.python3, which is not allowed for cross builds. + preFixup = '' + nuke-refs -e "${buildPackages.python3}" \ + $out/${python3.sitePackages}/contourpy/util/{_build_config.py,__pycache__/_build_config.*} + ''; + meta = with lib; { changelog = "https://github.com/contourpy/contourpy/releases/tag/v${version}"; description = "Python library for calculating contours in 2D quadrilateral grids"; From 0e22891c2cc1ffb632645e566bb97cd314fee35b Mon Sep 17 00:00:00 2001 From: DavHau Date: Wed, 25 Dec 2024 02:09:54 +0700 Subject: [PATCH 2/4] python3Packages.home-assistant-chip-wheels: simplify dependency closure generation --- .../home-assistant-chip-wheels/default.nix | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix b/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix index 4699055253244..7404c81b620e4 100644 --- a/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix +++ b/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix @@ -223,26 +223,18 @@ stdenv.mkDerivation rec { wheel yapf ]; - depListToAttrs = - list: - builtins.listToAttrs ( - map (dep: { - name = dep.name; - value = dep; - }) (lib.filter (x: x != null) list) - ); - saturateDependencies = - deps: - let - before = deps; - new = lib.mergeAttrsList ( - map (dep: depListToAttrs (dep.propagatedBuildInputs or [ ])) (lib.attrValues before) - ); - after = before // new; - in - if lib.attrNames before != lib.attrNames after then saturateDependencies after else before; - saturateDependencyList = list: lib.attrValues (saturateDependencies (depListToAttrs list)); - saturatedDependencyList = lib.filter (drv: drv ? dist) (saturateDependencyList dependencies); + filterNull = list: lib.filter (dep: dep != null) list; + toItem = dep: { + inherit dep; + key = dep.name; + }; + saturatedDependencies = lib.genericClosure { + startSet = map toItem (filterNull dependencies); + operator = item: map toItem (filterNull ((item.dep).propagatedBuildInputs or [ ])); + }; + saturatedDependencyList = lib.filter (dep: dep ? dist && dep != null) ( + map (item: item.dep) saturatedDependencies + ); in lib.concatMapStringsSep " " (dep: "file://${dep.dist}") saturatedDependencyList; From 7d6c2f50fc520a640fbc1afbcbc8ff2ecd637eba Mon Sep 17 00:00:00 2001 From: DavHau Date: Sun, 29 Dec 2024 23:42:34 +0700 Subject: [PATCH 3/4] python3Packages.home-assistant-chip-wheels: fix cross build --- .../python-modules/home-assistant-chip-wheels/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix b/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix index 7404c81b620e4..c3172aa90a190 100644 --- a/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix +++ b/pkgs/development/python-modules/home-assistant-chip-wheels/default.nix @@ -32,6 +32,7 @@ parameterized, pip-tools, pkg-config, + pkgconfig, prompt-toolkit, protobuf, psutil, @@ -105,6 +106,7 @@ stdenv.mkDerivation rec { zap-chip # gdbus-codegen glib + pkgconfig python3 # dependencies of build scripts click @@ -193,6 +195,7 @@ stdenv.mkDerivation rec { packaging parameterized pip-tools + pkgconfig prompt-toolkit protobuf psutil From ff9865bc41bacc9c2bf57585bed1c31af0317235 Mon Sep 17 00:00:00 2001 From: DavHau Date: Mon, 30 Dec 2024 20:31:42 +0700 Subject: [PATCH 4/4] python3Packages.bcrypt: fix cross build --- pkgs/development/python-modules/bcrypt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/bcrypt/default.nix b/pkgs/development/python-modules/bcrypt/default.nix index 89ff93e943094..93e4a7addef2a 100644 --- a/pkgs/development/python-modules/bcrypt/default.nix +++ b/pkgs/development/python-modules/bcrypt/default.nix @@ -5,7 +5,7 @@ rustPlatform, rustc, setuptools, - setuptools-rust, + setuptoolsRustBuildHook, fetchPypi, pythonOlder, pytestCheckHook, @@ -41,7 +41,7 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools - setuptools-rust + setuptoolsRustBuildHook rustPlatform.cargoSetupHook cargo rustc