You are not logged in.

#1 2022-06-07 21:48:56

daniel_shub
Member
Registered: 2012-06-21
Posts: 69

Help creating a python-wxpython-git package

I have been having problems with the advanced splash part of the python-wxpython package that I think are fixed with this unreleased upstream commit. The python-wxpython-dev AUR package  does not contain the commit and the orphaned wxpython-phoenix-git AUR package is hopelessly out of date. The python-wxpython-dev PKGBUILD looked simple enough that I figured I would give making a new git package a shot. I changed the source location, added a pkgver function and added the git package as a make dependency. The first error I got was related to missing the attrdict module. I got around that by installing the python-attrdict AUR package  with a slight hack related to issues with the collections module:

sed -i 's/collections/collections.abc/g' attrdict/*.py

I then ran into an issue with sip modules. I added the python-sip4 package, but in a clean chroot I still get

==> Starting build()...
Traceback (most recent call last):
  File "/build/python-wxpython-git/src/Phoenix/build.py", line 49, in <module>
    from buildtools.wxpysip import sip_runner
  File "/build/python-wxpython-git/src/Phoenix/buildtools/wxpysip.py", line 20, in <module>
    from sipbuild.code_generator import (set_globals, parse, generateCode,
ModuleNotFoundError: No module named 'sipbuild'

which I think is misleading and is really about the parse module. This might be related to a recent bug in the Debian package but the wxpython folks might have a fix for it, but I cannot tell.

Any ideas how I can proceed?

# This is based on the python-wxpython-dev package (https://aur.archlinux.org/packages/python-wxpython-dev)

pkgname=python-wxpython-git
_pkgname=wxPython
pkgver=4.1.1
pkgrel=1
pkgdesc='Cross-platform GUI toolkit. Developer version'
arch=('x86_64')
license=('custom:wxWindows')
url='https://www.wxpython.org'
depends=('wxgtk3-dev' 'python-six' 'python-attrdict' 'python-sip4')
optdepends=('python-pypubsub: Alternative to the deprecated wx.lib.pubsub API')
makedepends=('mesa' 'glu' 'webkit2gtk' 'python-requests' 'python-setuptools' 'git')
checkdepends=('xorg-server-xvfb' 'python-pytest-forked' 'python-numpy')
provides=('python-wxpython')
conflicts=('python-wxpython')
source=("git+https://github.com/wxWidgets/Phoenix.git")
sha512sums=('SKIP')

pkgver() {
  cd "$srcdir/Phoenix"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/Phoenix"
  sed -i "s|WX_CONFIG = 'wx-config'|WX_CONFIG = 'wx-config-gtk3'|" build.py
}

build() {
  cd "$srcdir/Phoenix"

  python build.py build --release
}

check() {
  cd "$srcdir/Phoenix"

  # 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 "$srcdir/Phoenix"

  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
}

Offline

#2 2022-06-07 22:18:11

loqs
Member
Registered: 2014-03-06
Posts: 14,869

Re: Help creating a python-wxpython-git package

I think you are right in the cause but your PKGBUILD uses python-sip4 which is no longer supported since https://github.com/wxWidgets/Phoenix/co … f395a7c8a8 there is no sip5 in the repos and sip6 as you have found is broken since 6.6.1 https://github.com/wxWidgets/Phoenix/issues/2169 for which the fix is still being developed.

Offline

#3 2022-06-07 23:22:17

daniel_shub
Member
Registered: 2012-06-21
Posts: 69

Re: Help creating a python-wxpython-git package

The python-sip4 PKGBUILD doesn't look too bad. Do you think making a python-sip5 package is the way to go?

Offline

#4 2022-06-08 00:33:10

loqs
Member
Registered: 2014-03-06
Posts: 14,869

Re: Help creating a python-wxpython-git package

daniel_shub wrote:

The python-sip4 PKGBUILD doesn't look too bad. Do you think making a python-sip5 package is the way to go?

Until sip6 support is fixed it is probably the only way to get the package to build.  https://www.riverbankcomputing.com/pipe … 44698.html shows still issues with developing the sip6 fix.
Last version of the sip5 PKGBUILD https://github.com/archlinux/svntogit-p … k/PKGBUILD

Offline

#5 2022-06-08 15:41:21

daniel_shub
Member
Registered: 2012-06-21
Posts: 69

Re: Help creating a python-wxpython-git package

Thanks for the help. Hopefully the last question. I feel like I should add

provides=('sip' 'python-sip')
conflicts=('sip' 'sip4' 'python-sip4')

but the sip4 package does not have any such conflicts even though it has the same file names as the sip package.

Offline

#6 2022-06-09 10:11:35

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,140

Re: Help creating a python-wxpython-git package

sip4 has replaces=('sip<5') , python-sip4 has replaces=(python-sip) .
For packages from binary repos that works great, but it's not suitable for aur packages.

I don't know if there's a general rule for provides/conflicts , but for VCS packages best practice is :

provide / conflict with the repo package without a version in the name .

example
Aur has openscenegraph-git and openscenegraph-openmw-git
both provide/conflict openscenegraph but not eachother.
This ensures only one of the 3 versions around will be present.

I suggest you do the same and have sip5 provide/conflict sip while python-sip5 should provide/conflict python-sip  .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB