From b7ce309e6c6fbad584df85d9fd62c5185153e8f9 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Mon, 22 Jun 2020 12:46:17 +0200 Subject: [PATCH] pythonFull: add BlueZ support This commit introduces two changes. First, cpython gets optional BlueZ support, which is needed for AF_BLUETOOTH sockets. Therefore bluezSupport was added as a parameter. Second, the call to the pythonFull packages has been adjusted. The Python packages have a self-reference called self. This was not adjusted for the override. As a result, Python packages for this special version of Python were not built with the overridden Python, but with the original one. --- .../interpreters/python/cpython/default.nix | 5 +++ pkgs/top-level/all-packages.nix | 45 +++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index d26d060da72a..4a8d4ab4bfbc 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -9,6 +9,7 @@ , readline , sqlite , tcl ? null, tk ? null, tix ? null, libX11 ? null, xorgproto ? null, x11Support ? false +, bluez ? null, bluezSupport ? false , zlib , self , configd @@ -45,6 +46,9 @@ assert x11Support -> tcl != null && tk != null && xorgproto != null && libX11 != null; + +assert bluezSupport -> bluez != null; + with stdenv.lib; let @@ -73,6 +77,7 @@ let buildInputs = filter (p: p != null) ([ zlib bzip2 expat lzma libffi gdbm sqlite readline ncurses openssl ] ++ optionals x11Support [ tcl tk libX11 xorgproto ] + ++ optionals (bluezSupport && stdenv.isLinux) [ bluez ] ++ optionals stdenv.isDarwin [ configd ]); hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 68932d330a01..be744c37843c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9898,14 +9898,43 @@ in # Python interpreter that is build with all modules, including tkinter. # These are for compatibility and should not be used inside Nixpkgs. - pythonFull = python.override{x11Support=true;}; - python2Full = python2.override{x11Support=true;}; - python27Full = python27.override{x11Support=true;}; - python3Full = python3.override{x11Support=true;}; - python36Full = python36.override{x11Support=true;}; - python37Full = python37.override{x11Support=true;}; - python38Full = python38.override{x11Support=true;}; - python39Full = python39.override{x11Support=true;}; + pythonFull = python.override { + self = pythonFull; + x11Support = true; + }; + python2Full = python2.override { + self = python2Full; + x11Support = true; + }; + python27Full = python27.override { + self = python27Full; + x11Support = true; + }; + python3Full = python3.override { + self = python3Full; + bluezSupport = true; + x11Support = true; + }; + python36Full = python36.override { + self = python36Full; + bluezSupport = true; + x11Support = true; + }; + python37Full = python37.override { + self = python37Full; + bluezSupport = true; + x11Support = true; + }; + python38Full = python38.override { + self = python38Full; + bluezSupport = true; + x11Support = true; + }; + python39Full = python39.override { + self = python39Full; + bluezSupport = true; + x11Support = true; + }; # pythonPackages further below, but assigned here because they need to be in sync pythonPackages = python.pkgs;