python-babel - 2.6.0 - various fixes (#4619)

* python-babel - 2.6.0 - various fixes
build separately from install
run tests
fix so pip can detect it's presence

* Attempt to fix Alex's complaint about a file not being mentioned.  It was listed later in sources.
This commit is contained in:
J. Peter Mugaas
2018-11-04 03:15:37 -06:00
committed by Алексей
parent 0ce1635f09
commit c314e3aba5

View File

@@ -5,7 +5,8 @@ _realname=babel
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.6.0
pkgrel=2
_core=33
pkgrel=3
pkgdesc="A collection of tools for internationalizing Python applications (mingw-w64)"
url="http://babel.pocoo.org/"
license=("BSD")
@@ -14,24 +15,54 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-pytz"
"${MINGW_PACKAGE_PREFIX}-python3-pytz")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/python-babel/babel/archive/v${pkgver}.tar.gz")
sha256sums=('f760326e6ae6ce290520aef63c3ee416a9258d7917addb0b6e086fe0e5911432')
checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytest"
"${MINGW_PACKAGE_PREFIX}-python3-pytest"
"${MINGW_PACKAGE_PREFIX}-python2-pytest-runner"
"${MINGW_PACKAGE_PREFIX}-python3-pytest-runner"
"${MINGW_PACKAGE_PREFIX}-python2-freezegun"
"${MINGW_PACKAGE_PREFIX}-python3-freezegun")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/python-babel/babel/archive/v${pkgver}.tar.gz"
"core-$_core.zip"::"http://unicode.org/Public/cldr/$_core/core.zip")
noextract=("core-$_core.zip")
sha256sums=('f760326e6ae6ce290520aef63c3ee416a9258d7917addb0b6e086fe0e5911432'
'fa3490082c086d21257153609642f54fcf788fcfda4966fe67f3f6daca0d58b9')
prepare() {
cd ${srcdir}
for pver in {2,3}; do
rm -rf python${pver}-build-${CARCH} | true
cp -r "${_pyname}-${pkgver}" "python${pver}-build-${CARCH}"
cp "$srcdir"/core-$_core.zip "python${pver}-build-${CARCH}"/cldr/core-$_core.0.zip
done
}
build() {
for pver in {2,3}; do
msg "Python ${pver} build for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py import_cldr
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py build
done
}
check() {
cd "${srcdir}"
for pver in {2,3}; do
msg "Python ${pver} test for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python${pver} setup.py pytest || true
done
}
package_python3-babel() {
depends=("${MINGW_PACKAGE_PREFIX}-python3-pytz")
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python3 setup.py import_cldr
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
@@ -46,9 +77,8 @@ package_python2-babel() {
depends=("${MINGW_PACKAGE_PREFIX}-python2-pytz")
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python2 setup.py import_cldr
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"