From 0ca1c820ff2a576de3c5888864180920a2c324ac Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Fri, 14 Apr 2023 14:07:24 +0200 Subject: [PATCH] python-bindings: use prev.callPackage to pass args --- flake.nix | 5 +---- python/default.nix | 15 +++++++-------- .../examples/buildPythonApplication/default.nix | 6 +++--- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index df2b15ea2c87..635dce2192be 100644 --- a/flake.nix +++ b/flake.nix @@ -439,10 +439,7 @@ postUnpack = "sourceRoot=$sourceRoot/perl"; }); - passthru.python-bindings = final.callPackage ./python { - inherit self system; - python = final.python3; - }; + passthru.python-bindings = prev.callPackage ./python { }; meta.platforms = lib.platforms.unix; }); diff --git a/python/default.nix b/python/default.nix index 43410878636c..9bec351d950b 100644 --- a/python/default.nix +++ b/python/default.nix @@ -1,8 +1,7 @@ { - self, system, lib, - python, + python3, boost, gdb, clang-tools, @@ -16,10 +15,10 @@ isShell ? false, }: let - _python = python; + _python = python3; in let - python = _python.override { self = enableDebugging _python; }; + python3 = _python.override { self = enableDebugging _python; }; # Extracts tests/init.sh testScripts = nix.overrideAttrs (old: { name = "nix-test-scripts-${old.version}"; @@ -45,7 +44,7 @@ let dontFixup = true; }); in -python.pkgs.buildPythonPackage { +python3.pkgs.buildPythonPackage { name = "nix"; format = "other"; @@ -64,7 +63,7 @@ python.pkgs.buildPythonPackage { nativeBuildInputs = [ ninja pkg-config - (meson.override { python3 = python; }) + (meson.override { inherit python3; }) ] ++ lib.optional (!isShell) nix; buildInputs = nix.propagatedBuildInputs ++ [ @@ -78,10 +77,10 @@ python.pkgs.buildPythonPackage { installCheckPhase = "meson test -v"; passthru = { - exampleEnv = python.withPackages (p: [ nix.python-bindings ]); + exampleEnv = python3.withPackages (p: [ nix.python-bindings ]); tests = { example-buildPythonApplication = import ./examples/buildPythonApplication { - inherit nix system testScripts python; + inherit nix system testScripts python3; }; }; shell = mkShell { diff --git a/python/examples/buildPythonApplication/default.nix b/python/examples/buildPythonApplication/default.nix index 21194be5c3cb..9bf26a17b63c 100644 --- a/python/examples/buildPythonApplication/default.nix +++ b/python/examples/buildPythonApplication/default.nix @@ -8,13 +8,13 @@ overlays = []; inherit system; }, - python ? pkgs.python3, + python3 ? pkgs.python3, nix ? (import ../../..).default, testScripts, }: let - nixBindings = nix.python-bindings.override { inherit python; }; -in python.pkgs.buildPythonApplication { + nixBindings = nix.python-bindings.override { inherit python3; }; +in python3.pkgs.buildPythonApplication { pname = "hello-nix"; version = "0.1"; src = builtins.path {