Mon Nov 29 13:54:30 2021 UTC ()
Add a hack for NetBSD to make it start without crashing
(pho)
diff -r1.8 -r1.9 pkgsrc/audio/ncmpcpp/Makefile
diff -r0 -r1.1 pkgsrc/audio/ncmpcpp/hacks.mk
--- pkgsrc/audio/ncmpcpp/Makefile 2021/09/29 19:00:19 1.8
+++ pkgsrc/audio/ncmpcpp/Makefile 2021/11/29 13:54:29 1.9
| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | # $NetBSD: Makefile,v 1.8 2021/09/29 19:00:19 adam Exp $ | | 1 | # $NetBSD: Makefile,v 1.9 2021/11/29 13:54:29 pho Exp $ |
2 | | | 2 | |
3 | DISTNAME= ncmpcpp-0.9.2 | | 3 | DISTNAME= ncmpcpp-0.9.2 |
4 | PKGREVISION= 3 | | 4 | PKGREVISION= 4 |
5 | CATEGORIES= audio | | 5 | CATEGORIES= audio |
6 | MASTER_SITES= https://rybczak.net/ncmpcpp/stable/ | | 6 | MASTER_SITES= https://rybczak.net/ncmpcpp/stable/ |
7 | EXTRACT_SUFX= .tar.bz2 | | 7 | EXTRACT_SUFX= .tar.bz2 |
8 | | | 8 | |
9 | MAINTAINER= pkgsrc-users@NetBSD.org | | 9 | MAINTAINER= pkgsrc-users@NetBSD.org |
10 | HOMEPAGE= https://rybczak.net/ncmpcpp/ | | 10 | HOMEPAGE= https://rybczak.net/ncmpcpp/ |
11 | COMMENT= Featureful (n)curses based musicpd client inspired by ncmpc | | 11 | COMMENT= Featureful (n)curses based musicpd client inspired by ncmpc |
12 | LICENSE= gnu-gpl-v2 | | 12 | LICENSE= gnu-gpl-v2 |
13 | | | 13 | |
14 | # C++14 | | 14 | # C++14 |
15 | GCC_REQD+= 5 | | 15 | GCC_REQD+= 5 |
16 | | | 16 | |
17 | GNU_CONFIGURE= yes | | 17 | GNU_CONFIGURE= yes |
# $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