From ee19ecd464c92be604bc98433b985b5dc233637f Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Mon, 24 Mar 2025 23:36:52 +0800 Subject: [PATCH] firewalld: wrap gui programs with qt6 --- pkgs/by-name/fi/firewalld/package.nix | 53 ++++++++++++++++----------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/pkgs/by-name/fi/firewalld/package.nix b/pkgs/by-name/fi/firewalld/package.nix index dae4be7bc773..9c54afb0f871 100644 --- a/pkgs/by-name/fi/firewalld/package.nix +++ b/pkgs/by-name/fi/firewalld/package.nix @@ -21,6 +21,7 @@ networkmanagerapplet, pkg-config, python3, + qt6, sysctl, wrapGAppsNoGuiHook, withGui ? false, @@ -72,24 +73,28 @@ stdenv.mkDerivation rec { --replace-fail "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-connection-editor" ''; - nativeBuildInputs = [ - autoconf - automake - docbook_xml_dtd_42 - docbook-xsl-nons - glib - intltool - ipset - iptables - kmod - libxml2 - libxslt - pkg-config - python3 - python3.pkgs.wrapPython - sysctl - wrapGAppsNoGuiHook - ]; + nativeBuildInputs = + [ + autoconf + automake + docbook_xml_dtd_42 + docbook-xsl-nons + glib + intltool + ipset + iptables + kmod + libxml2 + libxslt + pkg-config + python3 + python3.pkgs.wrapPython + sysctl + wrapGAppsNoGuiHook + ] + ++ lib.optionals withGui [ + qt6.wrapQtAppsHook + ]; buildInputs = [ @@ -105,6 +110,7 @@ stdenv.mkDerivation rec { ++ lib.optionals withGui [ gtk3 libnotify + qt6.qtbase ]; preConfigure = '' @@ -116,10 +122,15 @@ stdenv.mkDerivation rec { ''; dontWrapGApps = true; + dontWrapQtApps = true; - preFixup = '' - makeWrapperArgs+=("''${gappsWrapperArgs[@]}") - ''; + preFixup = + '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + '' + + lib.optionalString withGui '' + makeWrapperArgs+=("''${qtWrapperArgs[@]}") + ''; postFixup = '' chmod +x $out/share/firewalld/*.py $out/share/firewalld/testsuite/python/*.py $out/share/firewalld/testsuite/{,integration/}testsuite