diff --git a/packaging/components.nix b/packaging/components.nix index cd1d219b8..c3c5fb68e 100644 --- a/packaging/components.nix +++ b/packaging/components.nix @@ -173,6 +173,17 @@ let outputs = prevAttrs.outputs or [ "out" ] ++ [ "dev" ]; }; + fixupStaticLayer = finalAttrs: prevAttrs: { + postFixup = + prevAttrs.postFixup or "" + + lib.optionalString (stdenv.hostPlatform.isStatic) '' + # HACK: Otherwise the result will have the entire buildInputs closure + # injected by the pkgsStatic stdenv + # + rm -f $out/nix-support/propagated-build-inputs + ''; + }; + # Work around weird `--as-needed` linker behavior with BSD, see # https://github.com/mesonbuild/meson/issues/3593 bsdNoLinkAsNeeded = @@ -307,6 +318,7 @@ in scope.sourceLayer setVersionLayer mesonLayer + fixupStaticLayer scope.mesonComponentOverrides ]; mkMesonExecutable = mkPackageBuilder [ @@ -316,6 +328,7 @@ in setVersionLayer mesonLayer mesonBuildLayer + fixupStaticLayer scope.mesonComponentOverrides ]; mkMesonLibrary = mkPackageBuilder [ @@ -326,6 +339,7 @@ in setVersionLayer mesonBuildLayer mesonLibraryLayer + fixupStaticLayer scope.mesonComponentOverrides ];