<commit_before>{ stdenv, fetchurl, pkgconfig, python, pciutils, expat
, libusb, dbus, dbus_glib, glib, libuuid, perl
, perlXMLParser, gettext, zlib, gperf, consolekit, policykit
, libsmbios, dmidecode, udev, utillinuxng, pmutils, usbutils
, eject
}:

assert stdenv ? glibc;

stdenv.mkDerivation rec {
  name = "hal-0.5.14";

  src = fetchurl {
    url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
    sha256 = "00ld3afcbh4ckb8sli63mm2w69zh6ip4axhy1lxyybgiabxaqfij";
  };

  buildInputs = [
    pkgconfig python pciutils expat libusb dbus.libs dbus_glib glib
    libuuid perl perlXMLParser gettext zlib gperf
    consolekit policykit
    # !!! libsmbios is broken; it doesn't install headers.
  ] ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") [ libsmbios ];

  # !!! Hm, maybe the pci/usb.ids location should be in /etc, so that
  # we don't have to rebuild HAL when we update the PCI/USB IDs.
  configureFlags = ''
    --with-pci-ids=${pciutils}/share
    --with-usb-ids=${usbutils}/share
    --localstatedir=/var
    --with-eject=${eject}/bin/eject
    --with-linux-input-header=${stdenv.glibc}/include/linux/input.h
    --enable-umount-helper
  '';

  propagatedBuildInputs = [ libusb ]
    ++ stdenv.lib.optionals (stdenv.system != "armv5tel-linux") [ libsmbios ];

  preConfigure = ''
    for i in hald/linux/probing/probe-smbios.c hald/linux/osspec.c \
             hald/linux/coldplug.c hald/linux/blockdev.c \
             tools/hal-storage-mount.c ./tools/hal-storage-shared.c \
             tools/hal-system-power-pm-is-supported.c \
             tools/linux/hal-*-linux
    do
      substituteInPlace $i \
        --replace /usr/sbin/dmidecode ${dmidecode}/sbin/dmidecode \
        ${if udev != null then "--replace /sbin/udevadm ${udev}/sbin/udevadm" else ""} \
        --replace /bin/mount ${utillinuxng}/bin/mount \
        --replace /bin/umount ${utillinuxng}/bin/umount \
        --replace /usr/bin/pm-is-supported ${pmutils}/bin/pm-is-supported \
        --replace /usr/sbin/pm ${pmutils}/sbin/pm
    done
  '';

  installFlags = "slashsbindir=$(out)/sbin";
}<commit_msg>* HAL: make the shutdown/reboot messages work.  Xfce needs this.<commit_after>{ stdenv, fetchurl, pkgconfig, python, pciutils, expat
, libusb, dbus, dbus_glib, glib, libuuid, perl
, perlXMLParser, gettext, zlib, gperf, consolekit, policykit
, libsmbios, dmidecode, udev, utillinuxng, pmutils, usbutils
, eject, upstart
}:

assert stdenv ? glibc;

stdenv.mkDerivation rec {
  name = "hal-0.5.14";

  src = fetchurl {
    url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
    sha256 = "00ld3afcbh4ckb8sli63mm2w69zh6ip4axhy1lxyybgiabxaqfij";
  };

  buildInputs = [
    pkgconfig python pciutils expat libusb dbus.libs dbus_glib glib
    libuuid perl perlXMLParser gettext zlib gperf
    consolekit policykit
    # !!! libsmbios is broken; it doesn't install headers.
  ] ++ stdenv.lib.optional (stdenv.system != "armv5tel-linux") [ libsmbios ];

  # !!! Hm, maybe the pci/usb.ids location should be in /etc, so that
  # we don't have to rebuild HAL when we update the PCI/USB IDs.
  configureFlags = ''
    --with-pci-ids=${pciutils}/share
    --with-usb-ids=${usbutils}/share
    --localstatedir=/var
    --with-eject=${eject}/bin/eject
    --with-linux-input-header=${stdenv.glibc}/include/linux/input.h
    --enable-umount-helper
  '';

  propagatedBuildInputs = [ libusb ]
    ++ stdenv.lib.optionals (stdenv.system != "armv5tel-linux") [ libsmbios ];

  preConfigure = ''
    for i in hald/linux/probing/probe-smbios.c hald/linux/osspec.c \
             hald/linux/coldplug.c hald/linux/blockdev.c \
             tools/hal-storage-mount.c ./tools/hal-storage-shared.c \
             tools/hal-system-power-pm-is-supported.c \
             tools/linux/hal-*-linux
    do
      substituteInPlace $i \
        --replace /usr/sbin/dmidecode ${dmidecode}/sbin/dmidecode \
        ${if udev != null then "--replace /sbin/udevadm ${udev}/sbin/udevadm" else ""} \
        --replace /bin/mount ${utillinuxng}/bin/mount \
        --replace /bin/umount ${utillinuxng}/bin/umount \
        --replace /usr/bin/pm-is-supported ${pmutils}/bin/pm-is-supported \
        --replace /usr/sbin/pm ${pmutils}/sbin/pm \
        --replace /sbin/shutdown ${upstart}/sbin/shutdown
    done
  '';

  installFlags = "slashsbindir=$(out)/sbin";
}
{'fraction_non_alphanumeric': 0.14647627821280515, 'fraction_numerical': 0.010133578995854445, 'mean_word_length': 2.850177304964539, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '807621', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1601, 'n_words': 301}