From 009c49589996321c095565ca17fe0eb9b0688d61 Mon Sep 17 00:00:00 2001 From: isaackwy Date: Sat, 9 Mar 2024 23:32:56 -0800 Subject: python/python3-pykeepass: Fix missing kdbx_parsing submodule, +use built-in isoformat support Signed-off-by: Willy Sudiarto Raharjo --- .../fix_missing_pykeepass_kdbx_parsing.patch | 13 +++++++++ .../python3-pykeepass/python3-pykeepass.SlackBuild | 10 ++++++- .../use_built_in_isoformat_support.patch | 33 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 python/python3-pykeepass/fix_missing_pykeepass_kdbx_parsing.patch create mode 100644 python/python3-pykeepass/use_built_in_isoformat_support.patch (limited to 'python/python3-pykeepass') diff --git a/python/python3-pykeepass/fix_missing_pykeepass_kdbx_parsing.patch b/python/python3-pykeepass/fix_missing_pykeepass_kdbx_parsing.patch new file mode 100644 index 0000000000..0f75cec6b2 --- /dev/null +++ b/python/python3-pykeepass/fix_missing_pykeepass_kdbx_parsing.patch @@ -0,0 +1,13 @@ +This patch was taken from Arch Linux's gitlab repo: +https://gitlab.archlinux.org/archlinux/packaging/packages/python-pykeepass/-/blob/main/0001-fix_missing_pykeepass_kdbx_parsing.patch +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -37,7 +37,7 @@ + Changelog = "https://github.com/libkeepass/pykeepass/blob/master/CHANGELOG.rst" + + [tool.setuptools] +-packages = ["pykeepass"] ++packages = ["pykeepass", "pykeepass.kdbx_parsing"] + include-package-data = true + + [build-system] diff --git a/python/python3-pykeepass/python3-pykeepass.SlackBuild b/python/python3-pykeepass/python3-pykeepass.SlackBuild index 347863ac37..a5a0d11d14 100644 --- a/python/python3-pykeepass/python3-pykeepass.SlackBuild +++ b/python/python3-pykeepass/python3-pykeepass.SlackBuild @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=python3-pykeepass VERSION=${VERSION:-4.0.7} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -64,6 +64,14 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# Fix missing pykeepass.kdbx_parsing when built with modern tools +# https://github.com/libkeepass/pykeepass/pull/378 +patch -p1 < $CWD/fix_missing_pykeepass_kdbx_parsing.patch + +# Use built-in isoformat support +# https://github.com/libkeepass/pykeepass/pull/383 +patch -p1 < $CWD/use_built_in_isoformat_support.patch + export PYTHONPATH=/opt/python3.9/site-packages/ python3 -m build --no-isolation diff --git a/python/python3-pykeepass/use_built_in_isoformat_support.patch b/python/python3-pykeepass/use_built_in_isoformat_support.patch new file mode 100644 index 0000000000..4daf98514b --- /dev/null +++ b/python/python3-pykeepass/use_built_in_isoformat_support.patch @@ -0,0 +1,33 @@ +This patch was taken from Arch Linux's gitlab repo: +https://gitlab.archlinux.org/archlinux/packaging/packages/python-pykeepass/-/blob/main/0002-Use_built_in_isoformat_support.patch +--- a/pykeepass/pykeepass.py ++++ b/pykeepass/pykeepass.py +@@ -28,7 +28,6 @@ + BLANK_DATABASE_FILENAME = "blank_database.kdbx" + BLANK_DATABASE_LOCATION = os.path.join(os.path.dirname(os.path.realpath(__file__)), BLANK_DATABASE_FILENAME) + BLANK_DATABASE_PASSWORD = "password" +-DT_ISOFORMAT = "%Y-%m-%dT%H:%M:%S%fZ" + + class PyKeePass(): + """Open a KeePass database +@@ -804,7 +803,7 @@ def _encode_time(self, value): + struct.pack('