2020-03-15 15:50:26 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, meson
|
2022-08-07 00:48:42 +02:00
|
|
|
, mesonEmulatorHook
|
2020-03-15 15:50:26 +01:00
|
|
|
, ninja
|
|
|
|
, gettext
|
|
|
|
, gtk-doc
|
|
|
|
, pkg-config
|
|
|
|
, vala
|
|
|
|
, networkmanager
|
2021-05-07 23:18:14 +02:00
|
|
|
, gnome
|
2020-03-15 15:50:26 +01:00
|
|
|
, isocodes
|
|
|
|
, libxml2
|
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, mobile-broadband-provider-info
|
|
|
|
, gobject-introspection
|
|
|
|
, gtk3
|
2022-02-19 04:36:14 +01:00
|
|
|
, withGtk4 ? false
|
|
|
|
, gtk4
|
2020-03-15 15:50:26 +01:00
|
|
|
, withGnome ? true
|
2022-12-03 23:46:39 +01:00
|
|
|
, gcr_4
|
2020-03-15 15:50:26 +01:00
|
|
|
, glib
|
2020-10-14 01:46:17 +02:00
|
|
|
, lib
|
2023-02-01 23:37:36 +01:00
|
|
|
, _experimental-update-script-combinators
|
|
|
|
, makeHardcodeGsettingsPatch
|
2020-03-15 15:50:26 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libnma";
|
2023-02-01 23:37:36 +01:00
|
|
|
version = "1.10.6";
|
2020-03-15 15:50:26 +01:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-15 10:19:50 +01:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2023-02-01 23:37:36 +01:00
|
|
|
sha256 = "U6b7KxkK03xZhsrtPpi+3nw8YCOZ7k+TyPwFQwPXbas=";
|
2020-03-15 15:50:26 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Needed for wingpanel-indicator-network and switchboard-plug-network
|
|
|
|
./hardcode-gsettings.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
gettext
|
|
|
|
pkg-config
|
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
docbook_xsl
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
libxml2
|
|
|
|
vala
|
2022-08-07 00:48:42 +02:00
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2020-03-15 15:50:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gtk3
|
|
|
|
networkmanager
|
|
|
|
isocodes
|
|
|
|
mobile-broadband-provider-info
|
2022-02-19 04:36:14 +01:00
|
|
|
] ++ lib.optionals withGtk4 [
|
|
|
|
gtk4
|
2021-01-15 10:19:50 +01:00
|
|
|
] ++ lib.optionals withGnome [
|
2020-03-15 15:50:26 +01:00
|
|
|
# advanced certificate chooser
|
2022-12-03 23:46:39 +01:00
|
|
|
gcr_4
|
2020-03-15 15:50:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
mesonFlags = [
|
2020-10-14 01:46:17 +02:00
|
|
|
"-Dgcr=${lib.boolToString withGnome}"
|
2022-02-19 04:36:14 +01:00
|
|
|
"-Dlibnma_gtk4=${lib.boolToString withGtk4}"
|
2020-03-15 15:50:26 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/nma-ws/nma-eap.c --subst-var-by \
|
2022-08-07 00:48:42 +02:00
|
|
|
NM_APPLET_GSETTINGS ${glib.makeSchemaPath "$out" "$name"}
|
2020-03-15 15:50:26 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
glib-compile-schemas $out/share/glib-2.0/schemas
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
2023-02-01 23:37:36 +01:00
|
|
|
hardcodeGsettingsPatch = makeHardcodeGsettingsPatch {
|
|
|
|
schemaIdToVariableMapping = {
|
|
|
|
"org.gnome.nm-applet.eap" = "NM_APPLET_GSETTINGS";
|
|
|
|
};
|
|
|
|
inherit src;
|
2020-03-15 15:50:26 +01:00
|
|
|
};
|
2023-02-01 23:37:36 +01:00
|
|
|
updateScript =
|
|
|
|
let
|
|
|
|
updateSource = gnome.updateScript {
|
|
|
|
packageName = "libnma";
|
|
|
|
versionPolicy = "odd-unstable";
|
|
|
|
};
|
|
|
|
updateGsettingsPatch = _experimental-update-script-combinators.copyAttrOutputToFile "libnma.hardcodeGsettingsPatch" ./hardcode-gsettings.patch;
|
|
|
|
in
|
|
|
|
_experimental-update-script-combinators.sequence [
|
|
|
|
updateSource
|
|
|
|
updateGsettingsPatch
|
|
|
|
];
|
2020-03-15 15:50:26 +01:00
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-03-15 15:50:26 +01:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/libnma";
|
|
|
|
description = "NetworkManager UI utilities (libnm version)";
|
|
|
|
license = licenses.gpl2Plus; # Mix of GPL and LPGL 2+
|
|
|
|
maintainers = teams.gnome.members;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|