anchor.diff:      sha256 = "15ffsaz7l3fgdg03l7g1xx9jw7xgs6pc548zxqsxawsca5x1sc1k";
     };
   
  -  pythonPath = with pythonPackages;
  -    [ dbus-python pygobject2 pygobject3 recursivePthLoader ];
  +  pythonPath = with pythonPackages; [
  +    dbus-python pygobject2 pygobject3 recursivePthLoader
  +  ];
   
     buildInputs = [
  -    pkgconfig dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
  +    dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
       readline udev libical
     ];
  +
  +  nativeBuildInputs = [ pkgconfig ];
   
     outputs = [ "out" "dev" "test" ];
   
     patches = [ ./bluez-5.37-obexd_without_systemd-1.patch ];
   
  -  preConfigure = ''
  -      substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
  -      substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
  -    '';
  +  postConfigure = ''
  +    substituteInPlace tools/hid2hci.rules \
  +      --replace /sbin/udevadm ${systemd}/bin/udevadm \
  +      --replace "hid2hci " "$out/lib/udev/hid2hci "
  +  '';
   
  -  configureFlags = [
  +  configureFlags = (with stdenv.lib; [
       "--localstatedir=/var"
       "--enable-library"
       "--enable-cups"
  
positive.code:     # Add extra configuration
      mkdir $out/etc/bluetooth
      ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
    '';
  
    enableParallelBuilding = true;
  
    meta = with stdenv.lib; {
      homepage = http://www.bluez.org/;
      repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
      description = "Bluetooth support for Linux";
      platforms = platforms.linux;
    };
  }
  
negative.code:     "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
      "--with-systemduserunitdir=$(out)/etc/systemd/user"
      "--with-udevdir=$(out)/lib/udev"
      ] ++ optional enableWiimote [ "--enable-wiimote" ]
        ++ optional enableMidi    [ "--enable-midi" ]);
  
    # Work around `make install' trying to create /var/lib/bluetooth.
    installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
  