summary refs log tree commit diff
path: root/pkgs/tools/networking/network-manager/0.9.8/default.nix
blob: 131ec6751159a92d4ca83dbcea2e78d01b000f16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ stdenv, fetchurl, intltool, pkgconfig, dbus-glib
, udev, libnl, libuuid, gnutls, dhcp
, libgcrypt, perl, libgudev, avahi, ppp, kmod }:

stdenv.mkDerivation rec {
  pname = "network-manager";
  version = "0.9.8.10";

  src = fetchurl {
    url = "mirror://gnome/sources/NetworkManager/0.9/NetworkManager-${version}.tar.xz";
    sha256 = "0wn9qh8r56r8l19dqr68pdl1rv3zg1dv47rfy6fqa91q7li2fk86";
  };

  preConfigure = ''
    substituteInPlace tools/glib-mkenums --replace /usr/bin/perl ${perl}/bin/perl
    substituteInPlace src/nm-device.c \
      --replace @avahi@ ${avahi} \
      --replace @kmod@ ${kmod}
    substituteInPlace src/ppp-manager/nm-ppp-manager.c \
      --replace @ppp@ ${ppp} \
      --replace @kmod@ ${kmod}
  '';

  # 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.
  configureFlags = [
    "--with-distro=exherbo"
    "--with-dhclient=${dhcp}/sbin/dhclient"
    "--with-dhcpcd=no"
    "--with-iptables=no"
    "--with-udev-dir=\${out}/lib/udev"
    "--with-resolvconf=no"
    "--sysconfdir=/etc" "--localstatedir=/var"
    "--with-dbus-sys-dir=\${out}/etc/dbus-1/system.d"
    "--with-crypto=gnutls" "--disable-more-warnings"
    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
    "--with-kernel-firmware-dir=/run/current-system/firmware"
    "--disable-ppp"
  ];

  buildInputs = [ udev libnl libuuid gnutls libgcrypt libgudev ];

  propagatedBuildInputs = [ dbus-glib ];

  nativeBuildInputs = [ intltool pkgconfig ];

  patches =
    [ ./libnl-3.2.25.patch
      ./nixos-purity.patch
    ];

  preInstall =
    ''
      installFlagsArray=( "sysconfdir=$out/etc" "localstatedir=$out/var" )
    '';

  meta = with stdenv.lib; {
    homepage = http://projects.gnome.org/NetworkManager/;
    description = "Network configuration and management tool";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}