Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/mc/files/, app-misc/mc/
Date: Wed, 11 Sep 2019 21:44:25
Message-Id: 1568238253.4939d79d562b3490794aac9d3875d1fdf9a60e92.slyfox@gentoo
1 commit: 4939d79d562b3490794aac9d3875d1fdf9a60e92
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 11 21:41:15 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 11 21:44:13 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4939d79d
7
8 app-misc/mc: workaround linkage against internal gettext, bug #693850
9
10 The underlying issue is lack of support of linking in static
11 gettext into libmc.a due to a deficiency in m4/gettext.m4 (see
12 upstream bug for more details).
13
14 The workaround is to manually link bundled gettext into every
15 final binary. It fixes default case for musl but does not fix
16 the underlying issues. Let's leave fixing those to upstream.
17
18 Reported-by: Michael 'veremitz' Everitt
19 Bug: https://bugs.gentoo.org/693850
20 Bug: https://midnight-commander.org/ticket/3629
21 Package-Manager: Portage-2.3.75, Repoman-2.3.17
22 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
23
24 app-misc/mc/files/mc-4.8.23-gettext-test.patch | 54 +++++++++++++++++++++++++
25 app-misc/mc/files/mc-4.8.23-gettext.patch | 56 ++++++++++++++++++++++++++
26 app-misc/mc/mc-4.8.23-r1.ebuild | 2 +
27 3 files changed, 112 insertions(+)
28
29 diff --git a/app-misc/mc/files/mc-4.8.23-gettext-test.patch b/app-misc/mc/files/mc-4.8.23-gettext-test.patch
30 new file mode 100644
31 index 00000000000..7e19cd7fa11
32 --- /dev/null
33 +++ b/app-misc/mc/files/mc-4.8.23-gettext-test.patch
34 @@ -0,0 +1,54 @@
35 +https://bugs.gentoo.org/693850
36 +https://midnight-commander.org/raw-attachment/ticket/3629/mc-3629-Linking-fix-for-gettext.patch
37 +
38 +Test change counterpart.
39 +
40 +--- a/tests/lib/Makefile.am
41 ++++ b/tests/lib/Makefile.am
42 +@@ -9,3 +9,3 @@ AM_LDFLAGS = @TESTS_LDFLAGS@
43 + LIBS = @CHECK_LIBS@ \
44 +- $(top_builddir)/lib/libmc.la
45 ++ $(top_builddir)/lib/libmc.la $(LIBINTL)
46 +
47 +--- a/tests/lib/mcconfig/Makefile.am
48 ++++ b/tests/lib/mcconfig/Makefile.am
49 +@@ -11,3 +11,3 @@ AM_LDFLAGS = @TESTS_LDFLAGS@
50 + LIBS = @CHECK_LIBS@ \
51 +- $(top_builddir)/lib/libmc.la
52 ++ $(top_builddir)/lib/libmc.la $(LIBINTL)
53 +
54 +--- a/tests/lib/search/Makefile.am
55 ++++ b/tests/lib/search/Makefile.am
56 +@@ -10,3 +10,3 @@ AM_CPPFLAGS = \
57 + LIBS = @CHECK_LIBS@ \
58 +- $(top_builddir)/lib/libmc.la @PCRE_LIBS@
59 ++ $(top_builddir)/lib/libmc.la @PCRE_LIBS@ $(LIBINTL)
60 +
61 +--- a/tests/lib/vfs/Makefile.am
62 ++++ b/tests/lib/vfs/Makefile.am
63 +@@ -14,3 +14,3 @@ EXTRA_DIST = mc.charsets
64 + LIBS = @CHECK_LIBS@ \
65 +- $(top_builddir)/lib/libmc.la
66 ++ $(top_builddir)/lib/libmc.la $(LIBINTL)
67 +
68 +--- a/tests/lib/Makefile.in
69 ++++ b/tests/lib/Makefile.in
70 +@@ -636 +636 @@ LIBPTH_PREFIX = @LIBPTH_PREFIX@
71 +-LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1)
72 ++LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(LIBINTL) $(am__append_1)
73 +--- a/tests/lib/mcconfig/Makefile.in
74 ++++ b/tests/lib/mcconfig/Makefile.in
75 +@@ -542 +542 @@ LIBPTH_PREFIX = @LIBPTH_PREFIX@
76 +-LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1)
77 ++LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(LIBINTL) $(am__append_1)
78 +--- a/tests/lib/search/Makefile.in
79 ++++ b/tests/lib/search/Makefile.in
80 +@@ -584,2 +584 @@ LIBPTH_PREFIX = @LIBPTH_PREFIX@
81 +-LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la @PCRE_LIBS@ \
82 +- $(am__append_1)
83 ++LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la @PCRE_LIBS@ $(LIBINTL) $(am__append_1)
84 +--- a/tests/lib/vfs/Makefile.in
85 ++++ b/tests/lib/vfs/Makefile.in
86 +@@ -641 +641 @@ LIBPTH_PREFIX = @LIBPTH_PREFIX@
87 +-LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(am__append_1)
88 ++LIBS = @CHECK_LIBS@ $(top_builddir)/lib/libmc.la $(LIBINTL) $(am__append_1)
89
90 diff --git a/app-misc/mc/files/mc-4.8.23-gettext.patch b/app-misc/mc/files/mc-4.8.23-gettext.patch
91 new file mode 100644
92 index 00000000000..3ad67dbe5d4
93 --- /dev/null
94 +++ b/app-misc/mc/files/mc-4.8.23-gettext.patch
95 @@ -0,0 +1,56 @@
96 +https://bugs.gentoo.org/693850
97 +https://midnight-commander.org/raw-attachment/ticket/3629/mc-3629-Linking-fix-for-gettext.patch
98 +
99 +From 2a97524b42eeececd2ecd928a1154da1f5b7378a Mon Sep 17 00:00:00 2001
100 +From: Andreas Mohr <and@×××.li>
101 +Date: Fri, 1 Apr 2016 06:44:22 +0000
102 +Subject: [PATCH] Linking fix for non-default gettext package
103 +
104 +mc lost the linking game if gettext package pulled from outside of system paths.
105 +(Pulling can be done by suitable C-/CPP/LDFLAGS settings)
106 +
107 +Furthermore gettext package depends on libintl (if system lib
108 +don't provide needed functions) then gettext prepare INITLIBS/LIBINTL variable
109 +for working libintl pull in from gettext libdir.
110 +
111 +https://www.gnu.org/software/gettext/FAQ.html#integrating_undefined
112 +
113 +Let respect LIBINTL variable at linking (it is empty if not needed).
114 +
115 +Failure example for Solaris 10 with non-system-default gettext package:
116 +
117 +Undefined first referenced
118 + symbol in file
119 + libintl_bind_textdomain_codeset ./.libs/libinternal.a(args.o)
120 + libintl_gettext main.o
121 + libintl_textdomain main.o
122 + libintl_bindtextdomain main.o
123 + libintl_ngettext ./.libs/libinternal.a(midnight.o)
124 +
125 +Signed-off-by: Andreas Mohr <and@×××.li>
126 +---
127 + src/Makefile.am | 3 ++-
128 + 1 file changed, 2 insertions(+), 1 deletion(-)
129 +
130 +--- a/src/Makefile.am
131 ++++ b/src/Makefile.am
132 +@@ -53,7 +53,8 @@ libinternal_la_LIBADD = \
133 +
134 + mc_LDADD = \
135 + libinternal.la \
136 +- $(top_builddir)/lib/libmc.la
137 ++ $(top_builddir)/lib/libmc.la \
138 ++ $(LIBINTL)
139 +
140 + if ENABLE_VFS_SMB
141 + # this is a hack for linking with own samba library in simple way
142 +--- a/src/Makefile.in
143 ++++ b/src/Makefile.in
144 +@@ -556,7 +557,7 @@ libinternal_la_LIBADD = \
145 + viewer/libmcviewer.la \
146 + $(DIFFLIB) $(EDITLIB) $(SUBSHELLLIB)
147 +
148 +-mc_LDADD = libinternal.la $(top_builddir)/lib/libmc.la $(am__append_6)
149 ++mc_LDADD = libinternal.la $(top_builddir)/lib/libmc.la $(LIBINTL) $(am__append_6)
150 + SRC_mc_conssaver = \
151 + cons.handler.c consaver/cons.saver.h
152
153 diff --git a/app-misc/mc/mc-4.8.23-r1.ebuild b/app-misc/mc/mc-4.8.23-r1.ebuild
154 index 635d0001dcf..9bbeef2c62c 100644
155 --- a/app-misc/mc/mc-4.8.23-r1.ebuild
156 +++ b/app-misc/mc/mc-4.8.23-r1.ebuild
157 @@ -43,6 +43,8 @@ S=${WORKDIR}/${MY_P}
158 PATCHES=(
159 "${FILESDIR}"/${P}-3933-iso9660-1.patch
160 "${FILESDIR}"/${P}-3933-iso9660-2.patch
161 + "${FILESDIR}"/${PN}-4.8.23-gettext.patch
162 + "${FILESDIR}"/${PN}-4.8.23-gettext-test.patch
163 )
164
165 pkg_pretend() {