python3Packages.pyoprf: init at 0.7.1 (#432855)

This commit is contained in:
Gaétan Lepage 2025-08-14 23:33:39 +02:00 committed by GitHub
commit 9b0c9eeeed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,54 @@
{
lib,
stdenv,
buildPythonPackage,
liboprf,
setuptools,
pysodium,
securestring,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pyoprf";
pyproject = true;
inherit (liboprf)
version
src
;
postPatch =
let
soext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
substituteInPlace ./pyoprf/__init__.py --replace-fail \
"ctypes.util.find_library('oprf') or ctypes.util.find_library('liboprf')" "'${lib.getLib liboprf}/lib/liboprf${soext}'"
'';
sourceRoot = "${src.name}/python";
build-system = [ setuptools ];
dependencies = [
pysodium
securestring
];
pythonImportsCheck = [ "pyoprf" ];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "tests/test.py" ];
meta = {
inherit (liboprf.meta)
description
homepage
changelog
license
teams
;
};
}

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

@ -0,0 +1,36 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
openssl,
}:
buildPythonPackage rec {
pname = "securestring";
version = "0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "dnet";
repo = "pysecstr";
tag = "v${version}";
hash = "sha256-FV5NUPberA5nqHad8IwkQLMldT1DPqTGpqOwgQ2zSdI=";
};
build-system = [ setuptools ];
buildInputs = [ openssl ];
pythonImportsCheck = [ "SecureString" ];
# no upstream tests exist
doCheck = false;
meta = {
description = "Clears the contents of strings containing cryptographic material";
homepage = "https://github.com/dnet/pysecstr";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.ethancedwards8 ];
};
}

View File

@ -13520,6 +13520,8 @@ self: super: with self; {
pyoppleio-legacy = callPackage ../development/python-modules/pyoppleio-legacy { };
pyoprf = callPackage ../development/python-modules/pyoprf { };
pyorc = callPackage ../development/python-modules/pyorc { };
pyorthanc = callPackage ../development/python-modules/pyorthanc { };
@ -14078,6 +14080,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 { };
@ -16307,6 +16311,8 @@ self: super: with self; {
secure = callPackage ../development/python-modules/secure { };
securestring = callPackage ../development/python-modules/securestring { };
securesystemslib = callPackage ../development/python-modules/securesystemslib { };
securetar = callPackage ../development/python-modules/securetar { };