summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bluez
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-05-11 07:15:41 +0800
committerGitHub <noreply@github.com>2018-05-11 07:15:41 +0800
commit10c9ec68ac4236959acd45695d8222992b3e7985 (patch)
tree53dd0c2b60e63af25721608221a263ffc9d08a60 /pkgs/os-specific/linux/bluez
parent50efa1979d86a852bbc713f624ca9897fd22e65d (diff)
parent4c66aa8938ca286cc9e801284d6f531e548f0eaa (diff)
downloadnixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar.gz
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar.bz2
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar.lz
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar.xz
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.tar.zst
nixpkgs-10c9ec68ac4236959acd45695d8222992b3e7985.zip
Merge pull request #39813 from peterhoeg/f/bluez
bluez: add tools to output that we were building anyway
Diffstat (limited to 'pkgs/os-specific/linux/bluez')
-rw-r--r--pkgs/os-specific/linux/bluez/default.nix35
1 files changed, 23 insertions, 12 deletions
diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix
index bbf01e5027c..a67133c3236 100644
--- a/pkgs/os-specific/linux/bluez/default.nix
+++ b/pkgs/os-specific/linux/bluez/default.nix
@@ -10,24 +10,28 @@ stdenv.mkDerivation rec {
     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"
@@ -38,8 +42,8 @@ stdenv.mkDerivation rec {
     "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
     "--with-systemduserunitdir=$(out)/etc/systemd/user"
     "--with-udevdir=$(out)/lib/udev"
-    ] ++ stdenv.lib.optional enableWiimote [ "--enable-wiimote" ]
-    ++ stdenv.lib.optional enableMidi [ "--enable-midi" ];
+    ] ++ optional enableWiimote [ "--enable-wiimote" ]
+      ++ optional enableMidi    [ "--enable-midi" ]);
 
   # Work around `make install' trying to create /var/lib/bluetooth.
   installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
@@ -71,14 +75,21 @@ stdenv.mkDerivation rec {
     # Add extra configuration
     mkdir $out/etc/bluetooth
     ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
+
+    # Add missing tools, ref https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/bluez
+    for files in `find tools/ -type f -perm -755`; do
+      filename=$(basename $files)
+      install -Dm755 tools/$filename $out/bin/$filename
+    done
   '';
 
   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";
+    homepage = http://www.bluez.org/;
+    license = with licenses; [ gpl2 lgpl21 ];
     platforms = platforms.linux;
+    repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
   };
 }