diff --git a/pkgbuilds/python-meh/PKGBUILD b/pkgbuilds/python-meh/PKGBUILD index 7d565ed..311d121 100644 --- a/pkgbuilds/python-meh/PKGBUILD +++ b/pkgbuilds/python-meh/PKGBUILD @@ -5,7 +5,7 @@ # l'arborescence à la main plutôt que de patcher la chaîne distutils. pkgname=python-meh pkgver=0.43 -pkgrel=1 +pkgrel=2 pkgdesc="Python exception handling library (dépendance Anaconda)" arch=('any') url="https://github.com/rhinstaller/python-meh" @@ -16,6 +16,24 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/rhinstaller/python-meh/arch sha256sums=('cd50301794ab68a064715f1ace960f6de07aea809aa85f73087d44573c98be52') _srcdir="python-meh-$_tag" +prepare() { + cd "$srcdir/$_srcdir" + # gettext.ldgettext a été SUPPRIMÉ en Python 3.11 : sans ce remplacement, le + # gestionnaire d'exceptions d'Anaconda plante LUI-MÊME (AttributeError) dès + # qu'il doit AFFICHER une erreur → traceback brut au lieu du dialogue meh, + # en GUI comme en TUI. dgettext est l'équivalent direct (ldgettext n'était + # que la variante bytes). Corrigé en amont après 0.43. + sed -i 's/gettext\.ldgettext(/gettext.dgettext(/' \ + meh/handler.py meh/ui/text.py meh/ui/gui.py + # .pyc d'une extraction précédente (src/ n'est pas nettoyé par makepkg -f) : + # à jeter, sinon ils partiraient dans le paquet via cp -a. + find meh -type d -name __pycache__ -exec rm -rf {} + + if grep -rn --include='*.py' 'ldgettext' meh/; then + echo "ERREUR : ldgettext encore présent après patch" >&2 + return 1 + fi +} + package() { cd "$srcdir/$_srcdir" local sitedir