evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / fi / firewalld / package.nix
blob70fe4b26f6005b175d84069827d988afd4a042c8
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , autoreconfHook
5 , bash
6 , docbook_xml_dtd_42
7 , docbook-xsl-nons
8 , glib
9 , gobject-introspection
10 , gtk3
11 , intltool
12 , libnotify
13 , libxml2
14 , libxslt
15 , networkmanagerapplet
16 , pkg-config
17 , python3
18 , wrapGAppsNoGuiHook
19 , withGui ? false
22 let
23   pythonPath = python3.withPackages (ps: with ps; [
24     dbus-python
25     nftables
26     pygobject3
27   ] ++ lib.optionals withGui [
28     pyqt5
29     pyqt5-sip
30   ]);
32 stdenv.mkDerivation rec {
33   pname = "firewalld";
34   version = "2.2.3";
36   src = fetchFromGitHub {
37     owner = "firewalld";
38     repo = "firewalld";
39     rev = "v${version}";
40     sha256 = "sha256-ugDleco/Ep+10ku+5xcW4zq/RrhruZCRlX0zKeXzLhg=";
41   };
43   patches = [
44     ./respect-xml-catalog-files-var.patch
45   ];
47   postPatch = ''
48     substituteInPlace src/firewall/config/__init__.py.in \
49       --replace "/usr/share" "$out/share"
51     for file in config/firewall-{applet,config}.desktop.in; do
52       substituteInPlace $file \
53         --replace "/usr/bin/" "$out/bin/"
54     done
55   '' + lib.optionalString withGui ''
56     substituteInPlace src/firewall-applet.in \
57       --replace "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-conenction-editor"
58   '';
60   nativeBuildInputs = [
61     autoreconfHook
62     docbook_xml_dtd_42
63     docbook-xsl-nons
64     glib
65     intltool
66     libxml2
67     libxslt
68     pkg-config
69     python3
70     python3.pkgs.wrapPython
71   ] ++ lib.optionals withGui [
72     gobject-introspection
73     wrapGAppsNoGuiHook
74   ];
76   buildInputs = [
77     bash
78     glib
79   ] ++ lib.optionals withGui [
80     gtk3
81     libnotify
82     pythonPath
83   ];
85   dontWrapGApps = true;
87   preFixup = lib.optionalString withGui ''
88     makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
89   '';
91   postFixup = ''
92     chmod +x $out/share/firewalld/*.py $out/share/firewalld/testsuite/python/*.py $out/share/firewalld/testsuite/{,integration/}testsuite
93     patchShebangs --host $out/share/firewalld/testsuite/{,integration/}testsuite $out/share/firewalld/*.py
94     wrapPythonProgramsIn "$out/bin" "$out ${pythonPath}"
95     wrapPythonProgramsIn "$out/share/firewalld/testsuite/python" "$out ${pythonPath}"
96   '';
98   meta = with lib; {
99     description = "Firewall daemon with D-Bus interface";
100     homepage = "https://github.com/firewalld/firewalld";
101     license = licenses.gpl2Plus;
102     maintainers = [ ];
103   };