2010-07-21 13:02:12 +01:00
|
|
|
{ stdenv, fetchurl, gperf, pkgconfig, glib, acl
|
|
|
|
, libusb, usbutils, pciutils }:
|
2008-07-31 15:46:11 +01:00
|
|
|
|
2009-08-12 14:36:36 +01:00
|
|
|
assert stdenv ? glibc;
|
|
|
|
|
2009-08-11 22:00:42 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2011-08-18 14:04:55 +01:00
|
|
|
name = "udev-173";
|
2008-02-04 13:04:16 +00:00
|
|
|
|
2008-07-06 21:56:58 +01:00
|
|
|
src = fetchurl {
|
2009-08-11 22:00:42 +01:00
|
|
|
url = "mirror://kernel/linux/utils/kernel/hotplug/${name}.tar.bz2";
|
2011-08-18 14:04:55 +01:00
|
|
|
sha256 = "1bxadi4bi11v8ipzj22wknv8hsb0wgdb99bx3w9w33rgl4aq78bh";
|
2005-08-19 15:11:05 +01:00
|
|
|
};
|
2008-07-06 21:56:58 +01:00
|
|
|
|
2010-07-21 13:02:12 +01:00
|
|
|
buildInputs = [ gperf pkgconfig glib acl libusb usbutils ];
|
2009-08-11 22:00:42 +01:00
|
|
|
|
2010-07-21 13:02:12 +01:00
|
|
|
configureFlags =
|
|
|
|
''
|
|
|
|
--with-pci-ids-path=${pciutils}/share/pci.ids
|
2011-08-18 14:04:55 +01:00
|
|
|
--enable-udev_acl --enable-edd
|
|
|
|
--disable-introspection --libexecdir=$(out)/lib/udev
|
2010-07-21 13:02:12 +01:00
|
|
|
--with-firmware-path=/root/test-firmware:/var/run/current-system/firmware
|
|
|
|
'';
|
2009-08-11 22:00:42 +01:00
|
|
|
|
2011-07-07 18:14:58 +01:00
|
|
|
# Workaround for the Linux kernel headers being too old.
|
|
|
|
NIX_CFLAGS_COMPILE = "-DBTN_TRIGGER_HAPPY=0x2c0";
|
2011-08-18 14:04:55 +01:00
|
|
|
|
2009-08-11 22:00:42 +01:00
|
|
|
postInstall =
|
2008-08-08 20:54:48 +01:00
|
|
|
''
|
2009-08-11 22:00:42 +01:00
|
|
|
# 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.
|
2011-08-18 14:04:55 +01:00
|
|
|
for i in $out/lib/udev/write_cd_rules $out/lib/udev/write_net_rules; do
|
2009-08-11 22:00:42 +01:00
|
|
|
substituteInPlace $i \
|
2011-08-18 14:04:55 +01:00
|
|
|
--replace /lib/udev $out/lib/udev \
|
2009-08-11 22:00:42 +01:00
|
|
|
--replace /etc/udev/rules.d /var/lib/udev/rules.d
|
|
|
|
done
|
2008-02-04 13:04:16 +00:00
|
|
|
|
2009-08-11 22:00:42 +01:00
|
|
|
# Don't set PATH to /bin:/sbin; won't work in NixOS.
|
2011-08-18 14:04:55 +01:00
|
|
|
sed -e '/PATH=/d' -i $out/lib/udev/rule_generator.functions
|
2009-08-17 01:35:18 +01:00
|
|
|
|
2011-08-18 14:04:55 +01:00
|
|
|
ln -sv $out/lib/ConsoleKit $out/etc/ConsoleKit
|
2011-02-11 13:30:39 +00:00
|
|
|
|
2011-08-18 14:04:55 +01:00
|
|
|
rm -frv $out/share/gtk-doc
|
2009-08-11 22:00:42 +01:00
|
|
|
'';
|
2011-08-18 14:04:55 +01:00
|
|
|
|
2011-10-27 16:13:26 +01:00
|
|
|
patches = [ ./custom-rules.patch ] ++
|
2011-11-09 12:58:17 +00:00
|
|
|
[(fetchurl {
|
|
|
|
url = https://bugs.archlinux.org/task/25356?getfile=7281;
|
|
|
|
sha256 = "01xib1pfdbwacgx8dqxgrf67a0mwkpm4kxy9f9v3df93v0m4pmbm";
|
|
|
|
})] ++
|
2011-10-27 16:13:26 +01:00
|
|
|
stdenv.lib.optional (stdenv.system == "armv5tel-linux") ./pre-accept4-kernel.patch;
|
2011-08-18 14:04:55 +01:00
|
|
|
|
2008-02-04 13:04:16 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html;
|
|
|
|
description = "Udev manages the /dev filesystem";
|
|
|
|
};
|
2005-08-19 15:11:05 +01:00
|
|
|
}
|