From 66d58959130e9be9ec2a344df0fd4e6ec998c840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Kurucz?= Date: Mon, 2 Dec 2024 20:36:35 +0100 Subject: [PATCH] buildFHSEnv: fix cross compilation In particular, steam aarch64-linux -> x86_64-linux cross did not compile before. --- .../build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix | 8 ++++++-- pkgs/build-support/build-fhsenv-bubblewrap/default.nix | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix index ac154c98ab8a..a2d0bf610d80 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/buildFHSEnv.nix @@ -5,7 +5,7 @@ , writeText , writeShellScriptBin , pkgs -, pkgsi686Linux +, pkgsHostTarget }: { profile ? "" @@ -36,6 +36,10 @@ # /lib will link to /lib64 let + # The splicing code does not handle `pkgsi686Linux` well, so we have to be + # explicit about which package set it's coming from. + inherit (pkgsHostTarget) pkgsi686Linux; + name = if (args ? pname && args ? version) then "${args.pname}-${args.version}" else args.name; @@ -212,7 +216,7 @@ let ln -fsr $d/glib-2.0/schemas/*.xml $out/usr/share/glib-2.0/schemas ln -fsr $d/glib-2.0/schemas/*.gschema.override $out/usr/share/glib-2.0/schemas done - ${pkgs.glib.dev}/bin/glib-compile-schemas $out/usr/share/glib-2.0/schemas + ${pkgs.pkgsBuildBuild.glib.dev}/bin/glib-compile-schemas $out/usr/share/glib-2.0/schemas fi ${extraBuildCommands} diff --git a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix index 8bf5aebeb516..af1d4cd97072 100644 --- a/pkgs/build-support/build-fhsenv-bubblewrap/default.nix +++ b/pkgs/build-support/build-fhsenv-bubblewrap/default.nix @@ -4,7 +4,7 @@ , runCommandLocal , writeShellScript , glibc -, pkgsi686Linux +, pkgsHostTarget , runCommandCC , coreutils , bubblewrap @@ -42,6 +42,10 @@ let inherit (lib.attrsets) removeAttrs; + # The splicing code does not handle `pkgsi686Linux` well, so we have to be + # explicit about which package set it's coming from. + inherit (pkgsHostTarget) pkgsi686Linux; + name = args.name or "${args.pname}-${args.version}"; executableName = args.pname or args.name; # we don't know which have been supplied, and want to avoid defaulting missing attrs to null. Passed into runCommandLocal