python3Packages.pysodium: init at 0.7.18

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
Ethan Carter Edwards 2025-08-11 11:48:41 -04:00
parent 99c4eddd47
commit a5bebf0fb7
No known key found for this signature in database
GPG Key ID: D83DC5377393C7E6
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,47 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
setuptools,
libsodium,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pysodium";
version = "0.7.18";
pyproject = true;
src = fetchFromGitHub {
owner = "stef";
repo = "pysodium";
tag = "v${version}";
hash = "sha256-F2215AAI8UIvn6UbaJ/YxI4ZolCzlwY6nS5IafTs+i4=";
};
postPatch =
let
soext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
substituteInPlace ./pysodium/__init__.py --replace-fail \
"ctypes.util.find_library('sodium') or ctypes.util.find_library('libsodium')" "'${libsodium}/lib/libsodium${soext}'"
'';
build-system = [ setuptools ];
buildInputs = [ libsodium ];
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "pysodium" ];
meta = {
description = "Wrapper for libsodium providing high level crypto primitives";
homepage = "https://github.com/stef/pysodium";
changelog = "https://github.com/stef/pysodium/releases/tag/v${version}";
maintainers = [ lib.maintainers.ethancedwards8 ];
license = lib.licenses.bsd2;
};
}

View File

@ -14066,6 +14066,8 @@ self: super: with self; {
pysocks = callPackage ../development/python-modules/pysocks { };
pysodium = callPackage ../development/python-modules/pysodium { };
pysol-cards = callPackage ../development/python-modules/pysol-cards { };
pysolarmanv5 = callPackage ../development/python-modules/pysolarmanv5 { };