Skip to content

Commit

Permalink
Switch from checkInputs to nativeCheckInputs on >= NixOS 23.05
Browse files Browse the repository at this point in the history
This unbreaks package tests on the current nixpkgs-unstable branch, as
`buildPythonPackage` has been adjusted to rename `checkInputs` to
`nativeCheckInputs`, breaking existing checkInputs specifications
because of `strictDeps = 1;`. For more information, check out the
corresponding PR at [1]. This implements the proposed workaround[2]
for supporting both the current nixos-unstable and the last release
branch (NixOS 22.11).

[1]: NixOS/nixpkgs#206742
[2]: NixOS/nixpkgs#206742 (comment)

Signed-off-by: Leon Schuermann <leon@is.currently.online>
  • Loading branch information
lschuermann committed Feb 6, 2023
1 parent 57170a2 commit 66cbacd
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 7 deletions.
19 changes: 18 additions & 1 deletion pkgs/litedram.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@ pkgMeta:
, zeromq
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "litedram";
version = pkgMeta.git_revision;
Expand Down Expand Up @@ -58,7 +75,7 @@ buildPythonPackage rec {
pytest -v test/
'';

checkInputs = [
${checkInputsAttr} = [
# For test summary
pandas
numpy
Expand Down
19 changes: 18 additions & 1 deletion pkgs/liteeth.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ pkgMeta:
, pyyaml
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "liteeth";
version = pkgMeta.git_revision;
Expand All @@ -24,7 +41,7 @@ buildPythonPackage rec {
litex
];

checkInputs = [
${checkInputsAttr} = [
# Some of these are really only required because litex-boards
# needs them for importing all targets in its __init__.py.
liteiclink
Expand Down
19 changes: 18 additions & 1 deletion pkgs/litepcie.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ pkgMeta:
, liteiclink
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "litepcie";
version = pkgMeta.git_revision;
Expand All @@ -27,7 +44,7 @@ buildPythonPackage rec {
migen
];

checkInputs = [
${checkInputsAttr} = [
litex-boards
litedram
liteeth
Expand Down
19 changes: 18 additions & 1 deletion pkgs/litescope.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ pkgMeta:
, pythondata-cpu-vexriscv
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "litescope";
version = pkgMeta.git_revision;
Expand All @@ -26,7 +43,7 @@ buildPythonPackage rec {
litex
];

checkInputs = [
${checkInputsAttr} = [
litex
litex-boards
liteiclink
Expand Down
19 changes: 18 additions & 1 deletion pkgs/litex-boards.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ pkgMeta:
, litesdcard
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "litex-boards";
version = pkgMeta.git_revision;
Expand Down Expand Up @@ -58,7 +75,7 @@ buildPythonPackage rec {

doCheck = true;

checkInputs = [
${checkInputsAttr} = [
pytest
];
checkPhase = ''
Expand Down
19 changes: 18 additions & 1 deletion pkgs/litex/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ pkgMeta:
, zeromq
}:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "litex";
version = pkgMeta.git_revision;
Expand Down Expand Up @@ -59,7 +76,7 @@ buildPythonPackage rec {
packaging
];

checkInputs = [
${checkInputsAttr} = [
litedram
liteeth
liteiclink
Expand Down
19 changes: 18 additions & 1 deletion pkgs/valentyusb/valentyusb-hw_cdc_eptri.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
pkgMeta:
{ lib, buildPythonPackage, litex, cocotb, sigrok-cli, verilog }:

let
# In the current NixOS unstable branch (to be nixos-23.05),
# `buildPythonPackage` has been adjusted to rename `checkInputs` to
# `nativeCheckInputs`, breaking existing checkInputs specifications because of
# `strictDeps = 1;`. For more information, check out the corresponding PR at
# [1]. This implements the proposed workaround[2] for supporting both the
# current nixos-unstable and the last release branch (NixOS 22.11).
#
# [1]: https://github.com/NixOS/nixpkgs/pull/206742
# [2]: https://github.com/NixOS/nixpkgs/pull/206742#issuecomment-1417674430
checkInputsAttr =
if lib.versionAtLeast lib.version "23.05" then
"nativeCheckInputs"
else
"checkInputs";

in
buildPythonPackage rec {
pname = "valentyusb-hw_cdc_eptri";
version = pkgMeta.git_revision;
Expand All @@ -15,7 +32,7 @@ buildPythonPackage rec {
litex
];

checkInputs = [
${checkInputsAttr} = [
cocotb
sigrok-cli
verilog
Expand Down

0 comments on commit 66cbacd

Please sign in to comment.