summary refs log tree commit diff
path: root/pkgs/os-specific/linux/udev/173.nix
blob: ba96717e494a5205e97c398625639fd7aae3ce1c (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
{ stdenv, fetchurl, gperf, pkgconfig, glib, acl
, libusb, usbutils, pciutils }:

assert stdenv ? glibc;

stdenv.mkDerivation rec {
  name = "udev-173";

  src = fetchurl {
    url = "mirror://kernel/linux/utils/kernel/hotplug/${name}.tar.bz2";
    sha256 = "1bxadi4bi11v8ipzj22wknv8hsb0wgdb99bx3w9w33rgl4aq78bh";
  };

  buildInputs = [ gperf pkgconfig glib acl libusb usbutils ];

  configureFlags =
    ''
      --with-pci-ids-path=${pciutils}/share/pci.ids
      --enable-udev_acl --enable-edd
      --disable-introspection --libexecdir=$(out)/lib/udev
      --with-firmware-path=/root/test-firmware:/var/run/current-system/firmware
    '';

  # Workaround for the Linux kernel headers being too old.
  NIX_CFLAGS_COMPILE = "-DBTN_TRIGGER_HAPPY=0x2c0";

  postInstall =
    ''
      # The path to rule_generator.functions in write_cd_rules and
      # write_net_rules is broken.  Also, don't store the mutable
      # persistant rules in /etc/udev/rules.d but in
      # /var/lib/udev/rules.d.
      for i in $out/lib/udev/write_cd_rules $out/lib/udev/write_net_rules; do
        substituteInPlace $i \
          --replace /lib/udev $out/lib/udev \
          --replace /etc/udev/rules.d /var/lib/udev/rules.d
      done

      # Don't set PATH to /bin:/sbin; won't work in NixOS.
      sed -e '/PATH=/d' -i $out/lib/udev/rule_generator.functions

      ln -sv $out/lib/ConsoleKit $out/etc/ConsoleKit

      rm -frv $out/share/gtk-doc
    '';

  patches = [ ./custom-rules.patch ];

  meta = {
    homepage = http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html;
    description = "Udev manages the /dev filesystem";
  };
}