From 508ebecf06c320a8c709327c15c2788cc362ca0d Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 2 Aug 2021 03:36:53 +0300 Subject: [PATCH] samba4: add wrapPythonPrograms (cherry picked from commit 507d310cdad329035b5c631bbf806654fe96a0f3) --- pkgs/servers/samba/4.x.nix | 10 ++++++++-- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index 3ae30699546..1139aeb4bbd 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -1,6 +1,5 @@ { lib, stdenv , fetchurl -, python , pkg-config , bison , flex @@ -62,6 +61,7 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ + python3Packages.python pkg-config bison flex @@ -78,7 +78,8 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - python + python3Packages.python + python3Packages.wrapPython readline popt dbus @@ -128,6 +129,8 @@ stdenv.mkDerivation rec { ++ optional (!enableAcl) "--without-acl-support" ++ optional (!enablePam) "--without-pam"; + pythonPath = [ python3Packages.dnspython tdb ]; + preBuild = '' export MAKEFLAGS="-j $NIX_BUILD_CORES" ''; @@ -146,6 +149,9 @@ stdenv.mkDerivation rec { patchelf --shrink-rpath "\$BIN"; EOF find $out -type f -name \*.so -exec $SHELL -c "$SCRIPT" \; + + # Fix PYTHONPATH for some tools + wrapPythonPrograms ''; passthru = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1cf5b956829..def255d9533 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19702,7 +19702,6 @@ in samba4 = callPackage ../servers/samba/4.x.nix { rpcgen = netbsd.rpcgen; - python = python3; }; samba = samba4;