From 73a534c880661d918240d16eb65ad5f1a55bf02b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 14 Feb 2023 18:08:27 +0100 Subject: [PATCH] modemmanager: fix build We did not notice it was creating directories in /etc in sandbox due to Nix 2.12 regression. --- .../tools/networking/modemmanager/default.nix | 7 +++++++ .../no-dummy-dirs-in-sysconfdir.patch | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/tools/networking/modemmanager/no-dummy-dirs-in-sysconfdir.patch diff --git a/pkgs/tools/networking/modemmanager/default.nix b/pkgs/tools/networking/modemmanager/default.nix index 326e71075215..752cd74d77ab 100644 --- a/pkgs/tools/networking/modemmanager/default.nix +++ b/pkgs/tools/networking/modemmanager/default.nix @@ -33,6 +33,12 @@ stdenv.mkDerivation rec { hash = "sha256-OWP23EQ7a8rghhV7AC9yinCxRI0xwcntB5dl9XtgK6M="; }; + patches = [ + # Since /etc is the domain of NixOS, not Nix, we cannot install files there. + # But these are just placeholders so we do not need to install them at all. + ./no-dummy-dirs-in-sysconfdir.patch + ]; + nativeBuildInputs = [ meson ninja @@ -64,6 +70,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dudevdir=${placeholder "out"}/lib/udev" + "-Ddbus_policy_dir=${placeholder "out"}/share/dbus-1/system.d" "--sysconfdir=/etc" "--localstatedir=/var" "-Dvapi=true" diff --git a/pkgs/tools/networking/modemmanager/no-dummy-dirs-in-sysconfdir.patch b/pkgs/tools/networking/modemmanager/no-dummy-dirs-in-sysconfdir.patch new file mode 100644 index 000000000000..d293efa7b245 --- /dev/null +++ b/pkgs/tools/networking/modemmanager/no-dummy-dirs-in-sysconfdir.patch @@ -0,0 +1,20 @@ +diff --git a/data/dispatcher-connection/meson.build b/data/dispatcher-connection/meson.build +index 2e7ef8b4..e0f4aa66 100644 +--- a/data/dispatcher-connection/meson.build ++++ b/data/dispatcher-connection/meson.build +@@ -21,5 +21,4 @@ install_data( + ) + + mkdir_cmd = 'mkdir -p ${DESTDIR}@0@' +-meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_connectiondiruser)) + meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_connectiondirpackage)) +diff --git a/data/dispatcher-fcc-unlock/meson.build b/data/dispatcher-fcc-unlock/meson.build +index 5dc3b6a0..25a948a1 100644 +--- a/data/dispatcher-fcc-unlock/meson.build ++++ b/data/dispatcher-fcc-unlock/meson.build +@@ -39,5 +39,4 @@ foreach output, input: vidpids + endforeach + + mkdir_cmd = 'mkdir -p ${DESTDIR}@0@' +-meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_fccunlockdiruser)) + meson.add_install_script('sh', '-c', mkdir_cmd.format(mm_prefix / mm_fccunlockdirpackage))