From a70951ade35635c56c6f9f3ceaf1fb8eb48876e8 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 25 Sep 2024 21:39:54 +0300 Subject: [PATCH 1/6] appflowy: Fix missing attribute on `aarch64-linux` --- pkgs/applications/office/appflowy/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/office/appflowy/default.nix b/pkgs/applications/office/appflowy/default.nix index f3a7ea76c533d59..0790cb44d1f336e 100644 --- a/pkgs/applications/office/appflowy/default.nix +++ b/pkgs/applications/office/appflowy/default.nix @@ -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"; From 5176f640ee631ef58dafaac6a9fe689e122f8041 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 25 Sep 2024 23:48:05 +0300 Subject: [PATCH 2/6] cups-idprt-{barcode,mt888,mt890,sp900,tspl}: Fix missing attribute on `aarch64-linux` `getAttr` has a slightly better performance but it's not possible to throw with it so one would have to do `builtins.hasAttr` first which makes that methods performance worse than string interpolation and `or throw` --- pkgs/by-name/cu/cups-idprt-barcode/package.nix | 11 +++++++---- pkgs/by-name/cu/cups-idprt-mt888/package.nix | 11 +++++++---- pkgs/by-name/cu/cups-idprt-mt890/package.nix | 11 +++++++---- pkgs/by-name/cu/cups-idprt-sp900/package.nix | 11 +++++++---- pkgs/by-name/cu/cups-idprt-tspl/package.nix | 11 +++++++---- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/cu/cups-idprt-barcode/package.nix b/pkgs/by-name/cu/cups-idprt-barcode/package.nix index 1f9bb0b168f91a8..a5e3a85b5a943e0 100644 --- a/pkgs/by-name/cu/cups-idprt-barcode/package.nix +++ b/pkgs/by-name/cu/cups-idprt-barcode/package.nix @@ -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 diff --git a/pkgs/by-name/cu/cups-idprt-mt888/package.nix b/pkgs/by-name/cu/cups-idprt-mt888/package.nix index 27441a467b30322..0fa4fd146d0605b 100644 --- a/pkgs/by-name/cu/cups-idprt-mt888/package.nix +++ b/pkgs/by-name/cu/cups-idprt-mt888/package.nix @@ -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 diff --git a/pkgs/by-name/cu/cups-idprt-mt890/package.nix b/pkgs/by-name/cu/cups-idprt-mt890/package.nix index ca3baacbcfe462d..96ca74b35ee6017 100644 --- a/pkgs/by-name/cu/cups-idprt-mt890/package.nix +++ b/pkgs/by-name/cu/cups-idprt-mt890/package.nix @@ -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 diff --git a/pkgs/by-name/cu/cups-idprt-sp900/package.nix b/pkgs/by-name/cu/cups-idprt-sp900/package.nix index ed07c4fc36be4eb..34243a325ee723e 100644 --- a/pkgs/by-name/cu/cups-idprt-sp900/package.nix +++ b/pkgs/by-name/cu/cups-idprt-sp900/package.nix @@ -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 diff --git a/pkgs/by-name/cu/cups-idprt-tspl/package.nix b/pkgs/by-name/cu/cups-idprt-tspl/package.nix index 60aa4c8c80d81e6..f165015c14f4f52 100644 --- a/pkgs/by-name/cu/cups-idprt-tspl/package.nix +++ b/pkgs/by-name/cu/cups-idprt-tspl/package.nix @@ -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 From 976e5387d2c2a43430c8214f7e79d466de4d64f0 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 26 Sep 2024 03:46:28 +0300 Subject: [PATCH 3/6] treewide: Fix `error: makeWrapper/makeShellWrapper must be in nativeBuildInputs` On cross --- pkgs/applications/editors/vscode/generic.nix | 3 ++- .../networking/browsers/brave/make-brave.nix | 6 ++++-- .../signal-desktop/generic.nix | 7 ++++--- .../version-management/gitkraken/default.nix | 6 ++++-- pkgs/by-name/gi/github-desktop/package.nix | 7 ++++--- pkgs/by-name/pa/paper-plane/package.nix | 4 ++-- pkgs/development/tools/nwjs/default.nix | 6 ++++-- pkgs/development/web/cypress/default.nix | 16 +++++++++++++--- 8 files changed, 37 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index defae3cf961710a..1c5fe1a56a424d8 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -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; diff --git a/pkgs/applications/networking/browsers/brave/make-brave.nix b/pkgs/applications/networking/browsers/brave/make-brave.nix index e94e1a93bf72314..2ea95693a9aed8f 100644 --- a/pkgs/applications/networking/browsers/brave/make-brave.nix +++ b/pkgs/applications/networking/browsers/brave/make-brave.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, wrapGAppsHook3, makeWrapper +{ lib, stdenv, fetchurl, buildPackages , alsa-lib , at-spi2-atk , at-spi2-core @@ -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 = [ diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix index 49df948196568ab..97abf0e749f66a9 100644 --- a/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix +++ b/pkgs/applications/networking/instant-messengers/signal-desktop/generic.nix @@ -8,8 +8,7 @@ , asar , rsync , python3 -, wrapGAppsHook3 -, makeWrapper +, buildPackages , nixosTests , gtk3 , atk @@ -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 = [ diff --git a/pkgs/applications/version-management/gitkraken/default.nix b/pkgs/applications/version-management/gitkraken/default.nix index 3e2206aa633bcbd..7d35f1efbb58c63 100644 --- a/pkgs/applications/version-management/gitkraken/default.nix +++ b/pkgs/applications/version-management/gitkraken/default.nix @@ -37,7 +37,7 @@ makeDesktopItem, openssl, wrapGAppsHook3, - makeShellWrapper, + buildPackages, at-spi2-atk, at-spi2-core, libuuid, @@ -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 diff --git a/pkgs/by-name/gi/github-desktop/package.nix b/pkgs/by-name/gi/github-desktop/package.nix index cbd89cda3c21bb3..88f8b5620b45d3a 100644 --- a/pkgs/by-name/gi/github-desktop/package.nix +++ b/pkgs/by-name/gi/github-desktop/package.nix @@ -2,8 +2,7 @@ , lib , fetchurl , autoPatchelfHook -, wrapGAppsHook3 -, makeWrapper +, buildPackages , gnome-keyring , libsecret , git @@ -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 = [ diff --git a/pkgs/by-name/pa/paper-plane/package.nix b/pkgs/by-name/pa/paper-plane/package.nix index 228c4aa638b08da..2028e7a848f20e8 100644 --- a/pkgs/by-name/pa/paper-plane/package.nix +++ b/pkgs/by-name/pa/paper-plane/package.nix @@ -1,7 +1,6 @@ { lib , fetchFromGitHub , gtk4 -, wrapGAppsHook3 , libadwaita , tdlib , rlottie @@ -18,6 +17,7 @@ , libshumate , gst_all_1 , darwin +, buildPackages }: let @@ -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 diff --git a/pkgs/development/tools/nwjs/default.nix b/pkgs/development/tools/nwjs/default.nix index ff1fae302d16959..408584de712e856 100644 --- a/pkgs/development/tools/nwjs/default.nix +++ b/pkgs/development/tools/nwjs/default.nix @@ -3,6 +3,7 @@ , atk , autoPatchelfHook , buildEnv +, buildPackages , cairo , cups , dbus @@ -32,7 +33,6 @@ , stdenv , systemd , udev -, wrapGAppsHook3 , xorg }: @@ -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 ]; diff --git a/pkgs/development/web/cypress/default.nix b/pkgs/development/web/cypress/default.nix index 856b31af1565ad9..2f3b8cf20808d8f 100644 --- a/pkgs/development/web/cypress/default.nix +++ b/pkgs/development/web/cypress/default.nix @@ -4,13 +4,13 @@ , gtk2 , gtk3 , lib +, buildPackages , makeShellWrapper , mesa , nss , stdenv , udev , unzip -, wrapGAppsHook3 , xorg , darwin }: @@ -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 From 5f62b2c546a10071e58acf3b39f59442cb7ef01f Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 26 Sep 2024 03:57:33 +0300 Subject: [PATCH 4/6] cudaPackages.tensorrt: Fix `attribute 'lib' missing` on `aarch64-linux` There should be no attribute missing errors as they cannot be handled. --- pkgs/development/cuda-modules/tensorrt/fixup.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/cuda-modules/tensorrt/fixup.nix b/pkgs/development/cuda-modules/tensorrt/fixup.nix index 0d52c91320c4787..aab6d8f3207968c 100644 --- a/pkgs/development/cuda-modules/tensorrt/fixup.nix +++ b/pkgs/development/cuda-modules/tensorrt/fixup.nix @@ -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 "") From 68432605ef009228c32e5d70c60ede6dbdce81ca Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 26 Sep 2024 04:10:26 +0300 Subject: [PATCH 5/6] gaugePlugins.go: Fix `error: attribute 'aarch64-linux' missing` --- pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix b/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix index acf902e1b79dfac..71f88a2c40ae67d 100644 --- a/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix +++ b/pkgs/development/tools/gauge/plugins/make-gauge-plugin.nix @@ -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"; From 3194fb792064d6135053d1f8bcd0c561d2078998 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 27 Sep 2024 01:11:30 +0300 Subject: [PATCH 6/6] unixbench: No need to use `targetPackages` here causes eval error on cross --- pkgs/development/tools/misc/unixbench/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/misc/unixbench/default.nix b/pkgs/development/tools/misc/unixbench/default.nix index d5f060af82cf52f..7721a2648b359c9 100644 --- a/pkgs/development/tools/misc/unixbench/default.nix +++ b/pkgs/development/tools/misc/unixbench/default.nix @@ -9,6 +9,7 @@ , libGLX , coreutils , unixtools +, runtimeShell , targetPackages , gnugrep , gawk @@ -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