push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
--- a/src/firewall/config/__init__.py.in
+++ b/src/firewall/config/__init__.py.in
@@ -80,7 +80,8 @@
FIREWALLD_POLICIES = path + "/policies"
-set_default_config_paths("/usr/lib/firewalld")
+import os
+set_default_config_paths(os.environ.get("NIX_FIREWALLD_CONFIG_PATH", "/usr/lib/firewalld"))
FIREWALLD_LOGFILE = "/var/log/firewalld"

View File

@@ -0,0 +1,14 @@
--- a/configure.ac
+++ b/configure.ac
@@ -152,8 +152,10 @@
AC_SUBST([GETTEXT_PACKAGE], '[PKG_NAME]')
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],)
+AM_GNU_GETTEXT_VERSION([0.22.5])
+AM_GNU_GETTEXT([external])
+
IT_PROG_INTLTOOL([0.35.0], [no-xml])
-AM_PO_SUBDIRS
AC_CONFIG_COMMANDS([xsl-cleanup],,[rm -f doc/xml/transform-*.xsl])

View File

@@ -0,0 +1,164 @@
{
lib,
stdenv,
fetchFromGitHub,
autoconf,
automake,
docbook_xml_dtd_42,
docbook-xsl-nons,
glib,
gobject-introspection,
gtk3,
intltool,
ipset,
iptables,
kdePackages,
kmod,
libnotify,
librsvg,
libxml2,
libxslt,
networkmanager,
networkmanagerapplet,
pkg-config,
python3,
qt6,
sysctl,
wrapGAppsNoGuiHook,
withGui ? false,
}:
let
pythonPath = python3.withPackages (
ps:
with ps;
[
dbus-python
nftables
pygobject3
]
++ lib.optionals withGui [
pyqt6
]
);
in
stdenv.mkDerivation rec {
pname = "firewalld";
version = "2.3.1";
src = fetchFromGitHub {
owner = "firewalld";
repo = "firewalld";
rev = "v${version}";
sha256 = "sha256-ONpyJJjIn5kEnkudZe4Nf67wdQgWa+2qEkT1nxRBDpI=";
};
patches = [
./add-config-path-env-var.patch
./respect-xml-catalog-files-var.patch
./specify-localedir.patch
./gettext-0.25.patch
];
postPatch = ''
substituteInPlace config/xmlschema/check.sh \
--replace-fail /usr/bin/ ""
for file in src/{firewall-offline-cmd.in,firewall/config/__init__.py.in} \
config/firewall-{applet,config}.desktop.in; do
substituteInPlace $file \
--replace-fail /usr "$out"
done
''
+ lib.optionalString withGui ''
substituteInPlace src/firewall-applet.in \
--replace-fail "/usr/bin/systemsettings" "${kdePackages.systemsettings}/bin/systemsettings" \
--replace-fail "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-connection-editor"
'';
nativeBuildInputs = [
autoconf
automake
docbook_xml_dtd_42
docbook-xsl-nons
glib
intltool
libxml2
libxslt
pkg-config
python3
python3.pkgs.wrapPython
wrapGAppsNoGuiHook
]
++ lib.optionals withGui [
qt6.wrapQtAppsHook
];
buildInputs = [
glib
gobject-introspection
ipset
iptables
kmod
networkmanager
pythonPath
sysctl
]
++ lib.optionals withGui [
gtk3
libnotify
librsvg
qt6.qtbase
];
preConfigure = ''
./autogen.sh
'';
ac_cv_path_MODPROBE = lib.getExe' kmod "modprobe";
ac_cv_path_RMMOD = lib.getExe' kmod "rmmod";
ac_cv_path_SYSCTL = lib.getExe' sysctl "sysctl";
configureFlags = [
"--with-iptables=${lib.getExe' iptables "iptables"}"
"--with-iptables-restore=${lib.getExe' iptables "iptables-restore"}"
"--with-ip6tables=${lib.getExe' iptables "ip6tables"}"
"--with-ip6tables-restore=${lib.getExe' iptables "ip6tables-restore"}"
"--with-ebtables=${lib.getExe' iptables "ebtables"}"
"--with-ebtables-restore=${lib.getExe' iptables "ebtables-restore"}"
"--with-ipset=${lib.getExe' ipset "ipset"}"
];
postInstall = ''
rm -r $out/share/firewalld/testsuite
''
+ lib.optionalString (!withGui) ''
rm $out/bin/firewall-{applet,config}
'';
dontWrapGApps = true;
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
''
+ lib.optionalString withGui ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
postFixup = ''
chmod +x $out/share/firewalld/*.py
patchShebangs --host $out/share/firewalld/*.py
wrapPythonProgramsIn "$out/bin" "$out ${pythonPath}"
'';
meta = {
description = "Firewall daemon with D-Bus interface";
homepage = "https://firewalld.org";
downloadPage = "https://github.com/firewalld/firewalld/releases";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ prince213 ];
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,13 @@
--- a/m4/jh_path_xml_catalog.m4
+++ b/m4/jh_path_xml_catalog.m4
@@ -40,8 +40,8 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
[
AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
- if $jh_found_xmlcatalog && \
- AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
+ # empty argument forces libxml to use XML_CATALOG_FILES variable
+ if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
AC_MSG_RESULT([found])
ifelse([$3],,,[$3
])dnl

View File

@@ -0,0 +1,12 @@
--- a/src/firewall/config/__init__.py.in
+++ b/src/firewall/config/__init__.py.in
@@ -19,6 +19,9 @@
DOMAIN = "firewalld"
import gettext
+locale.bindtextdomain(DOMAIN, "/usr/share/locale")
+gettext.bindtextdomain(DOMAIN, "/usr/share/locale")
+
gettext.install(domain=DOMAIN)
from . import dbus # noqa: F401