From fe6dd4bf7c1582d38209383fe3eae742ebeec5da Mon Sep 17 00:00:00 2001 From: phaer Date: Sat, 2 Nov 2024 23:19:38 +0100 Subject: [PATCH 1/4] 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. --- .../sqlcipher3-binary/default.nix | 13 ++++++ .../sqlcipher3-wheels/default.nix | 13 ++++++ .../python-modules/sqlcipher3/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 ++ 4 files changed, 72 insertions(+) create mode 100644 pkgs/development/python-modules/sqlcipher3-binary/default.nix create mode 100644 pkgs/development/python-modules/sqlcipher3-wheels/default.nix create mode 100644 pkgs/development/python-modules/sqlcipher3/default.nix diff --git a/pkgs/development/python-modules/sqlcipher3-binary/default.nix b/pkgs/development/python-modules/sqlcipher3-binary/default.nix new file mode 100644 index 0000000000000..e76a4093e2c7d --- /dev/null +++ b/pkgs/development/python-modules/sqlcipher3-binary/default.nix @@ -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; + }; +} diff --git a/pkgs/development/python-modules/sqlcipher3-wheels/default.nix b/pkgs/development/python-modules/sqlcipher3-wheels/default.nix new file mode 100644 index 0000000000000..85be97faa92cb --- /dev/null +++ b/pkgs/development/python-modules/sqlcipher3-wheels/default.nix @@ -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; + }; +} diff --git a/pkgs/development/python-modules/sqlcipher3/default.nix b/pkgs/development/python-modules/sqlcipher3/default.nix new file mode 100644 index 0000000000000..2a8dfac69b9a6 --- /dev/null +++ b/pkgs/development/python-modules/sqlcipher3/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 663777894e796..df6a7b8f88f41 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -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 { }; From 0f731eb8d1e3a63d841ddb9d64292c1d73e794fc Mon Sep 17 00:00:00 2001 From: belamu Date: Sat, 2 Nov 2024 11:34:57 +0100 Subject: [PATCH 2/4] signal-export: increase version to 3.2.0 --- pkgs/by-name/si/signal-export/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/si/signal-export/package.nix b/pkgs/by-name/si/signal-export/package.nix index 93e82dbaf27da..44120afa331ec 100644 --- a/pkgs/by-name/si/signal-export/package.nix +++ b/pkgs/by-name/si/signal-export/package.nix @@ -6,25 +6,26 @@ python3.pkgs.buildPythonApplication rec { pname = "signal-export"; - version = "1.8.2"; + version = "3.2.0"; pyproject = true; src = fetchPypi { - inherit pname version; - hash = "sha256-Hm0BVF2RUsxDacsAB3MJtk1t9FYmBPjeb5JzwaLkZ14="; + inherit version; + pname = "signal_export"; + hash = "sha256-b0oJXUbJ9545oVMXBcM4MFjK3U3RiAT1lv9NUu6gF04="; }; nativeBuildInputs = with python3.pkgs; [ - setuptools-scm + pdm-backend ]; propagatedBuildInputs = with python3.pkgs; [ - setuptools typer beautifulsoup4 emoji markdown - pysqlcipher3 + pycryptodome + sqlcipher3-wheels ]; passthru.updateScript = nix-update-script { }; From 10f6d55b84ecd1c0475a00138bdc45dde5e8ee62 Mon Sep 17 00:00:00 2001 From: belamu Date: Sat, 21 Dec 2024 12:11:45 +0100 Subject: [PATCH 3/4] signal-export: 3.2.0 -> 3.2.2 includes decryption with more key providers, namely the one from KDE --- pkgs/by-name/si/signal-export/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/si/signal-export/package.nix b/pkgs/by-name/si/signal-export/package.nix index 44120afa331ec..003b2952bff41 100644 --- a/pkgs/by-name/si/signal-export/package.nix +++ b/pkgs/by-name/si/signal-export/package.nix @@ -6,13 +6,13 @@ python3.pkgs.buildPythonApplication rec { pname = "signal-export"; - version = "3.2.0"; + version = "3.2.2"; pyproject = true; src = fetchPypi { inherit version; pname = "signal_export"; - hash = "sha256-b0oJXUbJ9545oVMXBcM4MFjK3U3RiAT1lv9NUu6gF04="; + hash = "sha256-QHTix56hdujxWr+pjCg6zu15tCB7YoDSzmNpWwWOHN0="; }; nativeBuildInputs = with python3.pkgs; [ From 1bae375e38b8f6a0a0da953d2b48ecf2bc629b20 Mon Sep 17 00:00:00 2001 From: belamu Date: Wed, 1 Jan 2025 20:09:59 +0100 Subject: [PATCH 4/4] signal-export: use built-system key the built-system key is specific to python packages and therefore preferable over the more general nativeBuildInputs see https://github.com/NixOS/nixpkgs/pull/353086#discussion_r1832644539 --- pkgs/by-name/si/signal-export/package.nix | 2 +- pkgs/development/python-modules/sqlcipher3/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/si/signal-export/package.nix b/pkgs/by-name/si/signal-export/package.nix index 003b2952bff41..28e6960ed4597 100644 --- a/pkgs/by-name/si/signal-export/package.nix +++ b/pkgs/by-name/si/signal-export/package.nix @@ -15,7 +15,7 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-QHTix56hdujxWr+pjCg6zu15tCB7YoDSzmNpWwWOHN0="; }; - nativeBuildInputs = with python3.pkgs; [ + build-system = with python3.pkgs; [ pdm-backend ]; diff --git a/pkgs/development/python-modules/sqlcipher3/default.nix b/pkgs/development/python-modules/sqlcipher3/default.nix index 2a8dfac69b9a6..cf91ac2872c46 100644 --- a/pkgs/development/python-modules/sqlcipher3/default.nix +++ b/pkgs/development/python-modules/sqlcipher3/default.nix @@ -19,7 +19,7 @@ buildPythonPackage { hash = "sha256-4w/1jWTdQ+Gezt3RARahonrR2YiMxCRcdfK9qbA4Tnc="; }; - nativeBuildInputs = [ + build-system = [ setuptools ];