Skip to content

Commit

Permalink
add python-zeroconf (msys2#4941)
Browse files Browse the repository at this point in the history
* add python-zeroconf

* address review issues and more:
* use correct prefixed package name
* use correct MINGW_PREFIX for install
* add INSTALL and README files in share/licenses and share/doc respectively
* add commented-out test code for python2 (requires fix to python2-mock package to run)
* use named archive when downloading source
  • Loading branch information
totaam authored and Alexpux committed Feb 6, 2019
1 parent 8ceaeb6 commit ef7a718
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 91 deletions.
91 changes: 0 additions & 91 deletions mingw-w64-python-zeroconf/PKGBUILD

This file was deleted.

50 changes: 50 additions & 0 deletions mingw-w64-python2-zeroconf/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Maintainer: Antoine Martin <[email protected]>
# Contributor: ZaZam <zazaamm æt gmail døt com>
# Contributor: Yegorius <[email protected]>

pkgname="${MINGW_PACKAGE_PREFIX}-python2-zeroconf"
_srcname=python-zeroconf
pkgver=0.19.1
pkgrel=1
pkgdesc="A pure python implementation of multicast DNS service discovery"
arch=('any')
url="https://github.com/jstasiak/python-zeroconf"
license=('LGPL')
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-netifaces"
"${MINGW_PACKAGE_PREFIX}-python2-six"
"${MINGW_PACKAGE_PREFIX}-python2-enum34")
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools")
#checks are skipped at the moment:
#checkdepends=("${MINGW_PACKAGE_PREFIX}-python2-mock")
source=("${_srcname}-${pkgver}.tar.gz"::"https://github.com/jstasiak/${_srcname}/archive/${pkgver}.tar.gz")
sha256sums=('ca8952a3eb04818dcb566e1344f2f15b5dd6d487770384651cdfae777d5eb848')

prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"

# No need for enum-compat if depend on enum34
sed -i "s/'enum-compat',//" setup.py
}

build() {
cd "${srcdir}/${_srcname}-${pkgver}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py build
}

package() {
cd "${srcdir}/${_srcname}-${pkgver}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
--root="$pkgdir" --optimize=1
install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-zeroconf/COPYING"
install -Dm644 README.rst "${pkgdir}${MINGW_PREFIX}/share/doc/python2-zeroconf/README"
}

check() {
echo "test skipped because python-mock currently fails to import"
echo "see 'python2 -c \"from mock import patch\"'"
#cd "${srcdir}/${_srcname}-${pkgver}"
#py.test .
}
41 changes: 41 additions & 0 deletions mingw-w64-python3-zeroconf/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Maintainer: Antoine Martin <[email protected]>
# Contributor: Jelle van der Waa <[email protected]>
# Contributor: Maxim Andersson <[email protected]>

pkgname="${MINGW_PACKAGE_PREFIX}-python3-zeroconf"
_srcname=python-zeroconf
pkgver=0.21.3
pkgrel=1
pkgdesc="A pure python implementation of multicast DNS service discovery"
arch=('any')
url="https://github.com/jstasiak/python-zeroconf"
license=('LGPL')
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-netifaces"
"${MINGW_PACKAGE_PREFIX}-python3-six"
"${MINGW_PACKAGE_PREFIX}-python3-ifaddr")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest")
source=("${_srcname}-${pkgver}.tar.gz"::"https://github.com/jstasiak/${_srcname}/archive/${pkgver}.tar.gz")
sha256sums=('8c3aaed98f950b56c6e1aa440b56e0d48af49565cb4d7830a82cb3b01088aad8')

build() {
cd "${srcdir}/${_srcname}-${pkgver}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py build
}

package() {
cd "${srcdir}/${_srcname}-${pkgver}"

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-zeroconf/COPYING"
install -Dm644 README.rst "${pkgdir}${MINGW_PREFIX}/share/doc/python3-zeroconf/README"
}

check() {
cd "${srcdir}/${_srcname}-${pkgver}"
py.test .
}

0 comments on commit ef7a718

Please sign in to comment.