90 lines
2.9 KiB
Bash
90 lines
2.9 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
#This value is here because some python package names have capital letters
|
|
#while there is a strong preference for lowercase letters in ArchLinux and
|
|
#MSYS packages.
|
|
|
|
_pyname=pyxdg
|
|
_realname=xdg #This should be lowercase
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=0.26
|
|
pkgrel=2
|
|
pkgdesc="Python library to access freedesktop.org standards (mingw-w64)"
|
|
arch=('any')
|
|
url='http://freedesktop.org/Software/pyxdg'
|
|
license=('LGPL')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
|
|
"${MINGW_PACKAGE_PREFIX}-python3"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_pyname}-${pkgver}.tar.gz"::"https://github.com/takluyver/pyxdg/archive/rel-${pkgver}.tar.gz")
|
|
sha256sums=('2bd7f0b30bdeeaa15ed7d5651b3e266b2f40a37d3170dc37646e27deb7966dce')
|
|
|
|
prepare() {
|
|
for builddir in python{2,3}-build-${CARCH}; do
|
|
rm -rf $builddir | true
|
|
cp -r "${_pyname}-rel-${pkgver}" "${builddir}"
|
|
done
|
|
}
|
|
|
|
# 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() {
|
|
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 build
|
|
done
|
|
}
|
|
|
|
check() {
|
|
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 check
|
|
done
|
|
}
|
|
|
|
package_python3-xdg() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python3")
|
|
|
|
cd "${srcdir}/python3-build-${CARCH}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
|
|
--root="${pkgdir}" --optimize=1 --skip-build
|
|
|
|
install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
|
|
}
|
|
|
|
package_python2-xdg() {
|
|
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
|
|
|
|
install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING"
|
|
}
|
|
|
|
package_mingw-w64-i686-python2-xdg() {
|
|
package_python2-xdg
|
|
}
|
|
|
|
package_mingw-w64-i686-python3-xdg() {
|
|
package_python3-xdg
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python2-xdg() {
|
|
package_python2-xdg
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python3-xdg() {
|
|
package_python3-xdg
|
|
}
|