Skip to content

Commit

Permalink
Use PEP 517 for building if supported (8/10)
Browse files Browse the repository at this point in the history
  • Loading branch information
MehdiChinoune committed Jan 20, 2025
1 parent b09e07c commit 5323cea
Show file tree
Hide file tree
Showing 23 changed files with 269 additions and 425 deletions.
7 changes: 4 additions & 3 deletions mingw-w64-mypy/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ pkgver=1.14.1
pkgrel=1
pkgdesc="Optional static typing for Python 3 (PEP484) (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.mypy-lang.org/"
msys2_repository_url="/~https://github.com/python/mypy"
msys2_references=(
'pypi: mypy'
)
url="https://www.mypy-lang.org/"
msys2_repository_url="/~https://github.com/python/mypy"
license=('spdx:MIT')
depends=(
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-mypy_extensions"
"${MINGW_PACKAGE_PREFIX}-python-typing_extensions"
)
Expand Down
9 changes: 5 additions & 4 deletions mingw-w64-python-flake8/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ pkgver=7.1.1
pkgrel=1
pkgdesc="The modular source code checker: pep8, pyflakes and co (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://flake8.pycqa.org/"
msys2_repository_url='/~https://github.com/PyCQA/flake8'
msys2_references=(
'archlinux: flake8'
'pypi: flake8'
)
msys2_repository_url='/~https://github.com/PyCQA/flake8'
url="https://flake8.pycqa.org/"
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python-pyflakes"
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-pyflakes"
"${MINGW_PACKAGE_PREFIX}-python-mccabe"
"${MINGW_PACKAGE_PREFIX}-python-pycodestyle")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
Expand Down
35 changes: 14 additions & 21 deletions mingw-w64-python-jupyter-nbviewer/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ _realname=nbviewer
pkgbase=mingw-w64-python-jupyter-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-python-jupyter-${_realname}
pkgver=1.0.1
pkgrel=6
pkgrel=7
pkgdesc='Render Jupyter Notebooks as static web pages (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://jupyter.org'
msys2_repository_url="/~https://github.com/jupyter/nbviewer"
msys2_references=(
'pypi: nbviewer'
)
url='https://jupyter.org'
license=('BSD')
license=('spdx:BSD-4-Clause')
depends=(
${MINGW_PACKAGE_PREFIX}-python
${MINGW_PACKAGE_PREFIX}-python-elasticsearch
Expand All @@ -25,36 +26,28 @@ depends=(
${MINGW_PACKAGE_PREFIX}-python-statsd
)
makedepends=(
${MINGW_PACKAGE_PREFIX}-python-build
${MINGW_PACKAGE_PREFIX}-python-installer
${MINGW_PACKAGE_PREFIX}-python-setuptools
${MINGW_PACKAGE_PREFIX}-python-invoke
${MINGW_PACKAGE_PREFIX}-python-versioneer
)
source=("${_realname}-${pkgver}.tar.gz::https://github.com/jupyter/${_realname}/archive/${pkgver}.tar.gz")
sha256sums=('2fe0b0ee8ec5c8e2e173b8f15a22e42ba583fc6d4fa60ddb7aa40e9ee972f268')
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('85233e53bc78ff216a99a2676a7e5f9557f0d4973797c36fdb81c9cc48821a73')

prepare() {
rm -f "${srcdir}"/${_realname}-${pkgver}/versioneer.py | true

rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"

# Disable check for non-windows modules
sed -i "s|newrelic!=2.80.0.60||g" requirements.txt
sed -i "s|pylibmc||g" requirements.txt

${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

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
cd "${srcdir}"/python-build-${MSYSTEM}

install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
}
27 changes: 14 additions & 13 deletions mingw-w64-python-kiwisolver/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=kiwisolver
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.4.8
pkgrel=1
pkgrel=2
pkgdesc="A fast implementation of the Cassowary constraint solver (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand All @@ -14,26 +14,26 @@ msys2_references=(
)
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm"
"${MINGW_PACKAGE_PREFIX}-python-cppy"
"${MINGW_PACKAGE_PREFIX}-cc")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest")
source=("https://github.com/nucleic/kiwi/archive/${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('e8848589c1548a292e99eadc712f14d8924e77f390b7de0a4a5359ee8e4a480f')
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('23d5f023bdc8c7e54eb65f03ca5d5bb25b601eac4d7f1a042888a1f45237987e')

prepare() {
cd "${srcdir}"
rm -rf python-build-${MSYSTEM} | true
cp -r "kiwi-${pkgver}" "python-build-${MSYSTEM}"
cd "${srcdir}"/"${_realname}-${pkgver}"

# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}

build() {
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
Expand All @@ -42,10 +42,11 @@ check() {
}

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
cd "${srcdir}"/python-build-${MSYSTEM}

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

install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
40 changes: 16 additions & 24 deletions mingw-w64-python-language-server/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.pro>

_realname=language-server
_pyname=python-language-server
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=0.36.2
pkgrel=5
pkgrel=6
pkgdesc="An implementation of the Language Server Protocol for Python (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="/~https://github.com/palantir/python-language-server"
msys2_references=(
'pypi: python-language-server'
)
url="/~https://github.com/palantir/python-language-server"
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-future"
"${MINGW_PACKAGE_PREFIX}-python-jedi"
"${MINGW_PACKAGE_PREFIX}-python-jsonrpc-server"
"${MINGW_PACKAGE_PREFIX}-python-pluggy"
"${MINGW_PACKAGE_PREFIX}-python-ujson")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-versioneer")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-coverage"
"${MINGW_PACKAGE_PREFIX}-python-pytest"
Expand All @@ -33,15 +36,16 @@ checkdepends=("${MINGW_PACKAGE_PREFIX}-python-coverage"
"${MINGW_PACKAGE_PREFIX}-python-yapf"
"${MINGW_PACKAGE_PREFIX}-python-pylint"
"${MINGW_PACKAGE_PREFIX}-python-mock")
source=("python-${_realname}-${pkgver}.tar.gz"::"${url}/archive/${pkgver}.tar.gz"
options=(!strip)
source=("https://pypi.org/packages/source/${_pyname::1}/${_pyname}/${_pyname}-${pkgver}.tar.gz"
"001-python-language-server-0.36.2-fix-versioneer.patch"
"002-python-language-server-0.36.2-fix-setup.patch")
sha256sums=('fb573f780467c1cae0de47065eecbaaf9b457bd5cbe9f5cf8409224e1cd21cf6'
sha256sums=('9984c84a67ee2c5102c8e703215f407fcfa5e62b0ae86c9572d0ada8c4b417b0'
'fb52b245c4f59a50ecb5f689eea9fd9a86a8577a5f91a677f1fcb2b4cc262e90'
'd45d3b1dec94a9033dd13b3754ffe17396e19f1621b26fbc87fe5f84214d0b89')

prepare() {
cd "${srcdir}/python-${_realname}-${pkgver}"
cd "${srcdir}/${_pyname}-${pkgver}"

patch -p1 -i "${srcdir}/001-python-language-server-0.36.2-fix-versioneer.patch"
patch -p1 -i "${srcdir}/002-python-language-server-0.36.2-fix-setup.patch"
Expand All @@ -50,15 +54,8 @@ prepare() {
}

build() {
cd "${srcdir}"
rm -rf "python-build-${MSYSTEM}" | true
cp -r "python-${_realname}-${pkgver}" "python-build-${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"

msg "Python build for ${MSYSTEM}"
PYTHONHASHSEED=0 \
VERSIONEER_OVERRIDE=${pkgver} \
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_pyname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
Expand All @@ -73,16 +70,11 @@ check() {
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"

MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
VERSIONEER_OVERRIDE=${pkgver} \
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1 --skip-build
cd "${srcdir}"/python-build-${MSYSTEM}

# remove shebang line
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*-script.py; do
sed -e '1 { s/^#!.*$// }' -i ${_f}
done
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
Expand Down
60 changes: 16 additions & 44 deletions mingw-w64-python-ldap3/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,68 +3,40 @@
_realname=ldap3
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.9.1
pkgrel=4
pkgrel=5
pkgdesc="a strictly RFC 4510 conforming LDAP V3 pure Python client (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='/~https://github.com/cannatag/ldap3'
msys2_references=(
'pypi: ldap3'
)
license=('LICENSE')
license=('spdx:LGPL-3.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-pyasn1")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("${_realname}-${pkgver}.tar.gz"::"/~https://github.com/cannatag/ldap3/archive/v${pkgver}.tar.gz")
sha512sums=('bf07ebca9a53a8c225bc3106d3bd45eb26557c6e5a3d6d45a7f8c149d938ad43825eed0d406a57b93e2e675ed7aa262828f022ab82eb683f0e3029e3ad823106')

apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}

del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}

prepare() {
cd "${srcdir}"
rm -rf python-build-${MSYSTEM} | true
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}"

# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('f3e7fc4718e3f09dda568b57100095e0ce58633bcabbed8667ce3f8fbaa4229f')

build() {
msg "Python build for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
msg "Python test for ${MSYSTEM}"
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py check
${MINGW_PREFIX}/bin/python -m pytest
}

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
cd "${srcdir}"/python-build-${MSYSTEM}

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

install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/COPYING"
}
34 changes: 14 additions & 20 deletions mingw-w64-python-lhafile/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,35 @@
_realname=lhafile
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-lhafile")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.3.0
pkgrel=4
pkgrel=5
pkgdesc="LHA module for Python (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('BSD')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="/~https://github.com/FrodeSolheim/python-lhafile"
msys2_references=(
'pypi: lhafile'
)
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=(${_realname}-${pkgver}.tar.gz::/~https://github.com/FrodeSolheim/python-lhafile/archive/v${pkgver}.tar.gz)
sha256sums=('5565641820813c76c74f2199f19f6ee0e3ae1e1c14de1a3a4ea3602f9094cd29')

prepare() {
rm -rf "python-build-${MSYSTEM}" | true
cp -r "python-${_realname}-${pkgver}" "python-build-${MSYSTEM}"
}
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-cc")
source=(https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz)
sha256sums=('c85f9152197a81103a5e8b5948bca36156c166d3aea3a46ff43829be0b996eae')

build() {
cd "${srcdir}/python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python setup.py build
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
cd "${srcdir}/python-build-${MSYSTEM}"

MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl

install -m755 -d "${pkgdir}${MINGW_PREFIX}/share/licenses/python-lhafile"
install -m644 COPYING.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-lhafile/"
Expand Down
Loading

0 comments on commit 5323cea

Please sign in to comment.