ryujinx-greemdev: init at 1.2.76 (#353897)
[NixPkgs.git] / pkgs / tools / networking / networkmanager / libnma / default.nix
blob84331343c09a4ed6011364f7b77690c3a056d56a
2   stdenv,
3   fetchurl,
4   meson,
5   mesonEmulatorHook,
6   ninja,
7   gettext,
8   gtk-doc,
9   pkg-config,
10   vala,
11   networkmanager,
12   gnome,
13   isocodes,
14   libxml2,
15   docbook_xsl,
16   docbook_xml_dtd_43,
17   mobile-broadband-provider-info,
18   gobject-introspection,
19   gtk3,
20   withGtk4 ? false,
21   gtk4,
22   withGnome ? true,
23   gcr_4,
24   glib,
25   lib,
26   _experimental-update-script-combinators,
27   makeHardcodeGsettingsPatch,
30 stdenv.mkDerivation rec {
31   pname = "libnma";
32   version = "1.10.6";
34   outputs = [
35     "out"
36     "dev"
37     "devdoc"
38   ];
40   src = fetchurl {
41     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
42     sha256 = "U6b7KxkK03xZhsrtPpi+3nw8YCOZ7k+TyPwFQwPXbas=";
43   };
45   patches = [
46     # Needed for wingpanel-indicator-network and switchboard-plug-network
47     ./hardcode-gsettings.patch
48   ];
50   nativeBuildInputs =
51     [
52       meson
53       ninja
54       gettext
55       pkg-config
56       gobject-introspection
57       gtk-doc
58       docbook_xsl
59       docbook_xml_dtd_43
60       libxml2
61       vala
62     ]
63     ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
64       mesonEmulatorHook
65     ];
67   buildInputs =
68     [
69       gtk3
70       networkmanager
71       isocodes
72       mobile-broadband-provider-info
73     ]
74     ++ lib.optionals withGtk4 [
75       gtk4
76     ]
77     ++ lib.optionals withGnome [
78       # advanced certificate chooser
79       gcr_4
80     ];
82   mesonFlags = [
83     "-Dgcr=${lib.boolToString withGnome}"
84     "-Dlibnma_gtk4=${lib.boolToString withGtk4}"
85   ];
87   postPatch = ''
88     substituteInPlace src/nma-ws/nma-eap.c --subst-var-by \
89       NM_APPLET_GSETTINGS ${glib.makeSchemaPath "$out" "$name"}
90   '';
92   postInstall = ''
93     glib-compile-schemas $out/share/glib-2.0/schemas
94   '';
96   passthru = {
97     hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
98       schemaIdToVariableMapping = {
99         "org.gnome.nm-applet.eap" = "NM_APPLET_GSETTINGS";
100       };
101       inherit src;
102     };
103     updateScript =
104       let
105         updateSource = gnome.updateScript {
106           packageName = "libnma";
107           versionPolicy = "odd-unstable";
108         };
109         updateGsettingsPatch = _experimental-update-script-combinators.copyAttrOutputToFile "libnma.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
110       in
111       _experimental-update-script-combinators.sequence [
112         updateSource
113         updateGsettingsPatch
114       ];
115   };
117   meta = with lib; {
118     homepage = "https://gitlab.gnome.org/GNOME/libnma";
119     description = "NetworkManager UI utilities (libnm version)";
120     license = licenses.gpl2Plus; # Mix of GPL and LPGL 2+
121     maintainers = teams.gnome.members;
122     platforms = platforms.linux;
123   };