diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix index 3f2d2d38e757..c180de124d6b 100644 --- a/pkgs/development/tools/analysis/valgrind/default.nix +++ b/pkgs/development/tools/analysis/valgrind/default.nix @@ -6,9 +6,6 @@ autoreconfHook, perl, gdb, - cctools, - xnu, - bootstrap_cmds, writeScript, }: @@ -56,15 +53,10 @@ stdenv.mkDerivation rec { # GDB is needed to provide a sane default for `--db-command'. # Perl is needed for `callgrind_{annotate,control}'. - buildInputs = - [ - gdb - perl - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ - bootstrap_cmds - xnu - ]; + buildInputs = [ + gdb + perl + ]; # Perl is also a native build input. nativeBuildInputs = [ @@ -75,40 +67,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; separateDebugInfo = stdenv.hostPlatform.isLinux; - preConfigure = - lib.optionalString stdenv.hostPlatform.isFreeBSD '' - substituteInPlace configure --replace-fail '`uname -r`' ${stdenv.cc.libc.version}- - '' - + lib.optionalString stdenv.hostPlatform.isDarwin ( - let - OSRELEASE = '' - $(awk -F '"' '/#define OSRELEASE/{ print $2 }' \ - <${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)''; - in - '' - echo "Don't derive our xnu version using uname -r." - substituteInPlace configure --replace "uname -r" "echo ${OSRELEASE}" + preConfigure = lib.optionalString stdenv.hostPlatform.isFreeBSD '' + substituteInPlace configure --replace-fail '`uname -r`' ${stdenv.cc.libc.version}- + ''; - # Apple's GCC doesn't recognize `-arch' (as of version 4.2.1, build 5666). - echo "getting rid of the \`-arch' GCC option..." - find -name Makefile\* -exec \ - sed -i {} -e's/DARWIN\(.*\)-arch [^ ]\+/DARWIN\1/g' \; - - sed -i coregrind/link_tool_exe_darwin.in \ - -e 's/^my \$archstr = .*/my $archstr = "x86_64";/g' - - substituteInPlace coregrind/m_debuginfo/readmacho.c \ - --replace /usr/bin/dsymutil ${stdenv.cc.bintools.bintools}/bin/dsymutil - - echo "substitute hardcoded /usr/bin/ld with ${cctools}/bin/ld" - substituteInPlace coregrind/link_tool_exe_darwin.in \ - --replace /usr/bin/ld ${cctools}/bin/ld - '' - ); - - configureFlags = - lib.optional stdenv.hostPlatform.isx86_64 "--enable-only64bit" - ++ lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include"; + configureFlags = lib.optional stdenv.hostPlatform.isx86_64 "--enable-only64bit"; doCheck = true; @@ -157,6 +120,10 @@ stdenv.mkDerivation rec { darwin ++ freebsd ++ illumos ++ linux ); badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ]; - broken = stdenv.hostPlatform.isDarwin; # https://hydra.nixos.org/build/128521440/nixlog/2 + # See: + # + # Darwin‐specific derivation logic has been removed, check the + # history if you want to fix this. + broken = stdenv.hostPlatform.isDarwin; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 50eca52b28f5..94046eda17ad 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8175,9 +8175,7 @@ with pkgs; jdk = jdk11; }; - valgrind = callPackage ../development/tools/analysis/valgrind { - inherit (buildPackages.darwin) xnu bootstrap_cmds; - }; + valgrind = callPackage ../development/tools/analysis/valgrind { }; valgrind-light = (res.valgrind.override { gdb = null; }).overrideAttrs (oldAttrs: { meta = oldAttrs.meta // { description = "${oldAttrs.meta.description} (without GDB)";