From d918f8917cc8946ba286ab458c4be21bd068e160 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 18 May 2019 15:48:04 +0200 Subject: [PATCH] python2-backports.functools_lru_cache: depend on python2-backports Also clean things up a bit and make the pkgbase match the dirname Fixes #4503 --- .../PKGBUILD | 74 ------------------- .../PKGBUILD | 51 +++++++++++++ 2 files changed, 51 insertions(+), 74 deletions(-) delete mode 100644 mingw-w64-python2-backports.functools-lru-cache/PKGBUILD create mode 100644 mingw-w64-python2-backports.functools_lru_cache/PKGBUILD diff --git a/mingw-w64-python2-backports.functools-lru-cache/PKGBUILD b/mingw-w64-python2-backports.functools-lru-cache/PKGBUILD deleted file mode 100644 index 92a4e53be9..0000000000 --- a/mingw-w64-python2-backports.functools-lru-cache/PKGBUILD +++ /dev/null @@ -1,74 +0,0 @@ -# Maintainer: J. Peter Mugaas - -_realname=backports.functools_lru_cache -pkgbase=mingw-w64-python2-${_realname} -pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}" -pkgver=1.5 -pkgrel=1 -pkgdesc="Backport of functools.lru_cache from Python 3.3 as published at ActiveState (mingw-w64)" -arch=('any') -url='https://github.com/jaraco/backports.functools_lru_cache' -license=('MIT') -depends=("${MINGW_PACKAGE_PREFIX}-python2-backports") -makedepends=("${MINGW_PACKAGE_PREFIX}-python2" - "${MINGW_PACKAGE_PREFIX}-python2-setuptools") -checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytest-runner") -optdepends=("${MINGW_PACKAGE_PREFIX}-python2-ipaddress: for IPAddress ServerAltnames support") -options=('staticlibs' 'strip' '!debug') -source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/jaraco/backports.functools_lru_cache/archive/$pkgver.tar.gz") -sha256sums=('735e2d2985f0200637feffdf0bba8ef46f7feee1fd166f2d6a30df935416e5e9') - -# Helper macros to help make tasks easier # -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 python2-build-${CARCH} | true - cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}" - # Set version for setuptools_scm - export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver -} - -# Note that build() is sometimes skipped because it's done in -# the packages setup.py install for simplicity if you can do so. -# but sometimes, you want to do a check before install which would -# also trigger the build. -build() { - msg "Python 2 build for ${CARCH}" - cd python2-build-${CARCH} - ${MINGW_PREFIX}/bin/python${pver} setup.py build -} - -check() { - msg "Python 2 test for ${CARCH}" - cd python2-build-${CARCH} - ${MINGW_PREFIX}/bin/python2 setup.py pytest -} - -package() { - depends=("${MINGW_PACKAGE_PREFIX}-python2") - - cd "${srcdir}/python2-build-${CARCH}" - MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ - ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \ - --root="${pkgdir}" --optimize=1 --skip-build - # This looks odd but the backports namespace module was imported earlier - rm "$pkgdir${MINGW_PREFIX}/lib/python2.7/site-packages/backports/"__init__.py* -} - diff --git a/mingw-w64-python2-backports.functools_lru_cache/PKGBUILD b/mingw-w64-python2-backports.functools_lru_cache/PKGBUILD new file mode 100644 index 0000000000..7fe44ca578 --- /dev/null +++ b/mingw-w64-python2-backports.functools_lru_cache/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: J. Peter Mugaas + +_realname=backports.functools_lru_cache +pkgbase=mingw-w64-python2-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}" +pkgver=1.5 +pkgrel=2 +pkgdesc="Backport of functools.lru_cache from Python 3.3 as published at ActiveState (mingw-w64)" +arch=('any') +url='https://github.com/jaraco/backports.functools_lru_cache' +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python2-backports") +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools-scm") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytest-runner") +optdepends=("${MINGW_PACKAGE_PREFIX}-python2-ipaddress: for IPAddress ServerAltnames support") +options=('staticlibs' 'strip' '!debug') +source=("https://pypi.io/packages/source/b/${_realname}/${_realname}-${pkgver}.tar.gz") +sha256sums=('9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a') + +prepare() { + cd "${srcdir}" + +} + +build() { + rm -rf python2-build-${CARCH} + cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}" + cd python2-build-${CARCH} + + ${MINGW_PREFIX}/bin/python2 setup.py build +} + +check() { + cd python2-build-${CARCH} + + ${MINGW_PREFIX}/bin/python2 setup.py pytest +} + +package() { + cd "${srcdir}/python2-build-${CARCH}" + + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \ + --root="${pkgdir}" --optimize=1 --skip-build + + # This looks odd but the backports namespace module was imported earlier + rm "$pkgdir${MINGW_PREFIX}/lib/python2.7/site-packages/backports/"__init__.py* +} +