From d65d8002c7fbca2144fce2480a65bec36768da9a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 1 Sep 2022 12:07:16 +0000 Subject: [PATCH] glib.tests.withChecks: init This will allow OfBorg to run the GLib tests, which it didn't do before. To do this correctly for the glib we're building, we need to override it rather than taking glib as an input. finalAttrs.finalPackage is not overrideable, so instead we need to use overrideAttrs. Since we can now consult finalAttrs.doCheck, there's no longer any need for a separate doCheck option, so I've removed it in favour of overrideAttrs. --- pkgs/development/libraries/glib/default.nix | 7 +++---- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix index f625ea4e67cb..942231ebb3ea 100644 --- a/pkgs/development/libraries/glib/default.nix +++ b/pkgs/development/libraries/glib/default.nix @@ -5,7 +5,6 @@ , buildPackages # this is just for tests (not in the closure of any regular package) -, doCheck ? config.doCheckByDefault or false , coreutils, dbus, libxml2, tzdata , desktop-file-utils, shared-mime-info , darwin, fetchpatch @@ -213,7 +212,7 @@ stdenv.mkDerivation (finalAttrs: { checkInputs = [ tzdata desktop-file-utils shared-mime-info ]; - preCheck = optionalString doCheck '' + preCheck = optionalString finalAttrs.doCheck or config.doCheckByDefault or false '' export LD_LIBRARY_PATH="$NIX_BUILD_TOP/glib-${finalAttrs.version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" export TZDIR="${tzdata}/share/zoneinfo" export XDG_CACHE_HOME="$TMP" @@ -225,8 +224,6 @@ stdenv.mkDerivation (finalAttrs: { echo "PATH=$PATH" ''; - inherit doCheck; - separateDebugInfo = stdenv.isLinux; passthru = rec { @@ -237,6 +234,8 @@ stdenv.mkDerivation (finalAttrs: { getSchemaPath = pkg: makeSchemaPath pkg pkg.name; getSchemaDataDirPath = pkg: makeSchemaDataDirPath pkg pkg.name; + tests.withChecks = finalAttrs.finalPackage.overrideAttrs (_: { doCheck = true; }); + inherit flattenInclude; updateScript = gnome.updateScript { packageName = "glib"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4a11e3a4b6ad..6c876b7ef19a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18525,7 +18525,7 @@ with pkgs; gtkimageview = callPackage ../development/libraries/gtkimageview { }; glib = callPackage ../development/libraries/glib (let - glib-untested = glib.override { doCheck = false; }; + glib-untested = glib.overrideAttrs (_: { doCheck = false; }); in { # break dependency cycles # these things are only used for tests, they don't get into the closure