d419639f9c
GitOrigin-RevId: 6b1057b452c55bb3b463f0d7055bc4ec3fd1f381
41 lines
971 B
Nix
41 lines
971 B
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, libsodium
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "libnacl";
|
|
version = "1.7.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "saltstack";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-nttR9PQimhqd2pByJ5IJzJ4RmSI4y7lcX7a7jcK+vqc=";
|
|
};
|
|
|
|
buildInputs = [ libsodium ];
|
|
|
|
postPatch =
|
|
let soext = stdenv.hostPlatform.extensions.sharedLibrary; in
|
|
''
|
|
substituteInPlace "./libnacl/__init__.py" --replace \
|
|
"ctypes.cdll.LoadLibrary('libsodium${soext}')" \
|
|
"ctypes.cdll.LoadLibrary('${libsodium}/lib/libsodium${soext}')"
|
|
'';
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
pythonImportsCheck = [ "libnacl" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python bindings for libsodium based on ctypes";
|
|
homepage = "https://libnacl.readthedocs.io/";
|
|
license = licenses.asl20;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ xvapx ];
|
|
};
|
|
}
|