Add mingw-w64-python-xlrd (#4750)
* Add mingw-w64-python-xlrd
* python-xlrd: Add "${MINGW_PACKAGE_PREFIX}-python2" and "${MINGW_PACKAGE_PREFIX}-python3" to depends.
This commit is contained in:
73
mingw-w64-python-xlrd/PKGBUILD
Normal file
73
mingw-w64-python-xlrd/PKGBUILD
Normal file
@@ -0,0 +1,73 @@
|
||||
# Maintainer: gym603 <gui_yuan_miao@163.com>
|
||||
|
||||
_realname=xlrd
|
||||
pkgbase=mingw-w64-python-${_realname}
|
||||
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
||||
pkgver=1.1.0
|
||||
pkgrel=1
|
||||
pkgdesc="Library for developers to extract data from Microsoft Excel (tm) spreadsheet files (mingw-w64)"
|
||||
arch=('any')
|
||||
license=('custom')
|
||||
url="https://github.com/python-excel/xlrd"
|
||||
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
||||
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
|
||||
source=(${_realname}-${pkgver}.tar.gz::https://github.com/python-excel/xlrd/archive/${pkgver}.tar.gz)
|
||||
sha256sums=('D51562C0D0C78E68AA5DB59CF31E01A68B2CB1173E89C567653467081ED4CEF3')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}"
|
||||
rm -rf python{2,3}-build
|
||||
for builddir in python{2,3}-build; do
|
||||
cp -r ${_realname}-${pkgver} ${builddir}
|
||||
pushd $builddir
|
||||
${MINGW_PREFIX}/bin/${builddir%-build} setup.py build
|
||||
popd
|
||||
done
|
||||
}
|
||||
|
||||
package_python3-xlrd() {
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-python3")
|
||||
|
||||
cd "${srcdir}/python3-build"
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1
|
||||
|
||||
install -Dm644 docs/licenses.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/licenses.rst"
|
||||
|
||||
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
|
||||
for filename in runxlrd; do
|
||||
sed -e "s|${_mingw_prefix}/bin/|/usr/bin/env |g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${filename}.py
|
||||
mv "${pkgdir}${MINGW_PREFIX}"/bin/${filename}.py "${pkgdir}${MINGW_PREFIX}"/bin/${filename}-py3.py
|
||||
done
|
||||
}
|
||||
|
||||
package_python2-xlrd() {
|
||||
depends=("${MINGW_PACKAGE_PREFIX}-python2")
|
||||
|
||||
cd "${srcdir}/python2-build"
|
||||
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
||||
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}" -O1
|
||||
|
||||
install -Dm644 docs/licenses.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/licenses.rst"
|
||||
|
||||
local _mingw_prefix=$(cygpath -am ${MINGW_PREFIX})
|
||||
for filename in runxlrd; do
|
||||
sed -e "s|${_mingw_prefix}/bin/|/usr/bin/env |g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${filename}.py
|
||||
done
|
||||
}
|
||||
|
||||
package_mingw-w64-i686-python2-xlrd() {
|
||||
package_python2-xlrd
|
||||
}
|
||||
|
||||
package_mingw-w64-i686-python3-xlrd() {
|
||||
package_python3-xlrd
|
||||
}
|
||||
|
||||
package_mingw-w64-x86_64-python2-xlrd() {
|
||||
package_python2-xlrd
|
||||
}
|
||||
|
||||
package_mingw-w64-x86_64-python3-xlrd() {
|
||||
package_python3-xlrd
|
||||
}
|
||||
Reference in New Issue
Block a user