From d0034cbbc04f16c6ef81a56e2c171e753351be16 Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Sat, 21 Mar 2026 14:17:21 +0100 Subject: [PATCH] python3Packages.pycangjie: fix build with non-default python versions `find_installation()` without the `name_or_path` argument uses the Python interpreter that Meson was built with [1], which may not be the one we're using to build pycangjie. [1] https://mesonbuild.com/Python-module.html#find_installation --- pkgs/development/python-modules/pycangjie/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/python-modules/pycangjie/default.nix b/pkgs/development/python-modules/pycangjie/default.nix index 18f400ac2847..a6313eff5f65 100644 --- a/pkgs/development/python-modules/pycangjie/default.nix +++ b/pkgs/development/python-modules/pycangjie/default.nix @@ -25,6 +25,17 @@ buildPythonPackage rec { hash = "sha256-REWX6u3Rc72+e5lIImBwV5uFoBBUTMM5BOfYdKIFL4k="; }; + # `find_installation()` without the `name_or_path` argument uses the + # Python interpreter that Meson was built with, which may not be the + # one we're using to build pycangjie. + # https://mesonbuild.com/Python-module.html#find_installation + postPatch = '' + substituteInPlace meson.build \ + --replace-fail \ + "import('python').find_installation()" \ + "import('python').find_installation('python3')" + ''; + preConfigure = '' ( cd subprojects