pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add workaround for PR#57445, similar to Firefox



Module Name:	pkgsrc-wip
Committed By:	David Brownlee <abs%absd.org@localhost>
Pushed By:	abs
Date:		Tue May 30 14:23:54 2023 +0100
Changeset:	45fe4f0517fb4f370a070d902e7401ef714d8303

Modified Files:
	szyszka/Makefile
	szyszka/PLIST
Added Files:
	szyszka/files/szyszka.sh

Log Message:
Add workaround for PR#57445, similar to Firefox

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=45fe4f0517fb4f370a070d902e7401ef714d8303

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 szyszka/Makefile         | 17 +++++++++++++++++
 szyszka/PLIST            |  1 +
 szyszka/files/szyszka.sh |  9 +++++++++
 3 files changed, 27 insertions(+)

diffs:
diff --git a/szyszka/Makefile b/szyszka/Makefile
index 1ddd3f299f..12e0b74420 100644
--- a/szyszka/Makefile
+++ b/szyszka/Makefile
@@ -17,6 +17,23 @@ RUSTFLAGS+=	-C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.gtk4}/lib
 RUSTFLAGS+=	-C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.MesaLib}/lib
 RUSTFLAGS+=	-C link-arg=-L${BUILDLINK_PREFIX.MesaLib}/lib
 
+INSTALLATION_DIRS=	bin libexec/szyszka
+
+.include "../../mk/bsd.prefs.mk"
+
+# This is a workaround for PR#57445. When resolved this do-install and wrapper
+# should # be removed and the binary just installed into PREFIX/bin
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/target/release/szyszka ${DESTDIR}${PREFIX}/libexec/szyszka
+.if ${OPSYS} == "NetBSD" && ${X11_TYPE} == "native"
+	${INSTALL_SCRIPT} ${FILESDIR}/szyszka.sh ${DESTDIR}${PREFIX}/bin/szyszka
+.else
+	${ECHO} '#!/bin/sh' > ${DESTDIR}${PREFIX}/bin/szyszka
+	${ECHO} '${PREFIX}/libexec/szyszka/szyszka "$$@"' >> \
+		${DESTDIR}${PREFIX}/bin/szyszka
+	${CHMOD} 755 ${DESTDIR}${PREFIX}/bin/szyszka
+.endif
+
 .include "../../lang/rust/cargo.mk"
 .include "../../x11/gtk4/buildlink3.mk"
 .include "../../devel/glib2/buildlink3.mk"
diff --git a/szyszka/PLIST b/szyszka/PLIST
index 60421365f2..03f23046e5 100644
--- a/szyszka/PLIST
+++ b/szyszka/PLIST
@@ -1,2 +1,3 @@
 @comment $NetBSD$
 bin/szyszka
+libexec/szyszka/szyszka
diff --git a/szyszka/files/szyszka.sh b/szyszka/files/szyszka.sh
new file mode 100755
index 0000000000..75edfe009b
--- /dev/null
+++ b/szyszka/files/szyszka.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+if [ -f /usr/X11R7/lib/libEGL.so ] && [ -z "$LD_PRELOAD" ]; then
+    # Temporary workaround for PR#57445
+    # 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 /usr/pkg/libexec/szyszka/szyszka "$@"


Home | Main Index | Thread Index | Old Index