From 795f75c86e2cac4c2bd04b658c0cb2d3b7f23f8c Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 9 May 2022 23:03:20 +1000 Subject: [PATCH] python-dotty-dict: new package --- .../0001-readme-utf8.patch | 19 ++++++++ .../0002-setuptools-scm-dependency.patch | 11 +++++ mingw-w64-python-dotty-dict/PKGBUILD | 46 +++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 mingw-w64-python-dotty-dict/0001-readme-utf8.patch create mode 100644 mingw-w64-python-dotty-dict/0002-setuptools-scm-dependency.patch create mode 100644 mingw-w64-python-dotty-dict/PKGBUILD diff --git a/mingw-w64-python-dotty-dict/0001-readme-utf8.patch b/mingw-w64-python-dotty-dict/0001-readme-utf8.patch new file mode 100644 index 0000000000000..6f7f3dfbf5558 --- /dev/null +++ b/mingw-w64-python-dotty-dict/0001-readme-utf8.patch @@ -0,0 +1,19 @@ +--- a/setup.py ++++ b/setup.py +@@ -12,14 +12,14 @@ + __author__ = 'Paweł Zadrożny' + __copyright__ = 'Copyright (c) 2018, Pawelzny' + +-with open('README.rst', 'r') as readme_file: ++with open('README.rst', 'r', encoding='utf-8') as readme_file: + readme = readme_file.read() + + + def get_version(*file_paths): + """Retrieves the version from project/__init__.py""" + filename = os.path.join(os.path.dirname(__file__), *file_paths) +- version_file = open(filename).read() ++ version_file = open(filename, encoding='utf-8').read() + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, re.M) + if version_match: diff --git a/mingw-w64-python-dotty-dict/0002-setuptools-scm-dependency.patch b/mingw-w64-python-dotty-dict/0002-setuptools-scm-dependency.patch new file mode 100644 index 0000000000000..712edfb427b84 --- /dev/null +++ b/mingw-w64-python-dotty-dict/0002-setuptools-scm-dependency.patch @@ -0,0 +1,11 @@ +--- a/setup.py ++++ b/setup.py +@@ -56,7 +56,7 @@ + package_dir={'dotty_dict': 'dotty_dict'}, + include_package_data=True, + use_scm_version=True, +- install_requires=['setuptools_scm'], ++ setup_requires=['setuptools_scm'], + zip_safe=False, + keywords='dot notation dict wrapper helper utils lib', + classifiers=[ diff --git a/mingw-w64-python-dotty-dict/PKGBUILD b/mingw-w64-python-dotty-dict/PKGBUILD new file mode 100644 index 0000000000000..ed643f782e3bb --- /dev/null +++ b/mingw-w64-python-dotty-dict/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: fauxpark + +_realname=dotty_dict +pkgbase=mingw-w64-python-${_realname/_/-} +pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname/_/-}") +pkgver=1.3.0 +pkgrel=1 +pkgdesc="Dictionary wrapper for quick access to deeply nested keys (mingw-w64)" +arch=('any') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') +url='https://github.com/pawelzny/dotty_dict' +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python") +makedepends=("${MINGW_PACKAGE_PREFIX}-python" + "${MINGW_PACKAGE_PREFIX}-python-setuptools" + "${MINGW_PACKAGE_PREFIX}-python-setuptools-scm") +source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz" + "0001-readme-utf8.patch" + "0002-setuptools-scm-dependency.patch") +sha256sums=('eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0' + '072e21c8e963ac7d446d36e8946a94b0be333e0a3d597b19e6f2ab068bc56ba6' + '7deb7ff6d1ab9519667af7423daa7f83a8fc3efb4f7591b0d0369b2f5e964fe1') + +prepare() { + cd "${srcdir}/${_realname}-${pkgver}" + + patch -Np1 -i "${srcdir}/0001-readme-utf8.patch" + patch -Np1 -i "${srcdir}/0002-setuptools-scm-dependency.patch" +} + +build() { + cd "${srcdir}" + cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}" + + "${MINGW_PREFIX}"/bin/python setup.py build +} + +package() { + cd "${srcdir}/python-build-${MSYSTEM}" + + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + "${MINGW_PREFIX}"/bin/python setup.py install --prefix="${MINGW_PREFIX}" \ + --root="${pkgdir}" --optimize=1 --skip-build + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname/_/-}/LICENSE" +}