pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/audio/ncmpcpp Add a hack for NetBSD to make it start w...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a66479a3d2b1
branches:  trunk
changeset: 770331:a66479a3d2b1
user:      pho <pho%pkgsrc.org@localhost>
date:      Mon Nov 29 13:54:29 2021 +0000

description:
Add a hack for NetBSD to make it start without crashing

diffstat:

 audio/ncmpcpp/Makefile |   4 ++--
 audio/ncmpcpp/hacks.mk |  37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r 2b5bc2815eec -r a66479a3d2b1 audio/ncmpcpp/Makefile
--- a/audio/ncmpcpp/Makefile    Mon Nov 29 12:38:44 2021 +0000
+++ b/audio/ncmpcpp/Makefile    Mon Nov 29 13:54:29 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2021/09/29 19:00:19 adam Exp $
+# $NetBSD: Makefile,v 1.9 2021/11/29 13:54:29 pho Exp $
 
 DISTNAME=      ncmpcpp-0.9.2
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    audio
 MASTER_SITES=  https://rybczak.net/ncmpcpp/stable/
 EXTRACT_SUFX=  .tar.bz2
diff -r 2b5bc2815eec -r a66479a3d2b1 audio/ncmpcpp/hacks.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/audio/ncmpcpp/hacks.mk    Mon Nov 29 13:54:29 2021 +0000
@@ -0,0 +1,37 @@
+# $NetBSD: hacks.mk,v 1.1 2021/11/29 13:54:29 pho Exp $
+
+### [Mon Nov 29 21:58:26 JST 2021 : pho]
+### ncmpcpp is an unusual program which wants to use readline and ncursesw at
+### the same time, and it crashes on startup without this hack. Things get
+### really complicated in this scenario:
+###
+### * devel/readline is linked against native libterminfo.so because it is the
+###   default termcap library (see mk/termcap.buildlink3.mk). Yes, termcap. It
+###   has both termcap and terminfo implementations in a single library!
+###
+### * /usr/lib/libtermcap.so is actually a symlink to /usr/lib/libterminfo.so.
+###
+### * devel/ncursesw has its own terminfo implementation and wants to use it.
+###
+### * Since ncmpcpp is linked with -lreadline, -ltermcap, and -lncursesw at the
+###   same time, the resulting executable ends up having DT_NEEDED for both
+###   libterminfo.so and libncursesw.so.
+###
+### * But these two libraries aren't ABI compatible. When libncursesw calls a
+###   function like, say, tigetnum(), it will actually call tigetnum() in native
+###   libterminfo and then segfaults.
+###
+### * I don't know if NetBSD ld.elf_so creates a separate namespace of symbols
+###   for each library DT_NEEDED'ed. I mean, I don't know what happens if the
+###   main executable of ncmpcpp didn't have a DT_NEEDED for libterminfo. Will
+###   libreadline use symbols in libterminfo and libncursesw use symbols in
+###   itself? A quick test indicates it's plausible. ncmpcpp at least doesn't
+###   crash when this hack is applied.
+###
+### * The situation is supposedly the same for devel/tig. It too uses readline
+###   and ncursesw at the same time. But for some reason it doesn't crash. I
+###   have absolutely no idea why it doesn't.
+.if ${OPSYS} == "NetBSD"
+PKG_HACKS+=            libtermcap-removal
+BUILDLINK_TRANSFORM+=  rm:-ltermcap
+.endif



Home | Main Index | Thread Index | Old Index