4c2b37a6aab47cdf2400f3f3b454ae655e16b82a
[gentoo.git] / app-misc / tmux / tmux-3.0a.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools flag-o-matic
7
8 DESCRIPTION="Terminal multiplexer"
9 HOMEPAGE="https://tmux.github.io/"
10 if [[ "${PV}" == 9999 ]] ; then
11         inherit git-r3
12         SRC_URI="https://raw.githubusercontent.com/przepompownia/tmux-bash-completion/678a27616b70c649c6701cae9cd8c92b58cc051b/completions/tmux -> tmux-bash-completion-678a27616b70c649c6701cae9cd8c92b58cc051b"
13         EGIT_REPO_URI="https://github.com/tmux/tmux.git"
14 else
15         SRC_URI="https://github.com/tmux/tmux/releases/download/${PV}/${P/_/-}.tar.gz"
16         [[ "${PV}" == *_rc* ]] || \
17         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
18         S="${WORKDIR}/${P/_/-}"
19 fi
20
21 LICENSE="ISC"
22 SLOT="0"
23 IUSE="debug selinux utempter vim-syntax kernel_FreeBSD kernel_linux"
24
25 DEPEND="
26         dev-libs/libevent:0=
27         sys-libs/ncurses:0=
28         utempter? (
29                 kernel_linux? ( sys-libs/libutempter )
30                 kernel_FreeBSD? ( || ( >=sys-freebsd/freebsd-lib-9.0 sys-libs/libutempter ) )
31         )"
32
33 BDEPEND="
34         virtual/pkgconfig
35         virtual/yacc
36 "
37
38 RDEPEND="
39         ${DEPEND}
40         selinux? ( sec-policy/selinux-screen )
41         vim-syntax? ( app-vim/vim-tmux )"
42
43 DOCS=( CHANGES README )
44
45 PATCHES=(
46         "${FILESDIR}/${PN}-2.4-flags.patch"
47
48         # upstream fixes (can be removed with next version bump)
49 )
50
51 src_prepare() {
52         # bug 438558
53         # 1.7 segfaults when entering copy mode if compiled with -Os
54         replace-flags -Os -O2
55
56         default
57         eautoreconf
58 }
59
60 src_configure() {
61         local myeconfargs=(
62                 --sysconfdir="${EPREFIX}"/etc
63                 $(use_enable debug)
64                 $(use_enable utempter)
65         )
66         econf "${myeconfargs[@]}"
67 }
68
69 src_install() {
70         default
71
72         einstalldocs
73
74         dodoc example_tmux.conf
75         docompress -x /usr/share/doc/${PF}/example_tmux.conf
76 }
77
78 pkg_postinst() {
79         if ! ver_test 1.9a -ge ${REPLACING_VERSIONS:-1.9a}; then
80                 echo
81                 ewarn "Some configuration options changed in this release."
82                 ewarn "Please read the CHANGES file in /usr/share/doc/${PF}/"
83                 ewarn
84                 ewarn "WARNING: After updating to ${P} you will _not_ be able to connect to any"
85                 ewarn "older, running tmux server instances. You'll have to use an existing client to"
86                 ewarn "end your old sessions or kill the old server instances. Otherwise you'll have"
87                 ewarn "to temporarily downgrade to access them."
88                 echo
89         fi
90 }