From 61dd23eeaf998ff94a25150bc51099835842f145 Mon Sep 17 00:00:00 2001 From: Artturi Date: Tue, 3 Aug 2021 19:07:23 +0300 Subject: [PATCH] samba4: add wrapPythonPrograms (#132373) --- pkgs/servers/samba/4.x.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index fe2891f2ac7..eb03ea3ef6e 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -1,7 +1,6 @@ { lib, stdenv , buildPackages , fetchurl -, python3 , wafHook , pkg-config , bison @@ -64,7 +63,7 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ - python3 + python3Packages.python wafHook pkg-config bison @@ -83,7 +82,8 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - python3 + python3Packages.python + python3Packages.wrapPython readline popt dbus @@ -146,6 +146,8 @@ stdenv.mkDerivation rec { # module, which works correctly in all cases. PYTHON_CONFIG = "/invalid"; + pythonPath = [ python3Packages.dnspython tdb ]; + preBuild = '' export MAKEFLAGS="-j $NIX_BUILD_CORES" ''; @@ -167,7 +169,10 @@ stdenv.mkDerivation rec { # Samba does its own shebang patching, but uses build Python find "$out/bin" -type f -executable -exec \ - sed -i '1 s^#!${python3.pythonForBuild}/bin/python.*^#!${python3.interpreter}^' {} \; + sed -i '1 s^#!${python3Packages.python.pythonForBuild}/bin/python.*^#!${python3Packages.python.interpreter}^' {} \; + + # Fix PYTHONPATH for some tools + wrapPythonPrograms ''; passthru = {