Fri Aug 11 22:01:44 2023 UTC ()
retext: add a workaround for libEGL woes on NetBSD

Borrowed from www/firefox, with some tweaks.


(gutteridge)
diff -r1.16 -r1.17 pkgsrc/editors/retext/Makefile
diff -r0 -r1.1 pkgsrc/editors/retext/PLIST.NetBSD
diff -r0 -r1.1 pkgsrc/editors/retext/files/retext.sh

cvs diff -r1.16 -r1.17 pkgsrc/editors/retext/Makefile (expand / switch to unified diff)

--- pkgsrc/editors/retext/Makefile 2023/08/10 14:10:40 1.16
+++ pkgsrc/editors/retext/Makefile 2023/08/11 22:01:43 1.17
@@ -1,27 +1,38 @@ @@ -1,27 +1,38 @@
1# $NetBSD: Makefile,v 1.16 2023/08/10 14:10:40 gutteridge Exp $ 1# $NetBSD: Makefile,v 1.17 2023/08/11 22:01:43 gutteridge Exp $
2 2
3DISTNAME= ReText-8.0.1 3DISTNAME= ReText-8.0.1
4PKGNAME= ${DISTNAME:tl} 4PKGNAME= ${DISTNAME:tl}
 5PKGREVISION= 1
5CATEGORIES= editors python 6CATEGORIES= editors python
6MASTER_SITES= ${MASTER_SITE_PYPI:=R/ReText/} 7MASTER_SITES= ${MASTER_SITE_PYPI:=R/ReText/}
7 8
8MAINTAINER= gutteridge@NetBSD.org 9MAINTAINER= gutteridge@NetBSD.org
9HOMEPAGE= https://github.com/retext-project/retext 10HOMEPAGE= https://github.com/retext-project/retext
10COMMENT= Simple but powerful editor for Markdown and reStructuredText 11COMMENT= Simple but powerful editor for Markdown and reStructuredText
11LICENSE= gnu-gpl-v2 12LICENSE= gnu-gpl-v2
12 13
13DEPENDS+= ${PYPKGPREFIX}-chardet-[0-9]*:../../converters/py-chardet 14DEPENDS+= ${PYPKGPREFIX}-chardet-[0-9]*:../../converters/py-chardet
14DEPENDS+= ${PYPKGPREFIX}-enchant-[0-9]*:../../textproc/py-enchant 15DEPENDS+= ${PYPKGPREFIX}-enchant-[0-9]*:../../textproc/py-enchant
15DEPENDS+= ${PYPKGPREFIX}-markups-[0-9]*:../../textproc/py-markups 16DEPENDS+= ${PYPKGPREFIX}-markups-[0-9]*:../../textproc/py-markups
16DEPENDS+= ${PYPKGPREFIX}-qt6-[0-9]*:../../x11/py-qt6 17DEPENDS+= ${PYPKGPREFIX}-qt6-[0-9]*:../../x11/py-qt6
17DEPENDS+= ${PYPKGPREFIX}-sip-qt6-[0-9]*:../../x11/py-sip-qt6 18DEPENDS+= ${PYPKGPREFIX}-sip-qt6-[0-9]*:../../x11/py-sip-qt6
18 19
19USE_LANGUAGES= # none 20USE_LANGUAGES= # none
20 21
21PYTHON_VERSIONS_INCOMPATIBLE= 27 38 # py-markups 22PYTHON_VERSIONS_INCOMPATIBLE= 27 38 # py-markups
22 23
23USE_PKG_RESOURCES= yes 24USE_PKG_RESOURCES= yes
24 25
 26.include "../../mk/bsd.prefs.mk"
 27
 28# Workaround for PR#57445/50277 for netbsd-9 & netbsd-10 pre 2023-08-05
 29post-install:
 30.if ${OPSYS} == "NetBSD"
 31 ${MV} ${DESTDIR}${PREFIX}/bin/retext ${DESTDIR}${PREFIX}/bin/retext-py
 32 ${INSTALL_SCRIPT} ${FILESDIR}/retext.sh ${DESTDIR}${PREFIX}/bin/retext
 33 ${SED} -i -e 's|@PREFIX@|${PREFIX}|g' ${DESTDIR}${PREFIX}/bin/retext
 34.endif
 35
25.include "../../graphics/hicolor-icon-theme/buildlink3.mk" 36.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
26.include "../../lang/python/egg.mk" 37.include "../../lang/python/egg.mk"
27.include "../../mk/bsd.pkg.mk" 38.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/editors/retext/PLIST.NetBSD
@comment $NetBSD: PLIST.NetBSD,v 1.1 2023/08/11 22:01:43 gutteridge Exp $
bin/retext-py

File Added: pkgsrc/editors/retext/files/retext.sh
#!/bin/sh
if [ -f /usr/X11R7/lib/libEGL.so ] && [ -z "$LD_PRELOAD" ] && \
  nm /usr/X11R7/lib/libGL.so | grep -Fq "B _glapi_tls_Dispatch"; then
    # Workaround for PR#57445/50277 for netbsd-9 & netbsd-10 pre 2023-08-05
    # This may not avoid a crash 100% of the time, but changes at least some
    # cases of 100% crash on startup to "have not yet seen crash on startup"
    echo "Applying libEGL LD_PRELOAD workaround for NetBSD" >&2
    export LD_PRELOAD=/usr/X11R7/lib/libEGL.so
fi
exec @PREFIX@/bin/retext-py "$@"