python3Packages.sqlcipher3: init at 0.5.4

This adds python bindings for sqlcipher from
https://github.com/coleifer/sqlcipher3.

It also adds two meta packages, sqlcipher3-binary
and sqlcipher3-wheels. The former is a binary-distribution
of sqlcipher3 from upstream. The latter is a fork that
builds its own wheels but ships no further source changes.

So we effectively make both wheel packages an alias for our
own source-built package. Similar to how e.g. psycopg2-binary
works in nixpkgs.
This commit is contained in:
phaer
2024-11-29 14:15:34 +01:00
parent b2c036cd1f
commit fe6dd4bf7c
4 changed files with 72 additions and 0 deletions
@@ -0,0 +1,13 @@
{
mkPythonMetaPackage,
sqlcipher3,
}:
mkPythonMetaPackage {
pname = "sqlcipher3-binary";
inherit (sqlcipher3) version;
dependencies = [ sqlcipher3 ];
optional-dependencies = sqlcipher3.optional-dependencies or { };
meta = {
inherit (sqlcipher3.meta) description homepage license;
};
}
@@ -0,0 +1,13 @@
{
mkPythonMetaPackage,
sqlcipher3,
}:
mkPythonMetaPackage {
pname = "sqlcipher3-wheels";
inherit (sqlcipher3) version;
dependencies = [ sqlcipher3 ];
optional-dependencies = sqlcipher3.optional-dependencies or { };
meta = {
inherit (sqlcipher3.meta) description homepage license;
};
}
@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
sqlcipher,
openssl,
}:
let
pname = "sqlcipher3";
version = "0.5.4";
in
buildPythonPackage {
inherit pname version;
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-4w/1jWTdQ+Gezt3RARahonrR2YiMxCRcdfK9qbA4Tnc=";
};
nativeBuildInputs = [
setuptools
];
buildInputs = [
sqlcipher
openssl
];
pythonImportChecks = [
"sqlcipher3"
];
meta = with lib; {
mainProgram = "sqlcipher3";
homepage = "https://github.com/coleifer/sqlcipher3";
description = "Python 3 bindings for SQLCipher";
license = licenses.zlib;
maintainers = with maintainers; [ phaer ];
};
}
+4
View File
@@ -15013,6 +15013,10 @@ self: super: with self; {
sqlbag = callPackage ../development/python-modules/sqlbag { };
sqlcipher3 = callPackage ../development/python-modules/sqlcipher3 {};
sqlcipher3-binary = callPackage ../development/python-modules/sqlcipher3-binary {};
sqlcipher3-wheels = callPackage ../development/python-modules/sqlcipher3-wheels {};
sqlfmt = callPackage ../development/python-modules/sqlfmt { };
sqlglot = callPackage ../development/python-modules/sqlglot { };