From f933581b0ccd2e611383ba50ff16af123e9ce212 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 7 Mar 2023 12:15:18 +0000 Subject: [PATCH] cross compilation: fwupd8: reduce overlapping buildInputs/nativeBuildInputs --- hosts/common/cross/default.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hosts/common/cross/default.nix b/hosts/common/cross/default.nix index a88f1b0d..4b1aaa5a 100644 --- a/hosts/common/cross/default.nix +++ b/hosts/common/cross/default.nix @@ -126,6 +126,7 @@ let depsBuildBuild = upstream.depsBuildBuild or [] ++ depsBuildBuild; }); addNativeInputs = nativeBuildInputs: addInputs { inherit nativeBuildInputs; }; + addBuildInputs = buildInputs: addInputs { inherit buildInputs; }; mvToNativeInputs = nativeBuildInputs: mvInputs { inherit nativeBuildInputs; }; mvToBuildInputs = buildInputs: mvInputs { inherit buildInputs; }; rmInputs = { buildInputs ? [], nativeBuildInputs ? [] }: pkg: pkg.overrideAttrs (upstream: { @@ -550,11 +551,16 @@ in # # next.mesonEmulatorHook # # ]; # }); - fwupd = prev.fwupd.overrideAttrs (orig: { - # solves (meson) "Run-time dependency libgcab-1.0 found: NO (tried pkgconfig and cmake)", and others. - buildInputs = orig.buildInputs ++ [ next.gcab next.gnutls ]; - mesonFlags = (lib.remove "-Ddocs=enabled" orig.mesonFlags) ++ [ "-Ddocs=disabled" ]; - outputs = lib.remove "devdoc" orig.outputs; + # solves (meson) "Run-time dependency libgcab-1.0 found: NO (tried pkgconfig and cmake)", and others. + fwupd = (addBuildInputs + [ next.gcab ] + (mvToBuildInputs [ next.gnutls ] prev.fwupd) + ).overrideAttrs (upstream: { + # XXX: gcab is apparently needed as both build and native input + # can't build docs w/o adding `gi-docgen` to ldpath, but that adds a new glibc to the ldpath + # which causes host binaries to be linked against the build libc & fail + mesonFlags = (lib.remove "-Ddocs=enabled" upstream.mesonFlags) ++ [ "-Ddocs=disabled" ]; + outputs = lib.remove "devdoc" upstream.outputs; }); # fwupd = prev.fwupd.override { # # solves missing libgcab-1.0;