python-protobuf: Drop Python 2 package

This commit is contained in:
Christoph Reiter
2019-11-30 19:32:35 +01:00
parent 9a666c84bd
commit 98aec9e473

View File

@@ -2,73 +2,38 @@
_realname=protobuf
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=3.10.1
pkgrel=1
pkgrel=2
pkgdesc="Protocol Buffers. (mingw-w64)"
arch=('any')
url="https://github.com/protocolbuffers/protobuf"
license=('3-Clause BSD License')
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-six"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-protobuf=${pkgver}")
_archive=${_realname/_/-}-${pkgver}
source=(${_archive}.tar.gz::https://github.com/protocolbuffers/protobuf/archive/v${pkgver}.tar.gz)
sha256sums=('6adf73fd7f90409e479d6ac86529ade2d45f50494c5c10f539226693cb8fe4f7')
noextract=(${_archive}.tar.gz)
_deps=('six' 'setuptools')
_deps2=('ordereddict' 'unittest2')
_deps3=()
prepare() {
bsdtar -xf ${_archive}.tar.gz || true
}
build() {
cd "${srcdir}"
rm -rf python{2,3}-build
for builddir in python{2,3}-build; do
msg2 "Building for ${CARCH} ${builddir%-build} ..."
cp -r ${_archive} ${builddir}
pushd $builddir/python
${MINGW_PREFIX}/bin/${builddir%-build} setup.py --quiet build
popd
done
cd "${srcdir}/${_archive}/python"
${MINGW_PREFIX}/bin/python3 setup.py --quiet build
}
package_python3-protobuf() {
depends=("${MINGW_PACKAGE_PREFIX}-python3" "${_deps[@]/#/${MINGW_PACKAGE_PREFIX}-python3-}" "${_deps3[@]/#/${MINGW_PACKAGE_PREFIX}-python3-}")
package() {
cd "${srcdir}/${_archive}/python"
cd "${srcdir}/python3-build/python"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py --quiet install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1
install -Dm644 ../LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
}
package_python2-protobuf() {
depends=("${MINGW_PACKAGE_PREFIX}-python2" "${_deps[@]/#/${MINGW_PACKAGE_PREFIX}-python2-}" "${_deps2[@]/#/${MINGW_PACKAGE_PREFIX}-python2-}")
cd "${srcdir}/python2-build/python"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py --quiet install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1
install -Dm644 ../LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE"
}
package_mingw-w64-i686-python2-protobuf() {
package_python2-${_realname}
}
package_mingw-w64-i686-python3-protobuf() {
package_python3-${_realname}
}
package_mingw-w64-x86_64-python2-protobuf() {
package_python2-${_realname}
}
package_mingw-w64-x86_64-python3-protobuf() {
package_python3-${_realname}
}