2021-06-19 17:36:57 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, substituteAll
|
|
|
|
, intltool
|
|
|
|
, pkg-config
|
|
|
|
, fetchpatch
|
|
|
|
, dbus
|
|
|
|
, gnome
|
|
|
|
, systemd
|
|
|
|
, libuuid
|
|
|
|
, polkit
|
|
|
|
, gnutls
|
|
|
|
, ppp
|
|
|
|
, dhcp
|
|
|
|
, iptables
|
2021-06-18 22:35:27 +02:00
|
|
|
, nftables
|
2021-06-19 17:36:57 +02:00
|
|
|
, python3
|
|
|
|
, vala
|
|
|
|
, libgcrypt
|
|
|
|
, dnsmasq
|
|
|
|
, bluez5
|
|
|
|
, readline
|
|
|
|
, libselinux
|
|
|
|
, audit
|
|
|
|
, gobject-introspection
|
|
|
|
, modemmanager
|
|
|
|
, openresolv
|
|
|
|
, libndp
|
|
|
|
, newt
|
|
|
|
, libsoup
|
|
|
|
, ethtool
|
|
|
|
, gnused
|
|
|
|
, iputils
|
|
|
|
, kmod
|
|
|
|
, jansson
|
|
|
|
, gtk-doc
|
|
|
|
, libxslt
|
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xml_dtd_412
|
|
|
|
, docbook_xml_dtd_42
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, openconnect
|
|
|
|
, curl
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, libpsl
|
|
|
|
, mobile-broadband-provider-info
|
|
|
|
, runtimeShell
|
|
|
|
}:
|
2011-01-03 19:01:10 +01:00
|
|
|
|
2018-03-07 06:09:48 +01:00
|
|
|
let
|
2019-04-20 05:26:57 +02:00
|
|
|
pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
|
2021-06-19 17:36:57 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-08 16:28:44 +01:00
|
|
|
pname = "networkmanager";
|
2021-09-25 14:54:52 +02:00
|
|
|
version = "1.32.12";
|
2011-01-03 19:01:10 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-15 10:19:50 +01:00
|
|
|
url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
|
2021-09-25 14:54:52 +02:00
|
|
|
sha256 = "sha256-qKs2oKUC/nPNjjustlhfl/u5Tr73nids268Rwz/49Us=";
|
2011-01-03 19:01:10 +01:00
|
|
|
};
|
|
|
|
|
2019-04-20 05:26:57 +02:00
|
|
|
outputs = [ "out" "dev" "devdoc" "man" "doc" ];
|
2012-06-16 21:09:30 +02:00
|
|
|
|
2011-09-10 21:23:26 +02: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 05:26:57 +02:00
|
|
|
mesonFlags = [
|
2021-06-19 17:36:57 +02:00
|
|
|
# System paths
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
2018-12-22 21:22:20 +01:00
|
|
|
# to enable link-local connections
|
2019-04-20 05:26:57 +02:00
|
|
|
"-Dudev_dir=${placeholder "out"}/lib/udev"
|
2019-09-14 01:02:38 +02:00
|
|
|
"-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d"
|
2019-04-20 05:26:57 +02:00
|
|
|
"-Dkernel_firmware_dir=/run/current-system/firmware"
|
2021-06-19 17:36:57 +02:00
|
|
|
|
|
|
|
# Platform
|
2019-04-20 05:26:57 +02:00
|
|
|
"-Dsession_tracking=systemd"
|
2021-06-19 17:36:57 +02:00
|
|
|
"-Dlibaudit=yes-disabled-by-default"
|
2021-03-08 13:54:34 +01:00
|
|
|
"-Dpolkit_agent_helper_1=/run/wrappers/bin/polkit-agent-helper-1"
|
2021-06-19 17:36:57 +02:00
|
|
|
|
|
|
|
# Features
|
2019-04-23 05:12:53 +02:00
|
|
|
# Allow using iwd when configured to do so
|
|
|
|
"-Diwd=true"
|
2021-06-19 17:36:57 +02:00
|
|
|
"-Dpppd=${ppp}/bin/pppd"
|
|
|
|
"-Diptables=${iptables}/bin/iptables"
|
2021-06-18 22:35:27 +02:00
|
|
|
"-Dnft=${nftables}/bin/nft"
|
2021-06-19 17:36:57 +02:00
|
|
|
"-Dmodem_manager=true"
|
|
|
|
"-Dnmtui=true"
|
|
|
|
"-Ddnsmasq=${dnsmasq}/bin/dnsmasq"
|
|
|
|
"-Dqt=false"
|
|
|
|
|
|
|
|
# Handlers
|
|
|
|
"-Dresolvconf=${openresolv}/bin/resolvconf"
|
|
|
|
|
|
|
|
# DHCP clients
|
|
|
|
"-Ddhclient=${dhcp}/bin/dhclient"
|
|
|
|
# Upstream prefers dhclient, so don't add dhcpcd to the closure
|
|
|
|
"-Ddhcpcd=no"
|
|
|
|
"-Ddhcpcanon=no"
|
|
|
|
|
|
|
|
# Miscellaneous
|
|
|
|
"-Ddocs=true"
|
2020-07-14 14:01:24 +02:00
|
|
|
# We don't use firewalld in NixOS
|
|
|
|
"-Dfirewalld_zone=false"
|
2021-06-19 17:36:57 +02:00
|
|
|
"-Dtests=no"
|
|
|
|
"-Dcrypto=gnutls"
|
2014-02-13 18:03:06 +01:00
|
|
|
];
|
2011-09-10 21:23:26 +02:00
|
|
|
|
2017-04-04 14:16:59 +02:00
|
|
|
patches = [
|
2018-07-05 22:30:53 +02:00
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
2021-03-08 13:54:34 +01:00
|
|
|
inherit iputils kmod openconnect ethtool gnused systemd;
|
2019-12-23 04:02:09 +01:00
|
|
|
inherit runtimeShell;
|
2018-07-05 22:30:53 +02:00
|
|
|
})
|
|
|
|
|
2019-04-20 05:26:57 +02: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 14:16:59 +02:00
|
|
|
];
|
2016-10-16 20:29:18 +02:00
|
|
|
|
2018-07-05 22:30:53 +02:00
|
|
|
buildInputs = [
|
2021-06-19 17:36:57 +02:00
|
|
|
systemd
|
|
|
|
libselinux
|
|
|
|
audit
|
|
|
|
libpsl
|
|
|
|
libuuid
|
|
|
|
polkit
|
|
|
|
ppp
|
|
|
|
libndp
|
|
|
|
curl
|
|
|
|
mobile-broadband-provider-info
|
|
|
|
bluez5
|
|
|
|
dnsmasq
|
|
|
|
gobject-introspection
|
|
|
|
modemmanager
|
|
|
|
readline
|
|
|
|
newt
|
|
|
|
libsoup
|
|
|
|
jansson
|
2018-07-05 22:30:53 +02:00
|
|
|
];
|
2011-09-10 21:23:26 +02:00
|
|
|
|
2019-09-14 01:02:38 +02:00
|
|
|
propagatedBuildInputs = [ gnutls libgcrypt ];
|
2011-09-14 17:50:01 +02:00
|
|
|
|
2019-04-20 05:26:57 +02:00
|
|
|
nativeBuildInputs = [
|
2021-06-19 17:36:57 +02:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
intltool
|
|
|
|
pkg-config
|
|
|
|
vala
|
|
|
|
gobject-introspection
|
|
|
|
dbus
|
2019-04-20 05:26:57 +02:00
|
|
|
# Docs
|
2021-06-19 17:36:57 +02:00
|
|
|
gtk-doc
|
|
|
|
libxslt
|
|
|
|
docbook_xsl
|
|
|
|
docbook_xml_dtd_412
|
|
|
|
docbook_xml_dtd_42
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
pythonForDocs
|
2019-04-20 05:26:57 +02:00
|
|
|
];
|
2011-09-13 21:27:41 +02:00
|
|
|
|
2018-04-25 05:20:18 +02:00
|
|
|
doCheck = false; # requires /sys, the net
|
|
|
|
|
2019-04-20 05:26:57 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./tools
|
|
|
|
patchShebangs libnm/generate-setting-docs.py
|
2019-05-04 05:47:04 +02:00
|
|
|
'';
|
2014-02-12 12:29:18 +01:00
|
|
|
|
2019-05-04 05:47:04 +02: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
|
2021-06-18 22:35:27 +02:00
|
|
|
ln -s $PWD/src/libnm-client-impl/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0
|
2019-04-20 05:26:57 +02:00
|
|
|
'';
|
2013-10-03 14:45:25 +02:00
|
|
|
|
2018-03-07 06:09:48 +01:00
|
|
|
passthru = {
|
2021-05-07 23:18:14 +02:00
|
|
|
updateScript = gnome.updateScript {
|
2021-06-17 20:56:29 +02:00
|
|
|
packageName = "NetworkManager";
|
2018-03-07 06:09:48 +01:00
|
|
|
attrPath = "networkmanager";
|
2021-06-17 20:56:29 +02:00
|
|
|
versionPolicy = "odd-unstable";
|
2018-03-07 06:09:48 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/NetworkManager";
|
2012-12-12 16:26:03 +01:00
|
|
|
description = "Network configuration and management tool";
|
2018-07-05 22:30:53 +02:00
|
|
|
license = licenses.gpl2Plus;
|
2021-06-18 22:35:27 +02:00
|
|
|
changelog = "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/raw/${version}/NEWS";
|
2021-12-18 10:25:46 +01:00
|
|
|
maintainers = teams.freedesktop.members ++ (with maintainers; [ domenkozar obadz maxeaubrey ]);
|
2018-07-05 22:30:53 +02:00
|
|
|
platforms = platforms.linux;
|
2011-01-03 19:01:10 +01:00
|
|
|
};
|
2011-01-03 20:10:01 +01:00
|
|
|
}
|