Merge pull request #308830 from tie/systemd-macos-sandbox

systemd: fix build in macOS sandbox
This commit is contained in:
Florian Klink 2024-05-25 23:00:07 +03:00 committed by GitHub
commit 032c429b4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -501,6 +501,12 @@ stdenv.mkDerivation (finalAttrs: {
(lib.mesonOption "default-hierarchy" "unified")
(lib.mesonOption "kmod-path" "${kmod}/bin/kmod")
# Attempts to check /usr/sbin and that fails in macOS sandbox because
# permission is denied. If /usr/sbin is not a symlink, it defaults to true.
# We set it to false since stdenv moves sbin/* to bin and creates a symlink,
# that is, we do not have split bin.
(lib.mesonOption "split-bin" "false")
# D-Bus
(lib.mesonOption "dbuspolicydir" "${placeholder "out"}/share/dbus-1/system.d")
(lib.mesonOption "dbussessionservicedir" "${placeholder "out"}/share/dbus-1/services")
@ -815,6 +821,9 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace $i --replace /bin/false ${coreutils}/bin/false
done
# For compatibility with dependents that use sbin instead of bin.
ln -s bin "$out/sbin"
rm -rf $out/etc/rpm
'' + lib.optionalString (!withKernelInstall) ''
# "kernel-install" shouldn't be used on NixOS.