stdenv: fix missing dependencies in __sandboxProfile and __impureHostDeps

Fixes: 7f3ca3e21a (stdenv: Fix handling of dependencies and hooks)
Fixes: #237458
This commit is contained in:
David McFarland 2024-02-25 20:02:10 -04:00
parent dd424ee92c
commit c642665a04
4 changed files with 7 additions and 15 deletions

View File

@ -84,11 +84,6 @@ in stdenv'.mkDerivation (finalAttrs: {
"--set-default QT_QPA_PLATFORM xcb" "--set-default QT_QPA_PLATFORM xcb"
]; ];
# HACK `propagatedSandboxProfile` does not appear to actually propagate the
# sandbox profile from `qtbase`, see:
# https://github.com/NixOS/nixpkgs/issues/237458
sandboxProfile = toString qtbase.__propagatedSandboxProfile or null;
nativeBuildInputs = [ nativeBuildInputs = [
wrapQtAppsHook wrapQtAppsHook
cmake cmake

View File

@ -23,9 +23,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ qmake qttools wrapQtAppsHook ]; nativeBuildInputs = [ qmake qttools wrapQtAppsHook ];
# HACK `propagatedSandboxProfile` does not appear to actually propagate the sandbox profile from `qt5.qtbase`
sandboxProfile = toString qtbase.__propagatedSandboxProfile;
qmakeFlags = [ qmakeFlags = [
# setup hook only sets QMAKE_LRELEASE, set QMAKE_LUPDATE too: # setup hook only sets QMAKE_LRELEASE, set QMAKE_LUPDATE too:
"QMAKE_LUPDATE=${qttools.dev}/bin/lupdate" "QMAKE_LUPDATE=${qttools.dev}/bin/lupdate"

View File

@ -23,9 +23,6 @@ stdenv.mkDerivation rec {
dontWrapQtApps = true; dontWrapQtApps = true;
# HACK `propagatedSandboxProfile` does not appear to actually propagate the sandbox profile from `qtbase`
sandboxProfile = toString qtbase.__propagatedSandboxProfile or null;
cmakeFlags = [ cmakeFlags = [
"-DBUILD_WITH_QT6=${if lib.versions.major qtbase.version == "6" then "ON" else "OFF"}" "-DBUILD_WITH_QT6=${if lib.versions.major qtbase.version == "6" then "ON" else "OFF"}"
"-DQT_TRANSLATIONS_DIR=share/qt/translations" "-DQT_TRANSLATIONS_DIR=share/qt/translations"

View File

@ -413,25 +413,28 @@ else let
requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.gcc.arch}" ]; requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.gcc.arch}" ];
} // optionalAttrs (stdenv.buildPlatform.isDarwin) ( } // optionalAttrs (stdenv.buildPlatform.isDarwin) (
let let
allDependencies = concatLists (concatLists dependencies);
allPropagatedDependencies = concatLists (concatLists propagatedDependencies);
computedSandboxProfile = computedSandboxProfile =
concatMap (input: input.__propagatedSandboxProfile or []) concatMap (input: input.__propagatedSandboxProfile or [])
(stdenv.extraNativeBuildInputs (stdenv.extraNativeBuildInputs
++ stdenv.extraBuildInputs ++ stdenv.extraBuildInputs
++ concatLists dependencies); ++ allDependencies);
computedPropagatedSandboxProfile = computedPropagatedSandboxProfile =
concatMap (input: input.__propagatedSandboxProfile or []) concatMap (input: input.__propagatedSandboxProfile or [])
(concatLists propagatedDependencies); allPropagatedDependencies;
computedImpureHostDeps = computedImpureHostDeps =
unique (concatMap (input: input.__propagatedImpureHostDeps or []) unique (concatMap (input: input.__propagatedImpureHostDeps or [])
(stdenv.extraNativeBuildInputs (stdenv.extraNativeBuildInputs
++ stdenv.extraBuildInputs ++ stdenv.extraBuildInputs
++ concatLists dependencies)); ++ allDependencies));
computedPropagatedImpureHostDeps = computedPropagatedImpureHostDeps =
unique (concatMap (input: input.__propagatedImpureHostDeps or []) unique (concatMap (input: input.__propagatedImpureHostDeps or [])
(concatLists propagatedDependencies)); allPropagatedDependencies);
in { in {
inherit __darwinAllowLocalNetworking; inherit __darwinAllowLocalNetworking;
# TODO: remove `unique` once nix has a list canonicalization primitive # TODO: remove `unique` once nix has a list canonicalization primitive