From 5ff4e1b1b89d408ce2a9fbcbb4b7f2903714ca84 Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Sun, 13 Oct 2024 20:28:12 +0200 Subject: [PATCH] =?UTF-8?q?Separate=20architecture=E2=80=90specific=20fixe?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- overlay/aarch.nix | 9 +++++++++ overlay/default.nix | 2 ++ overlay/fixes.nix | 44 +++++--------------------------------------- overlay/riscv.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 39 deletions(-) create mode 100644 overlay/aarch.nix create mode 100644 overlay/riscv.nix diff --git a/overlay/aarch.nix b/overlay/aarch.nix new file mode 100644 index 0000000..ebfb102 --- /dev/null +++ b/overlay/aarch.nix @@ -0,0 +1,9 @@ +{ nixpkgs, ... }: final: prev: +let + inherit (nixpkgs) lib; + inherit (prev.stdenv) hostPlatform; +in lib.optionalAttrs hostPlatform.isAarch ({ + umockdev = prev.umockdev.overrideAttrs { + doCheck = false; + }; +}) diff --git a/overlay/default.nix b/overlay/default.nix index f85bf1d..7ff19f1 100644 --- a/overlay/default.nix +++ b/overlay/default.nix @@ -10,4 +10,6 @@ nixpkgs.lib.composeManyExtensions [ self.overlays.mimalloc self.overlays.modern-minimal self.overlays.fixes + self.overlays.riscv + self.overlays.aarch ] final prev diff --git a/overlay/fixes.nix b/overlay/fixes.nix index 2a67e59..cbf7c5b 100644 --- a/overlay/fixes.nix +++ b/overlay/fixes.nix @@ -1,6 +1,7 @@ { nixpkgs, ... }: final: prev: let - inherit (nixpkgs.lib) optionalAttrs toList; + inherit (nixpkgs) lib; + inherit (lib) toList; inherit (prev.stdenv) hostPlatform; in { numactl = prev.numactl.overrideAttrs (prevAttrs: { @@ -12,9 +13,9 @@ in { ]; }); - redis = prev.redis.overrideAttrs ({ + redis = prev.redis.overrideAttrs { doCheck = false; - }); + }; python312 = prev.python312.override { packageOverrides = final: prev: { @@ -22,13 +23,6 @@ in { doCheck = false; doInstallCheck = false; }); - } // optionalAttrs hostPlatform.isRiscV64 { - psutil = prev.psutil.overrideAttrs (prevAttrs: { - disabledTests = prevAttrs.disabledTests or [ ] ++ [ - "net_if_addrs" - "net_if_stats" - ]; - }); }; }; @@ -45,32 +39,4 @@ in { --replace-fail 'CACHELINE_SIZE EQUAL "undefined"' 'CACHELINE_SIZE STREQUAL "undefined"' ''; }); -} // optionalAttrs hostPlatform.isRiscV64 ({ - boehmgc = prev.boehmgc.overrideAttrs (prevAttrs: { - postPatch = prevAttrs.postPatch or "" + '' - sed -E -i '/^TESTS \+= gctest/d' \ - tests/tests.am - ''; - }); - - elfutils = prev.elfutils.overrideAttrs ({ - doCheck = false; - doInstallCheck = false; - }); - - libseccomp = prev.libseccomp.overrideAttrs ({ - doCheck = false; - }); - - libuv = prev.libuv.overrideAttrs ({ - doCheck = false; - }); - - umockdev = prev.umockdev.overrideAttrs { - doCheck = false; - }; - - xdg-utils = prev.xdg-utils.override { - procmail = final.emptyDirectory; - }; -}) +} diff --git a/overlay/riscv.nix b/overlay/riscv.nix new file mode 100644 index 0000000..c742b0a --- /dev/null +++ b/overlay/riscv.nix @@ -0,0 +1,44 @@ +{ nixpkgs, ... }: final: prev: +let + inherit (nixpkgs) lib; + inherit (prev.stdenv) hostPlatform; +in lib.optionalAttrs hostPlatform.isRiscV ({ + python312 = prev.python312.override { + packageOverrides = final: prev: { + psutil = prev.psutil.overrideAttrs (prevAttrs: { + disabledTests = prevAttrs.disabledTests or [ ] ++ [ + "net_if_addrs" + "net_if_stats" + ]; + }); + }; + }; + + boehmgc = prev.boehmgc.overrideAttrs (prevAttrs: { + postPatch = prevAttrs.postPatch or "" + '' + sed -E -i '/^TESTS \+= gctest/d' \ + tests/tests.am + ''; + }); + + elfutils = prev.elfutils.overrideAttrs { + doCheck = false; + doInstallCheck = false; + }; + + libseccomp = prev.libseccomp.overrideAttrs { + doCheck = false; + }; + + libuv = prev.libuv.overrideAttrs { + doCheck = false; + }; + + umockdev = prev.umockdev.overrideAttrs { + doCheck = false; + }; + + xdg-utils = prev.xdg-utils.override { + procmail = final.emptyDirectory; + }; +})