push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
{
lib,
stdenv,
buildPythonPackage,
# dependencies
botan3,
# build dependencies
setuptools,
setuptools-scm,
}:
buildPythonPackage rec {
pname = "botan3";
inherit (botan3) src version;
pyproject = true;
build-system = [
setuptools
setuptools-scm
];
# not necessary for build, but makes it easier to discover for
# SBOM tooling
buildInputs = [ botan3 ];
# not necessary for build, but makes it easier to discover for
# SBOM tooling
nativeBuildInputs = [
setuptools
setuptools-scm
];
sourceRoot = "Botan-${version}/src/python";
postPatch = ''
# remove again, when https://github.com/randombit/botan/pull/5040 got
# merged
cp ${./pyproject.toml} pyproject.toml
''
+ (
if stdenv.hostPlatform.isDarwin then
''
botanLibPath=$(find ${lib.getLib botan3}/lib -name 'libbotan-3.dylib' -print -quit)
substituteInPlace botan3.py --replace-fail 'libbotan-3.dylib' "$botanLibPath"
''
else if stdenv.hostPlatform.isMinGW then
''
botanLibPath=$(find ${lib.getLib botan3}/lib -name 'libbotan-3.dll' -print -quit)
substituteInPlace botan3.py --replace-fail 'libbotan-3.dll' "$botanLibPath"
''
# Linux/other Unix-like system
else
''
botanLibPath=$(find ${lib.getLib botan3}/lib -name 'libbotan-3.so' -print -quit)
substituteInPlace botan3.py --replace-fail 'libbotan-3.so' "$botanLibPath"
''
);
pythonImportsCheck = [ "botan3" ];
meta = {
description = "Python Bindings for botan3 cryptography library";
homepage = "https://github.com/randombit/botan";
changelog = "https://github.com/randombit/botan/blob/${version}/news.rst";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ thillux ];
};
}

View File

@@ -0,0 +1,35 @@
[project]
name = "botan3"
description = "Python bindings for Botan C++ cryptography library"
license = "BSD-2-Clause"
dynamic = [ "version" ]
authors = [
{name = "Jack Lloyd", email = "jack@randombit.net"},
{name = "Botan contributors" }
]
maintainers = [ {name = "Jack Lloyd", email = "jack@randombit.net"} ]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Security :: Cryptography",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
# adapt from time to time with the latest still supported version
requires-python = ">=3.9"
[project.urls]
Homepage = "https://botan.randombit.net/"
Issues = "https://github.com/randombit/botan/issues"
[build-system]
requires = [ "setuptools>=61", "setuptools-scm>=8" ]
build-backend = "setuptools.build_meta"
[tool.setuptools]
py-modules = ["botan3"]
# read version information from git
[tool.setuptools_scm]
root = "../.."