From 350f49734b161895803df1e3eb712df4f9c0e81e Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Sat, 9 Jun 2018 17:31:00 -0500 Subject: [PATCH] pythonPackages.pylibmc: fix runtime dependency on libsasl2.so, by way of cyrus_sasl Without explicitly specifying that libsasl2 is part of the build, and without explicitly making it part of pylibmc's linker flags for its CPython extension, the cpython code enters a build state error where it instead attempts to blindly `dlopen("libsasl2.so")` out of $LD_LIBRARY_PATH; this fails as it can't be found in the store, obviously. The bigger problem with this is that it otherwise makes pylibmc unusable, as it will try to immediately load libsasl2 at startup. This means even using 'import pylibmc' at all will cause a failure. Instead, add cyrus_sasl into the build closure of the library, and pass an argument to the setup.py script to properly pass -lsasl2 to the C extension. This causes a link to properly be formed. Signed-off-by: Austin Seipp --- pkgs/development/python-modules/pylibmc/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pylibmc/default.nix b/pkgs/development/python-modules/pylibmc/default.nix index 7f57f17efeb..47499e4ae18 100644 --- a/pkgs/development/python-modules/pylibmc/default.nix +++ b/pkgs/development/python-modules/pylibmc/default.nix @@ -1,4 +1,5 @@ -{ buildPythonPackage, fetchPypi, stdenv, libmemcached, zlib }: +{ buildPythonPackage, fetchPypi, stdenv, libmemcached, zlib, cyrus_sasl }: + buildPythonPackage rec { version = "1.5.2"; pname = "pylibmc"; @@ -9,7 +10,8 @@ buildPythonPackage rec { sha256 = "fc54e28a9f1b5b2ec0c030da29c7ad8a15c2755bd98aaa4142eaf419d5fabb33"; }; - buildInputs = [ libmemcached zlib ]; + buildInputs = [ libmemcached zlib cyrus_sasl ]; + setupPyBuildFlags = [ "--with-sasl2" ]; # requires an external memcached server running doCheck = false;