diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index 4dd8fa743121..459523ea6169 100644 --- a/pkgs/applications/science/electronics/kicad/default.nix +++ b/pkgs/applications/science/electronics/kicad/default.nix @@ -25,7 +25,7 @@ , withNgspice ? !stdenv.isDarwin , libngspice , withScripting ? true -, python3 +, python311 , addons ? [ ] , debug ? false , sanitizeAddress ? false @@ -122,10 +122,14 @@ let else versionsImport.${baseName}.libVersion.version; wxGTK = wxGTK32; - python = python3; + # KiCAD depends on wxWidgets, which uses distutils (removed in Python 3.12) + # See also: https://github.com/wxWidgets/Phoenix/issues/2104 + # Eventually, wxWidgets should support Python 3.12: https://github.com/wxWidgets/Phoenix/issues/2553 + # Until then, we use Python 3.11 which still includes distutils + python = python311; wxPython = python.pkgs.wxpython; addonPath = "addon.zip"; - addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons; + addonsDrvs = map (pkg: pkg.override { inherit addonPath python; }) addons; addonsJoined = runCommand "addonsJoined" @@ -157,7 +161,7 @@ stdenv.mkDerivation rec { # Common libraries, referenced during runtime, via the wrapper. passthru.libraries = callPackages ./libraries.nix { inherit libSrc; }; - passthru.callPackage = newScope { inherit addonPath python3; }; + passthru.callPackage = newScope { inherit addonPath python; }; base = callPackage ./base.nix { inherit stable testing baseName; inherit kicadSrc kicadVersion; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d43d629f2c42..6ccbd3cc079d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6545,7 +6545,7 @@ self: super: with self; { khanaa = callPackage ../development/python-modules/khanaa {}; kicad = toPythonModule (pkgs.kicad.override { - python3 = python; + python311 = python; }).src; kinparse = callPackage ../development/python-modules/kinparse { };