# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>
pkgname=python-wxpython
_pkgname=wxPython
pkgver=4.2.1
_pkgver="${pkgver%.*}"
_post="${pkgver##*.}"
pkgrel=2
epoch=1
pkgdesc='Cross-platform GUI toolkit'
arch=('x86_64' 'armv7h')
license=('custom:wxWindows')
url='https://www.wxpython.org'
depends=('wxwidgets-gtk3' 'python-six')
optdepends=('python-pypubsub: Alternative to the deprecated wx.lib.pubsub API')
makedepends=('mesa' 'glu' 'webkit2gtk' 'python-requests' 'python-setuptools' 'python-attrdict' 'sip' 'doxygen' 'waf')
#checkdepends=('xorg-server-xvfb' 'python-pytest-forked' 'python-numpy')
source=("https://files.pythonhosted.org/packages/source/w/wxPython/wxPython-$pkgver.tar.gz"
wscript-weird-fix.patch
)
sha512sums=('ee9ab8effb3c71de004c3d61ec583b9980c6b75fe9bb04cf2c76025ea70afc206bc3073c44d1c83c7ba604afed9fd38c01b9ef506617ba279a4ac58e3cf34438' SKIP)
prepare() {
cd $_pkgname-$pkgver
patch -Np1 -i ../wscript-weird-fix.patch
}
build() {
cd $_pkgname-$pkgver
# rm -r sip/{cpp,gen}/* # Recreate sip files with current wxWidgets - broken with doxygen 1.9.7 https://github.com/wxWidgets/Phoenix/issues/2414
SIP=/usr/bin/sip DOXYGEN=/usr/bin/doxygen WAF=/usr/bin/waf \
python build.py --nodoc sip build --use_syswx --release
}
#check() {
# cd $_pkgname-$pkgver
# there are segfaulting tests so --forked ensures we get sensible results
# PYTHONPATH=$PWD xvfb-run pytest --forked unittests || echo "==> WARNING: tests usually fail randomly"
#}
package() {
cd $_pkgname-$pkgver
python build.py install --destdir="$pkgdir"
install -Dm 644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
find "$pkgdir/usr/lib" -type f | xargs chmod 644
}