# Compatibility fixes for packages rebuilt with x86-64-v3. # # The v3 baseline enables instructions that expose source assumptions hidden # by the generic x86-64 build. Keep compile fixes here, separate from test # exclusions, until upstream or nixpkgs incorporates them. _final: prev: let patchAbseilBmi2Include = package: package.overrideAttrs (old: { # GCC and Clang prohibit including their internal BMI2 header directly. # The public umbrella provides the same intrinsics with the required # compiler setup. postPatch = (old.postPatch or "") + '' substituteInPlace third_party/abseil-cpp/absl/container/internal/raw_hash_set.h \ --replace-fail "#include " "#include " ''; }); removeSiblingOutputChecks = package: package.overrideAttrs (old: { # Nix 2.34 can validate a partial multi-output rebuild against only the # outputs still being realised. PostgreSQL's checks then reject valid # sibling names such as "out" and "lib". Keep the test suite and # disallowed-requisite checks; accept the loss of cross-output checks. outputChecks = builtins.mapAttrs ( _output: checks: builtins.removeAttrs checks [ "disallowedReferences" ] ) (old.outputChecks or { }); }); electron43Unwrapped = patchAbseilBmi2Include prev.electron_43.unwrapped; electron43 = prev.electron_43.override { electron-unwrapped = electron43Unwrapped; }; signalCallPackage = path: args: let package = prev.callPackage path args; in if builtins.baseNameOf path == "webrtc.nix" then patchAbseilBmi2Include package else package; in prev.lib.optionalAttrs ((prev.stdenv.hostPlatform.gcc.arch or null) == "x86-64-v3") { deno = let librusty_v8 = patchAbseilBmi2Include prev.deno.passthru.librusty_v8; in prev.deno.override { inherit librusty_v8; }; electron_43 = electron43; postgresql = removeSiblingOutputChecks prev.postgresql; postgresql_18 = removeSiblingOutputChecks prev.postgresql_18; signal-desktop = prev.signal-desktop.override { electron_43 = electron43; callPackage = signalCallPackage; }; }