nixpkgs/pkgs/tools/networking/networkmanager/default.nix

114 lines
4 KiB
Nix
Raw Normal View History

2021-01-17 03:51:22 +00:00
{ lib, stdenv, fetchurl, substituteAll, intltool, pkg-config, fetchpatch, dbus
, gnome, systemd, libuuid, polkit, gnutls, ppp, dhcp, iptables, 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 }:
2018-03-07 05:09:48 +00:00
let
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-04-21 11:34:21 +00:00
version = "1.30.4";
src = fetchurl {
2021-01-15 09:19:50 +00:00
url = "mirror://gnome/sources/NetworkManager/${lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
2021-04-21 11:34:21 +00:00
sha256 = "sha256-YFC3JCEuo85zhhEzWb6pr6H2eaVPYNmZpZmYkuZywZA=";
};
outputs = [ "out" "dev" "devdoc" "man" "doc" ];
2012-06-16 19:09:30 +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.
mesonFlags = [
"-Ddhclient=${dhcp}/bin/dhclient"
"-Ddnsmasq=${dnsmasq}/bin/dnsmasq"
# Upstream prefers dhclient, so don't add dhcpcd to the closure
"-Ddhcpcd=no"
"-Ddhcpcanon=no"
"-Dpppd=${ppp}/bin/pppd"
"-Diptables=${iptables}/bin/iptables"
# to enable link-local connections
"-Dudev_dir=${placeholder "out"}/lib/udev"
"-Dresolvconf=${openresolv}/bin/resolvconf"
"-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d"
"-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"
"-Dpolkit_agent_helper_1=/run/wrappers/bin/polkit-agent-helper-1"
# Allow using iwd when configured to do so
"-Diwd=true"
"-Dlibaudit=yes-disabled-by-default"
2020-07-14 12:01:24 +00:00
# We don't use firewalld in NixOS
"-Dfirewalld_zone=false"
];
2017-04-04 12:16:59 +00:00
patches = [
2018-07-05 20:30:53 +00:00
(substituteAll {
src = ./fix-paths.patch;
inherit iputils kmod openconnect ethtool gnused systemd;
inherit runtimeShell;
2018-07-05 20:30:53 +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
];
2018-07-05 20:30:53 +00:00
buildInputs = [
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 20:30:53 +00:00
];
propagatedBuildInputs = [ gnutls libgcrypt ];
nativeBuildInputs = [
2021-01-17 03:51:22 +00:00
meson ninja intltool pkg-config
vala gobject-introspection dbus
# Docs
gtk-doc libxslt docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 pythonForDocs
];
doCheck = false; # requires /sys, the net
postPatch = ''
patchShebangs ./tools
patchShebangs libnm/generate-setting-docs.py
'';
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
'';
2018-03-07 05:09:48 +00:00
passthru = {
updateScript = gnome.updateScript {
packageName = "NetworkManager";
2018-03-07 05:09:48 +00:00
attrPath = "networkmanager";
versionPolicy = "odd-unstable";
2018-03-07 05:09:48 +00:00
};
};
meta = with lib; {
homepage = "https://wiki.gnome.org/Projects/NetworkManager";
description = "Network configuration and management tool";
2018-07-05 20:30:53 +00:00
license = licenses.gpl2Plus;
maintainers = teams.freedesktop.members ++ (with maintainers; [ phreedom domenkozar obadz ]);
2018-07-05 20:30:53 +00:00
platforms = platforms.linux;
};
}