python-zxing-cpp: Add package

This commit is contained in:
Biswapriyo Nath 2025-02-04 09:29:09 +00:00
parent 861b76a67f
commit ff6faba4a0
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@
build_args = ['--config', cfg,
'-j', '8']
- if platform.system() == "Windows":
+ if platform.system() == "Windows" and "MSC" in platform.python_compiler():
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
if sys.maxsize > 2**32:
cmake_args += ['-A', 'x64']

View File

@ -0,0 +1,49 @@
# Maintainer: Biswapriyo Nath <nathbappai@gmail.com>
_realname=zxing-cpp
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.3.0
pkgrel=1
pkgdesc="Python bindings for the zxing-cpp barcode library (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/zxing-cpp/zxing-cpp'
license=('spdx:Apache-2.0')
depends=(
"${MINGW_PACKAGE_PREFIX}-python"
)
makedepends=(
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pybind11"
"${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
)
options=('!strip')
source=(
"https://pypi.org/packages/source/${_realname::1}/${_realname/-/_}/${_realname/-/_}-${pkgver}.tar.gz"
0001-setup-check-msc-python.patch
)
sha256sums=('3babedb67a4c15c9de2c2b4c42d70af83a6c85780c1b2d9803ac64c6ae69f14e'
'd29a068937f9fdf0b82d314461f35c5f094b65f152afc57c593258d97fcfbd25')
prepare() {
cd "${_realname/-/_}-${pkgver}"
patch -p1 -i "${srcdir}"/0001-setup-check-msc-python.patch
}
build() {
cp -r "${_realname/-/_}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
python -m build --wheel --skip-dependency-check --no-isolation
}
package() {
cd "python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=" \
python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
}