Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new package] python-pypng 0.20231004.0 #22921

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions mingw-w64-python-pypng/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>

_realname=pypng
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}"
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
pkgver=0.20231004.0
pkgrel=1
pkgdesc='Pure Python library for PNG image encoding/decoding (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://gitlab.com/drj11/pypng'
license=('spdx:MIT')
podsvirov marked this conversation as resolved.
Show resolved Hide resolved
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-sphinx")
options=('!strip')
source=("${url}/-/archive/${_realname}-${pkgver}/${_realname}-${_realname}-${pkgver}.tar.gz"
"${url}/-/commit/e5b02fab72436f10b12e04ca6763b42495a586a3.patch")
sha256sums=('e32c8ea6a6801dadede06f9e0e9122b50d93405dd30c1e3c4f9f44bb94090a25'
'b4d8b503cb42680ef9cd7ab7d43c18e5ff5c39b093c0895afb7bae8d3f074026')

prepare() {
cd "${_realname}-${_realname}-${pkgver}"

# In Sphinx doc, Use a configparser
patch -p1 -i "${srcdir}"/e5b02fab72436f10b12e04ca6763b42495a586a3.patch
}

build() {
cp -r "${_realname}-${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

python -m build --wheel --skip-dependency-check --no-isolation

make -C man html
}

package_python-pypng() {
cd "python-build-${MSYSTEM}"

MSYS2_ARG_CONV_EXCL="--prefix=" \
python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 LICENCE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}

package_python-pypng-docs() {
pkgdesc+=" (documentation)"
depends=()

mkdir -p "${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}"
cp -a "${srcdir}/python-build-${MSYSTEM}/man/_build/html" "${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}/html"
}

# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :

# generate wrappers
for _name in "${pkgname[@]}"; do
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
_func="$(declare -f "${_short}")"
eval "${_func/#${_short}/package_${_name}}"
done
# template end;
Loading