2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchurl, substituteAll, intltool, pkg-config, fetchpatch, dbus
|
2021-05-07 21:18:14 +00:00
|
|
|
, gnome, systemd, libuuid, polkit, gnutls, ppp, dhcp, iptables, python3, vala
|
2019-04-20 03:26:57 +00:00
|
|
|
, libgcrypt, dnsmasq, bluez5, readline, libselinux, audit
|
2018-12-02 11:41:15 +00:00
|
|
|
, gobject-introspection, modemmanager, openresolv, libndp, newt, libsoup
|
2019-06-16 19:59:06 +00:00
|
|
|
, ethtool, gnused, iputils, kmod, jansson, gtk-doc, libxslt
|
2019-04-20 03:26:57 +00:00
|
|
|
, docbook_xsl, docbook_xml_dtd_412, docbook_xml_dtd_42, docbook_xml_dtd_43
|
2019-12-23 03:02:09 +00:00
|
|
|
, openconnect, curl, meson, ninja, libpsl, mobile-broadband-provider-info, runtimeShell }:
|
2011-01-03 18:01:10 +00:00
|
|
|
|
2018-03-07 05:09:48 +00:00
|
|
|
let
|
2019-04-20 03:26:57 +00:00
|
|
|
pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
|
2018-03-07 05:09:48 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2021-03-08 15:28:44 +00:00
|
|
|
pname = "networkmanager";
|
2021-03-20 11:32:44 +00:00
|
|
|
version = "1.30.2";
|
2011-01-03 18:01:10 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-15 09:19:50 +00:00
|
|
|
url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
|
2021-03-20 11:32:44 +00:00
|
|
|
sha256 = "sha256-DI6A53h3hg5KTmq0oPfNwRhuNWtlsEKnUYlxiLiJRNI=";
|
2011-01-03 18:01:10 +00:00
|
|
|
};
|
|
|
|
|
2019-04-20 03:26:57 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" "man" "doc" ];
|
2012-06-16 19:09:30 +00:00
|
|
|
|
2011-09-10 19:23:26 +00:00
|
|
|
# Right now we hardcode quite a few paths at build time. Probably we should
|
|
|
|
# patch networkmanager to allow passing these path in config file. This will
|
|
|
|
# remove unneeded build-time dependencies.
|
2019-04-20 03:26:57 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Ddhclient=${dhcp}/bin/dhclient"
|
|
|
|
"-Ddnsmasq=${dnsmasq}/bin/dnsmasq"
|
2011-09-10 19:23:26 +00:00
|
|
|
# Upstream prefers dhclient, so don't add dhcpcd to the closure
|
2019-04-20 03:26:57 +00:00
|
|
|
"-Ddhcpcd=no"
|
2019-04-27 00:22:16 +00:00
|
|
|
"-Ddhcpcanon=no"
|
2019-04-20 03:26:57 +00:00
|
|
|
"-Dpppd=${ppp}/bin/pppd"
|
|
|
|
"-Diptables=${iptables}/bin/iptables"
|
2018-12-22 20:22:20 +00:00
|
|
|
# to enable link-local connections
|
2019-04-20 03:26:57 +00:00
|
|
|
"-Dudev_dir=${placeholder "out"}/lib/udev"
|
|
|
|
"-Dresolvconf=${openresolv}/bin/resolvconf"
|
2019-09-13 23:02:38 +00:00
|
|
|
"-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d"
|
2019-04-20 03:26:57 +00:00
|
|
|
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
|
|
|
"-Dkernel_firmware_dir=/run/current-system/firmware"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"-Dcrypto=gnutls"
|
|
|
|
"-Dsession_tracking=systemd"
|
|
|
|
"-Dmodem_manager=true"
|
|
|
|
"-Dnmtui=true"
|
|
|
|
"-Ddocs=true"
|
|
|
|
"-Dtests=no"
|
|
|
|
"-Dqt=false"
|
2021-03-08 12:54:34 +00:00
|
|
|
"-Dpolkit_agent_helper_1=/run/wrappers/bin/polkit-agent-helper-1"
|
2019-04-23 03:12:53 +00:00
|
|
|
# Allow using iwd when configured to do so
|
|
|
|
"-Diwd=true"
|
2019-04-27 00:53:27 +00:00
|
|
|
"-Dlibaudit=yes-disabled-by-default"
|
2020-07-14 12:01:24 +00:00
|
|
|
# We don't use firewalld in NixOS
|
|
|
|
"-Dfirewalld_zone=false"
|
2014-02-13 17:03:06 +00:00
|
|
|
];
|
2011-09-10 19:23:26 +00:00
|
|
|
|
2017-04-04 12:16:59 +00:00
|
|
|
patches = [
|
2018-07-05 20:30:53 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
2021-03-08 12:54:34 +00:00
|
|
|
inherit iputils kmod openconnect ethtool gnused systemd;
|
2019-12-23 03:02:09 +00:00
|
|
|
inherit runtimeShell;
|
2018-07-05 20:30:53 +00:00
|
|
|
})
|
|
|
|
|
2019-04-20 03:26:57 +00:00
|
|
|
# Meson does not support using different directories during build and
|
|
|
|
# for installation like Autotools did with flags passed to make install.
|
|
|
|
./fix-install-paths.patch
|
2017-04-04 12:16:59 +00:00
|
|
|
];
|
2016-10-16 18:29:18 +00:00
|
|
|
|
2018-07-05 20:30:53 +00:00
|
|
|
buildInputs = [
|
2019-12-23 03:02:09 +00:00
|
|
|
systemd libselinux audit libpsl libuuid polkit ppp libndp curl mobile-broadband-provider-info
|
2018-12-02 11:41:15 +00:00
|
|
|
bluez5 dnsmasq gobject-introspection modemmanager readline newt libsoup jansson
|
2018-07-05 20:30:53 +00:00
|
|
|
];
|
2011-09-10 19:23:26 +00:00
|
|
|
|
2019-09-13 23:02:38 +00:00
|
|
|
propagatedBuildInputs = [ gnutls libgcrypt ];
|
2011-09-14 15:50:01 +00:00
|
|
|
|
2019-04-20 03:26:57 +00:00
|
|
|
nativeBuildInputs = [
|
2021-01-17 03:51:22 +00:00
|
|
|
meson ninja intltool pkg-config
|
2019-09-13 23:02:38 +00:00
|
|
|
vala gobject-introspection dbus
|
2019-04-20 03:26:57 +00:00
|
|
|
# Docs
|
|
|
|
gtk-doc libxslt docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 pythonForDocs
|
|
|
|
];
|
2011-09-13 19:27:41 +00:00
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # requires /sys, the net
|
|
|
|
|
2019-04-20 03:26:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./tools
|
|
|
|
patchShebangs libnm/generate-setting-docs.py
|
2019-05-04 03:47:04 +00:00
|
|
|
'';
|
2014-02-12 11:29:18 +00:00
|
|
|
|
2019-05-04 03:47:04 +00:00
|
|
|
preBuild = ''
|
|
|
|
# Our gobject-introspection patches make the shared library paths absolute
|
|
|
|
# in the GIR files. When building docs, the library is not yet installed,
|
|
|
|
# though, so we need to replace the absolute path with a local one during build.
|
|
|
|
# We are using a symlink that will be overridden during installation.
|
|
|
|
mkdir -p ${placeholder "out"}/lib
|
|
|
|
ln -s $PWD/libnm/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0
|
2019-04-20 03:26:57 +00:00
|
|
|
'';
|
2013-10-03 12:45:25 +00:00
|
|
|
|
2018-03-07 05:09:48 +00:00
|
|
|
passthru = {
|
2021-05-07 21:18:14 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2018-03-07 05:09:48 +00:00
|
|
|
packageName = pname;
|
|
|
|
attrPath = "networkmanager";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/NetworkManager";
|
2012-12-12 15:26:03 +00:00
|
|
|
description = "Network configuration and management tool";
|
2018-07-05 20:30:53 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-05-07 13:23:50 +00:00
|
|
|
maintainers = teams.freedesktop.members ++ (with maintainers; [ phreedom domenkozar obadz ]);
|
2018-07-05 20:30:53 +00:00
|
|
|
platforms = platforms.linux;
|
2011-01-03 18:01:10 +00:00
|
|
|
};
|
2011-01-03 19:10:01 +00:00
|
|
|
}
|