diff --git a/pkgs/by-name/bl/bluez-headers/package.nix b/pkgs/by-name/bl/bluez-headers/package.nix new file mode 100644 index 000000000000..e9ee013982e5 --- /dev/null +++ b/pkgs/by-name/bl/bluez-headers/package.nix @@ -0,0 +1,44 @@ +{ + lib, + stdenv, + fetchurl, +}: + +# This package only provides the bluetooth headers from the bluez package +# for consumption in Python, which cannot consume bluez.dev due to multiple +# infinite recursion paths. + +stdenv.mkDerivation (finalAttrs: { + pname = "bluez-headers"; + version = "5.83"; + + # This package has the source, because of the emulatorAvailable check in the + # bluez function args, that causes an infinite recursion with Python on cross + # builds. + src = fetchurl { + url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz"; + hash = "sha256-EIUi2QnSIFgTmb/sk9qrYgNVOc7vPdo+eZcHhcY70kw="; + }; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + mkdir -p $out/include/bluetooth + cp -v lib/*.h "$out/include/bluetooth/" + ''; + + meta = { + homepage = "https://www.bluez.org/"; + description = "Official Linux Bluetooth protocol stack"; + changelog = "https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/ChangeLog?h=${finalAttrs.version}"; + license = with lib.licenses; [ + bsd2 + gpl2Plus + lgpl21Plus + mit + ]; + maintainers = with lib.maintainers; [ ]; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/by-name/bl/bluez/package.nix b/pkgs/by-name/bl/bluez/package.nix index 7b11f0fefbec..8228902a3c38 100644 --- a/pkgs/by-name/bl/bluez/package.nix +++ b/pkgs/by-name/bl/bluez/package.nix @@ -3,6 +3,7 @@ stdenv, alsa-lib, autoreconfHook, + bluez-headers, dbus, docutils, ell, @@ -28,12 +29,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "bluez"; - version = "5.83"; - - src = fetchurl { - url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz"; - hash = "sha256-EIUi2QnSIFgTmb/sk9qrYgNVOc7vPdo+eZcHhcY70kw="; - }; + inherit (bluez-headers) version src; patches = [ (fetchurl { @@ -186,18 +182,7 @@ stdenv.mkDerivation (finalAttrs: { url = "https://git.kernel.org/pub/scm/bluetooth/bluez.git"; }; - meta = { - homepage = "https://www.bluez.org/"; - description = "Official Linux Bluetooth protocol stack"; - changelog = "https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/ChangeLog?h=${finalAttrs.version}"; - license = with lib.licenses; [ - bsd2 - gpl2Plus - lgpl21Plus - mit - ]; + meta = bluez-headers.meta // { mainProgram = "btinfo"; - maintainers = with lib.maintainers; [ ]; - platforms = lib.platforms.linux; }; })