Skip to content

Commit

Permalink
Fix cross-compilation eval failures (#344499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Sep 27, 2024
2 parents c362e9e + 3194fb7 commit 3876b1b
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 42 deletions.
3 changes: 2 additions & 1 deletion pkgs/applications/editors/vscode/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ in
asar
copyDesktopItems
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
(buildPackages.wrapGAppsHook3.override { inherit (buildPackages) makeWrapper; })
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];

dontBuild = true;
Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/networking/browsers/brave/make-brave.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, wrapGAppsHook3, makeWrapper
{ lib, stdenv, fetchurl, buildPackages
, alsa-lib
, at-spi2-atk
, at-spi2-core
Expand Down Expand Up @@ -112,7 +112,9 @@ stdenv.mkDerivation {

nativeBuildInputs = [
dpkg
(wrapGAppsHook3.override { inherit makeWrapper; })
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];

buildInputs = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
, asar
, rsync
, python3
, wrapGAppsHook3
, makeWrapper
, buildPackages
, nixosTests
, gtk3
, atk
Expand Down Expand Up @@ -127,7 +126,9 @@ stdenv.mkDerivation rec {
asar
python3
autoPatchelfHook
(wrapGAppsHook3.override { inherit makeWrapper; })
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];

buildInputs = [
Expand Down
3 changes: 2 additions & 1 deletion pkgs/applications/office/appflowy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ let
};
aarch64-darwin = x86_64-darwin;
}
."${stdenvNoCC.hostPlatform.system}";
."${stdenvNoCC.hostPlatform.system}"
or (throw "appflowy: No source for system: ${stdenvNoCC.hostPlatform.system}");
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "appflowy";
Expand Down
6 changes: 4 additions & 2 deletions pkgs/applications/version-management/gitkraken/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
makeDesktopItem,
openssl,
wrapGAppsHook3,
makeShellWrapper,
buildPackages,
at-spi2-atk,
at-spi2-core,
libuuid,
Expand Down Expand Up @@ -166,7 +166,9 @@ let

nativeBuildInputs = [
copyDesktopItems
(wrapGAppsHook3.override { makeWrapper = makeShellWrapper; })
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];
buildInputs = [
gtk3
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/cu/cups-idprt-barcode/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ stdenvNoCC.mkDerivation {

installPhase =
let
arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-barcode: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/cu/cups-idprt-mt888/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ stdenvNoCC.mkDerivation {

installPhase =
let
arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-mt888: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/cu/cups-idprt-mt890/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ stdenvNoCC.mkDerivation {

installPhase =
let
arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-mt890: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/cu/cups-idprt-sp900/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ stdenvNoCC.mkDerivation (finalAttrs: {

installPhase =
let
arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-sp900: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
Expand Down
11 changes: 7 additions & 4 deletions pkgs/by-name/cu/cups-idprt-tspl/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ stdenvNoCC.mkDerivation {

installPhase =
let
arch = builtins.getAttr stdenvNoCC.hostPlatform.system {
x86_64-linux = "x64";
x86-linux = "x86";
};
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-tspl: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
Expand Down
7 changes: 4 additions & 3 deletions pkgs/by-name/gi/github-desktop/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
, lib
, fetchurl
, autoPatchelfHook
, wrapGAppsHook3
, makeWrapper
, buildPackages
, gnome-keyring
, libsecret
, git
Expand Down Expand Up @@ -44,7 +43,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {

nativeBuildInputs = [
autoPatchelfHook
(wrapGAppsHook3.override { inherit makeWrapper; })
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];

buildInputs = [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/pa/paper-plane/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, fetchFromGitHub
, gtk4
, wrapGAppsHook3
, libadwaita
, tdlib
, rlottie
Expand All @@ -18,6 +17,7 @@
, libshumate
, gst_all_1
, darwin
, buildPackages
}:

let
Expand All @@ -36,7 +36,7 @@ let
gtk4-paperplane = gtk4.overrideAttrs (prev: {
patches = (prev.patches or []) ++ [ "${src}/build-aux/gtk-reversed-list.patch" ];
});
wrapPaperPlaneHook = wrapGAppsHook3.override {
wrapPaperPlaneHook = buildPackages.wrapGAppsHook3.override {
gtk3 = gtk4-paperplane;
};
# libadwaita has gtk4 in propagatedBuildInputs so it must be overrided
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/cuda-modules/tensorrt/fixup.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ finalAttrs: prevAttrs: {
# We need to look inside the extracted output to get the files we need.
sourceRoot = "TensorRT-${finalAttrs.version}";

buildInputs = prevAttrs.buildInputs ++ [ finalAttrs.passthru.cudnn.lib ];
buildInputs = prevAttrs.buildInputs ++ [ (finalAttrs.passthru.cudnn.lib or null) ];

preInstall =
(prevAttrs.preInstall or "")
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
let
otherArgs = lib.attrsets.removeAttrs args [ "pname" "data" "repo" "releasePrefix" "isMultiArch" ];
inherit (stdenvNoCC.hostPlatform) system;
inherit (if isCrossArch then data else data.${system}) url hash;
inherit (if isCrossArch then data else data.${system} or (throw "gaugePlugins.${pname}: No source for system: ${system}")) url hash;
# Upstream uses a different naming scheme for platforms
systemMap = {
"x86_64-darwin" = "darwin.x86_64";
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/tools/misc/unixbench/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, libGLX
, coreutils
, unixtools
, runtimeShell
, targetPackages
, gnugrep
, gawk
Expand Down Expand Up @@ -89,7 +90,7 @@ stdenv.mkDerivation rec {

preFixup = ''
substituteInPlace $out/libexec/pgms/multi.sh \
--replace '/bin/sh "$' '${targetPackages.runtimeShell} "$'
--replace '/bin/sh "$' '${runtimeShell} "$'
substituteInPlace $out/bin/ubench \
--subst-var out
Expand Down
6 changes: 4 additions & 2 deletions pkgs/development/tools/nwjs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, atk
, autoPatchelfHook
, buildEnv
, buildPackages
, cairo
, cups
, dbus
Expand Down Expand Up @@ -32,7 +33,6 @@
, stdenv
, systemd
, udev
, wrapGAppsHook3
, xorg
}:

Expand Down Expand Up @@ -107,7 +107,9 @@ stdenv.mkDerivation {

nativeBuildInputs = [
autoPatchelfHook
(wrapGAppsHook3.override { inherit makeWrapper; })
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];

buildInputs = [ nwEnv ];
Expand Down
16 changes: 13 additions & 3 deletions pkgs/development/web/cypress/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
, gtk2
, gtk3
, lib
, buildPackages
, makeShellWrapper
, mesa
, nss
, stdenv
, udev
, unzip
, wrapGAppsHook3
, xorg
, darwin
}:
Expand Down Expand Up @@ -46,8 +46,18 @@ in stdenv.mkDerivation rec {
# don't remove runtime deps
dontPatchELF = true;

nativeBuildInputs = [ unzip makeShellWrapper ]
++ lib.optionals stdenv.isLinux [ autoPatchelfHook (wrapGAppsHook3.override { makeWrapper = makeShellWrapper; }) ];
nativeBuildInputs =
[
unzip
makeShellWrapper
]
++ lib.optionals stdenv.isLinux [
autoPatchelfHook
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
# Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset.
(buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; })
];


buildInputs = lib.optionals stdenv.isLinux (with xorg; [
libXScrnSaver
Expand Down

0 comments on commit 3876b1b

Please sign in to comment.