Gentoo Archives: gentoo-musl

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-musl@l.g.o
Subject: Re: [gentoo-musl] [PATCH] app-misc/tmux: Fix build on musl.
Date: Thu, 31 Mar 2016 09:56:43
Message-Id: 56FCF456.8040205@gentoo.org
In Reply to: [gentoo-musl] [PATCH] app-misc/tmux: Fix build on musl. by Masanori Ogino
1 On 3/30/16 10:32 PM, Masanori Ogino wrote:
2 > Signed-off-by: Masanori Ogino <masanori.ogino@×××××.com>
3 > ---
4 > app-misc/tmux/Manifest | 6 +++
5 > app-misc/tmux/files/tmux-2.0-flags.patch | 18 +++++++
6 > app-misc/tmux/files/tmux-2.1-cdefs.patch | 25 +++++++++
7 > app-misc/tmux/files/tmux.vim | 1 +
8 > app-misc/tmux/metadata.xml | 21 ++++++++
9 > app-misc/tmux/tmux-2.1-r99.ebuild | 91 ++++++++++++++++++++++++++++++++
10 > 6 files changed, 162 insertions(+)
11 > create mode 100644 app-misc/tmux/Manifest
12 > create mode 100644 app-misc/tmux/files/tmux-2.0-flags.patch
13 > create mode 100644 app-misc/tmux/files/tmux-2.1-cdefs.patch
14 > create mode 100644 app-misc/tmux/files/tmux.vim
15 > create mode 100644 app-misc/tmux/metadata.xml
16 > create mode 100644 app-misc/tmux/tmux-2.1-r99.ebuild
17 >
18 > diff --git a/app-misc/tmux/Manifest b/app-misc/tmux/Manifest
19 > new file mode 100644
20 > index 0000000..808313f
21 > --- /dev/null
22 > +++ b/app-misc/tmux/Manifest
23 > @@ -0,0 +1,6 @@
24 > +AUX tmux-2.0-flags.patch 584 SHA256 17dba9f233ca99e31d0619a47ca1cfd1f78bc429bfc9564e3fbc0174b39b61e7 SHA512 029a29182f5998c19883f24eab980d16f2e89c72f4150354e0a1101f9092491e836952fb9442e511508f47fd701c8cc8171f29c6ff097248894b6696d108f6dd WHIRLPOOL 026220084ff52382a168053b67bc5133b6d0d455059108ff85f58bb98eaab1656d1d76cd2c7814b9a7fde75e30cf79dfdf65c6c4429aa51852dfb9e6afef13e4
25 > +AUX tmux-2.1-cdefs.patch 562 SHA256 3f8f066899976ff4ec8cba7f7426e64546c9edfdc695a64bafda7f44cc5ebd9c SHA512 94654d2567d9fcdb2788da9da692a5c7e0557dd742a865b0d22ce5b337a8a150674efe6524b9f80da6dbe4dd9519d90df60a7b25689344aceff9268fe90fab4a WHIRLPOOL ce4d40db7bfd35ba10ac3c482adf1ddf142bbe07e21526c6f6e4cbf4e84e71cad1694a6e19e91ae283ece8be594a59d18298c8133753563618478fec9a56098e
26 > +AUX tmux.vim 55 SHA256 ab10a475aa32e2aacba7b47e9ca38057ee2e447a953497a0349f1640167be6b7 SHA512 5307bf7d27209ce143d7a57856440ba0462783f5b047b00ec5a5046f1b72110e62ef8bca47b67807cb9e9ffcede06c512f6136d825260f735cc32a63706c9e5e WHIRLPOOL fa0019bcfcbe46aa9d383f8778ea4b7d8ec94f7b58f9c38b07c9b6649ea17363f2436e684d83c0c262711e30b62f90fe7f65d87e3a2c9dc5b391633f75a5d7ca
27 > +DIST tmux-2.1.tar.gz 462965 SHA256 31564e7bf4bcef2defb3cb34b9e596bd43a3937cad9e5438701a81a5a9af6176 SHA512 0faa0a60a84b777ca3cf572cf741d0e4f82a9f32d27dfeddfda41bad57830823a6d5f2323f27ba794b86e194d9f7db7028c94dc6a15bb4ac5a18508f890bdaa4 WHIRLPOOL 983024886bdb868bb69ccedc18e9fd62cc5a8f147d647ea43b6f20e297b9b3c45a061e542bcb590ab50cf5d3db43d22015c3a8f18bee33d9c76552bfe13424ed
28 > +EBUILD tmux-2.1-r99.ebuild 2349 SHA256 bde8849ede880ac0ba642e9185d60cdd92add9851d4efb49fad45f9cae5a0243 SHA512 78141bef98733e171f1df3d6c2af056eca5d2ed078d0fe509c77feb09185ba6502fa5f4ac883119751a9f1b6960c5d5afa90d2bd32f7bcbc90c6dda50016ff6c WHIRLPOOL 52ed81a4410bc350600c305f71b1b2fd58138632ad4b792e00515263b5246f013b2a87a42cd26b99fb49f11e7dbcbc31354c2808bc1647554dfe298928570e36
29 > +MISC metadata.xml 758 SHA256 d8b1acdbe0283795479436be5437f76037fb54e0c6f32ec6cbe4142964bc1889 SHA512 560576353d246b8b63fb5287e3ead7054e8f7307c0d78e02dee378537a6ffb03edc3b444f1c54809a4807cb4ce1f22e7967ae5825692d3804b89cd1b4655e2c7 WHIRLPOOL 048f7302af5a1ed297d4664880e973304627e12565ceffd394a2564b7cf6efba94d0f6ac14d032262970d4b30b09db4ea83a7294f4ce7cdca5512510939f0d36
30 > diff --git a/app-misc/tmux/files/tmux-2.0-flags.patch b/app-misc/tmux/files/tmux-2.0-flags.patch
31 > new file mode 100644
32 > index 0000000..d2c40e0
33 > --- /dev/null
34 > +++ b/app-misc/tmux/files/tmux-2.0-flags.patch
35 > @@ -0,0 +1,18 @@
36 > + Makefile.am | 3 +--
37 > + 1 file changed, 1 insertion(+), 2 deletions(-)
38 > +
39 > +diff --git a/Makefile.am b/Makefile.am
40 > +index 63e20b1..a2fec1e 100644
41 > +--- a/Makefile.am
42 > ++++ b/Makefile.am
43 > +@@ -25,9 +25,8 @@ endif
44 > + # Set flags for gcc. gcc4 whines abouts silly stuff so it needs slightly
45 > + # different flags.
46 > + if IS_GCC
47 > +-CFLAGS += -std=gnu99 -O2
48 > ++CFLAGS += -std=gnu99
49 > + if IS_DEBUG
50 > +-CFLAGS += -g
51 > + CFLAGS += -Wno-long-long -Wall -W -Wnested-externs -Wformat=2
52 > + CFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
53 > + CFLAGS += -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare
54 > diff --git a/app-misc/tmux/files/tmux-2.1-cdefs.patch b/app-misc/tmux/files/tmux-2.1-cdefs.patch
55 > new file mode 100644
56 > index 0000000..f26a761
57 > --- /dev/null
58 > +++ b/app-misc/tmux/files/tmux-2.1-cdefs.patch
59 > @@ -0,0 +1,25 @@
60 > +Remove the dependency on sys/cdefs.h.
61 > +
62 > +Note that upstream has already done similar changes so it would be unnecessary
63 > +with newer versions.
64 > +
65 > +diff -ru tmux-2.1.orig/compat/vis.h tmux-2.1/compat/vis.h
66 > +--- tmux-2.1.orig/compat/vis.h 2016-03-31 11:16:36.113228256 +0900
67 > ++++ tmux-2.1/compat/vis.h 2016-03-31 11:17:04.263228615 +0900
68 > +@@ -73,9 +73,6 @@
69 > + */
70 > + #define UNVIS_END 1 /* no more characters */
71 > +
72 > +-#include <sys/cdefs.h>
73 > +-
74 > +-__BEGIN_DECLS
75 > + char *vis(char *, int, int, int);
76 > + int strvis(char *, const char *, int);
77 > + int stravis(char **, const char *, int);
78 > +@@ -85,6 +82,4 @@
79 > + int unvis(char *, char, int *, int);
80 > + ssize_t strnunvis(char *, const char *, size_t);
81 > +
82 > +-__END_DECLS
83 > +-
84 > + #endif /* !_VIS_H_ */
85 > diff --git a/app-misc/tmux/files/tmux.vim b/app-misc/tmux/files/tmux.vim
86 > new file mode 100644
87 > index 0000000..baac50a
88 > --- /dev/null
89 > +++ b/app-misc/tmux/files/tmux.vim
90 > @@ -0,0 +1 @@
91 > +au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
92 > diff --git a/app-misc/tmux/metadata.xml b/app-misc/tmux/metadata.xml
93 > new file mode 100644
94 > index 0000000..c2ae9d3
95 > --- /dev/null
96 > +++ b/app-misc/tmux/metadata.xml
97 > @@ -0,0 +1,21 @@
98 > +<?xml version="1.0" encoding="UTF-8"?>
99 > +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
100 > +<pkgmetadata>
101 > + <maintainer type="person">
102 > + <email>wired@g.o</email>
103 > + <name>Alex Alexander</name>
104 > + </maintainer>
105 > + <maintainer type="project">
106 > + <email>shell-tools@g.o</email>
107 > + <name>Gentoo Shell Tools Project</name>
108 > + </maintainer>
109 > + <longdescription>
110 > + tmux is a "terminal multiplexer", it enables a number of terminals
111 > + (or windows) to be accessed and controlled from a single terminal.
112 > + tmux is intended to be a simple, modern, BSD-licensed alternative to
113 > + programs such as <pkg>app-misc/screen</pkg>.
114 > + </longdescription>
115 > + <upstream>
116 > + <remote-id type="github">tmux/tmux</remote-id>
117 > + </upstream>
118 > +</pkgmetadata>
119 > diff --git a/app-misc/tmux/tmux-2.1-r99.ebuild b/app-misc/tmux/tmux-2.1-r99.ebuild
120 > new file mode 100644
121 > index 0000000..533b36f
122 > --- /dev/null
123 > +++ b/app-misc/tmux/tmux-2.1-r99.ebuild
124 > @@ -0,0 +1,91 @@
125 > +# Copyright 1999-2016 Gentoo Foundation
126 > +# Distributed under the terms of the GNU General Public License v2
127 > +# $Id$
128 > +
129 > +EAPI=5
130 > +
131 > +AUTOTOOLS_AUTORECONF=true
132 > +
133 > +inherit autotools-utils bash-completion-r1 flag-o-matic versionator
134 > +
135 > +DESCRIPTION="Terminal multiplexer"
136 > +HOMEPAGE="http://tmux.github.io/"
137 > +SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz"
138 > +
139 > +LICENSE="ISC"
140 > +SLOT="0"
141 > +KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
142 > +IUSE="debug selinux vim-syntax kernel_FreeBSD kernel_linux"
143 > +
144 > +CDEPEND="
145 > + || (
146 > + =dev-libs/libevent-2.0*
147 > + >=dev-libs/libevent-2.1.5-r4
148 > + )
149 > + kernel_linux? ( sys-libs/libutempter )
150 > + kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-lib-9.0 sys-libs/libutempter ) )
151 > + sys-libs/ncurses:0="
152 > +DEPEND="${CDEPEND}
153 > + virtual/pkgconfig"
154 > +RDEPEND="${CDEPEND}
155 > + selinux? ( sec-policy/selinux-screen )
156 > + vim-syntax? (
157 > + || (
158 > + app-editors/vim
159 > + app-editors/gvim
160 > + )
161 > + )"
162 > +
163 > +DOCS=( CHANGES FAQ README TODO )
164 > +
165 > +PATCHES=( "${FILESDIR}"/${PN}-2.0-flags.patch "${FILESDIR}"/${PN}-2.1-cdefs.patch )
166 > +
167 > +src_prepare() {
168 > + # bug 438558
169 > + # 1.7 segfaults when entering copy mode if compiled with -Os
170 > + replace-flags -Os -O2
171 > +
172 > + # regenerate aclocal.m4 to support earlier automake versions
173 > + rm aclocal.m4 || die
174 > +
175 > + autotools-utils_src_prepare
176 > +}
177 > +
178 > +src_configure() {
179 > + local myeconfargs=(
180 > + --sysconfdir="${EPREFIX}"/etc
181 > + $(use_enable debug)
182 > + )
183 > + autotools-utils_src_configure
184 > +}
185 > +
186 > +src_install() {
187 > + autotools-utils_src_install
188 > +
189 > + newbashcomp examples/bash_completion_tmux.sh ${PN}
190 > +
191 > + docinto examples
192 > + dodoc examples/*.conf
193 > +
194 > + if use vim-syntax; then
195 > + insinto /usr/share/vim/vimfiles/syntax
196 > + doins examples/tmux.vim
197 > +
198 > + insinto /usr/share/vim/vimfiles/ftdetect
199 > + doins "${FILESDIR}"/tmux.vim
200 > + fi
201 > +}
202 > +
203 > +pkg_postinst() {
204 > + if ! version_is_at_least 1.9a ${REPLACING_VERSIONS:-1.9a}; then
205 > + echo
206 > + ewarn "Some configuration options changed in this release."
207 > + ewarn "Please read the CHANGES file in /usr/share/doc/${PF}/"
208 > + ewarn
209 > + ewarn "WARNING: After updating to ${P} you will _not_ be able to connect to any"
210 > + ewarn "older, running tmux server instances. You'll have to use an existing client to"
211 > + ewarn "end your old sessions or kill the old server instances. Otherwise you'll have"
212 > + ewarn "to temporarily downgrade to access them."
213 > + echo
214 > + fi
215 > +}
216 >
217
218
219 Thanks I committed this. I knew about this issue but -9999 had the fix
220 in it and was too lazy to backport it :) Also, I dropped the keywords
221 to just KEYWORDS="amd64 arm ~mips ppc x86" since those are the only ones
222 we're supporting on musl right now.
223
224 --
225 Anthony G. Basile, Ph.D.
226 Gentoo Linux Developer [Hardened]
227 E-Mail : blueness@g.o
228 GnuPG FP : 1FED FAD9 D82C 52A5 3BAB DC79 9384 FA6E F52D 4BBA
229 GnuPG ID : F52D4BBA

Replies

Subject Author
Re: [gentoo-musl] [PATCH] app-misc/tmux: Fix build on musl. Masanori Ogino <masanori.ogino@×××××.com>