Gentoo Archives: gentoo-musl

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

Replies

Subject Author
Re: [gentoo-musl] [PATCH] app-misc/tmux: Fix build on musl. "Anthony G. Basile" <blueness@g.o>