nixpkgs/pkgs/development/python-modules/pylibmc/default.nix
Austin Seipp 350f49734b 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 <aseipp@pobox.com>
2018-06-09 17:35:12 -05:00

25 lines
657 B
Nix

{ buildPythonPackage, fetchPypi, stdenv, libmemcached, zlib, cyrus_sasl }:
buildPythonPackage rec {
version = "1.5.2";
pname = "pylibmc";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "fc54e28a9f1b5b2ec0c030da29c7ad8a15c2755bd98aaa4142eaf419d5fabb33";
};
buildInputs = [ libmemcached zlib cyrus_sasl ];
setupPyBuildFlags = [ "--with-sasl2" ];
# requires an external memcached server running
doCheck = false;
meta = with stdenv.lib; {
description = "Quick and small memcached client for Python";
homepage = http://sendapatch.se/projects/pylibmc/;
license = licenses.bsd3;
};
}