From d045216e9c0595cc44be18e7cc79372062e0448f Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Tue, 20 Aug 2024 10:52:36 -0700 Subject: [PATCH] kicad: use python 3.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6cec87c32d0dabb868da784734192c651d1db9df. Now that https://github.com/NixOS/nixpkgs/pull/326142 has landed, there's no reason to keep ourselves pinned to Python 3.11 anymore. As a happy side effect, this also fixes a bug with 6cec87c32d0dabb868da784734192c651d1db9df which broke our ability to use kicad addons: $ nix build --impure --expr 'with import ./. {}; pkgs.kicad.override { addons = with pkgs.kicadAddons; [kikit kikit-library]; }' -L ... error: … while calling the 'derivationStrict' builtin at :34:12: 33| 34| strict = derivationStrict drvAttrs; | ^ 35| … while evaluating derivation 'kicad-8.0.4' whose name attribute is located at /home/jeremy/src/github.com/NixOS/nixpkgs-alt/pkgs/stdenv/generic/make-derivation.nix:336:7 … while evaluating attribute 'makeWrapperArgs' of derivation 'kicad-8.0.4' at /home/jeremy/src/github.com/NixOS/nixpkgs-alt/pkgs/applications/science/electronics/kicad/default.nix:201:3: 200| # We are emulating wrapGAppsHook3, along with other variables to the wrapper 201| makeWrapperArgs = with passthru.libraries; [ | ^ 202| "--prefix XDG_DATA_DIRS : ${base}/share" (stack trace truncated; use '--show-trace' to show the full, detailed trace) error: function 'anonymous lambda' called with unexpected argument 'python' at /home/jeremy/src/github.com/NixOS/nixpkgs-alt/pkgs/applications/science/electronics/kicad/addons/kikit.nix:2:1: 1| # For building the multiple addons that are in the kikit repo. 2| { stdenv | ^ 3| , bc Did you mean python3? --- .../science/electronics/kicad/default.nix | 12 ++++-------- pkgs/top-level/python-packages.nix | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix index 459523ea6169..4dd8fa743121 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 -, python311 +, python3 , addons ? [ ] , debug ? false , sanitizeAddress ? false @@ -122,14 +122,10 @@ let else versionsImport.${baseName}.libVersion.version; wxGTK = wxGTK32; - # 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; + python = python3; wxPython = python.pkgs.wxpython; addonPath = "addon.zip"; - addonsDrvs = map (pkg: pkg.override { inherit addonPath python; }) addons; + addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons; addonsJoined = runCommand "addonsJoined" @@ -161,7 +157,7 @@ stdenv.mkDerivation rec { # Common libraries, referenced during runtime, via the wrapper. passthru.libraries = callPackages ./libraries.nix { inherit libSrc; }; - passthru.callPackage = newScope { inherit addonPath python; }; + passthru.callPackage = newScope { inherit addonPath python3; }; 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 b8d19bd7226e..8c379a5c1e2d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6663,7 +6663,7 @@ self: super: with self; { khanaa = callPackage ../development/python-modules/khanaa {}; kicad = toPythonModule (pkgs.kicad.override { - python311 = python; + python3 = python; }).src; kinparse = callPackage ../development/python-modules/kinparse { };