app-misc/tmux: enable sixel support

This commit is contained in:
Florian Tham
2024-12-14 20:23:57 +01:00
parent 9ef66744ae
commit e9bb0d01bf
7 changed files with 194 additions and 0 deletions

7
app-misc/tmux/Manifest Normal file
View File

@@ -0,0 +1,7 @@
AUX tmux-2.4-flags.patch 456 BLAKE2B df85b32486894e8e3c5531937461ad46ca5effc5dd4d31b4f7a3f9bcf8d3dfa38fc186a603a90fe734b25781b9d517115c2b089648c29e4605fa9610f6dc311a SHA512 505d5ec4fa1d7844870c67aedccac3a147db1971464fc21d19319bb343fb6fd73b696e85298f8592e46900774b35b250cc53841b05514333c44c3e973bcdb860
AUX tmux-3.5-fix-xterm-sym.patch 1263 BLAKE2B ec47a799cd7301cb53eb24d3435a3772017af05b92c414874c3cb413cb913d18a3dabe773ca28474488ef1921011de2010df483e833fec52d411d2f88e9ae07b SHA512 50bea66e52fa86021e2d56c7bcb702d8361f34832dbcb20efda99de037d438ca6a3d114b5c19f8bcf1b8aaf66289871bb4cf7d4d44da6985c7c907fa322f4471
AUX tmux.service 124 BLAKE2B a4eecfeb4baa24433408c9dfb4848d420da4d54a2c62f6a4e05b0538e7b4c75bcec113d6ca86fea5085264903122e92e9adf7572e94ffafa3fe7f2038148b717 SHA512 73d3daf5362222da3e91641cc776c66fdaea50048000827a5eaa8693c769da73a320c19488aec6fd7660095eb6c44ef02f3473b2443909d55451442dfea70d28
AUX tmux.socket 132 BLAKE2B 9aa90b43f2eaedfce327287cc8eee4808c7870364668c54d0ffd4b5064d45a4c986702fdf64dde5fe24496635e700e1385a92a02060cb07819b48ab9d381b65b SHA512 fd2a8feb7474702515e9186a801fa5601feca5aedd39138d0f0623911b93255bc7cf4aa0ee066ba2c059601a21f2eb29794fe041d5a8cff91c63584e579aaff9
DIST tmux-3.4.tar.gz 707213 BLAKE2B 2b1990b95d7439702e9287402d9828d4ecab573202c099aa482969c047b540d4b899f79d87587fc712e727d9cebf5fa7393512087e469fc355b4a30b1894e229 SHA512 bd3880211d99d8ee15947000abf8a1832fdfa48b29b2df81b66d5969cf3f4e64e746f984f6139bfc57e3ebee7fe8dc7cbb6bccb779307607de6c376969fecbff
EBUILD tmux-3.4-r101.ebuild 2216 BLAKE2B 78e3d6cf46a6626940ca87188119c5852f0c3a28519be278dc076c424455fcd55df8e253f1727d9dbe71214a7d7684913c8933c3a978f9815d4123a33a5630fa SHA512 88f8e253a1a5bff023fa4529fc8d688319cd43857fdabc0b5fcb89174bb6c5526704b0c0cee45a50f923ba33f0e6993847344d77366068368ca87c3f734600f0
MISC metadata.xml 768 BLAKE2B c443cc60d807e1ffbfaa0499585f050566543a7337d4fa61569e03a6405077ebee7d81487530e75ccb3923aa5a1428e54c55b3cf7480a0aa786ad089c5e8a18b SHA512 cc26ffb4a98b8d207a3fc0aeaafe56b335bdf5d8b33b79a4b405e0c9220fe56d36b1d8a0203d611081c42ab81ecc476ded90ae98cc0fd4fe4bf6e47d312ee2ec

View File

@@ -0,0 +1,15 @@
Makefile.am | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- tmux-2.4/Makefile.am
+++ tmux-2.4/Makefile.am
@@ -17,9 +17,8 @@
# Set flags for gcc.
if IS_GCC
-AM_CFLAGS += -std=gnu99 -O2
+AM_CFLAGS += -std=gnu99
if IS_DEBUG
-AM_CFLAGS += -g
AM_CFLAGS += -Wno-long-long -Wall -W -Wformat=2
AM_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
AM_CFLAGS += -Wwrite-strings -Wshadow -Wpointer-arith -Wsign-compare

View File

@@ -0,0 +1,38 @@
https://github.com/tmux/tmux/commit/934035db7197d4510b330df8d8963f78e9c8756d
From: nicm <nicm>
Date: Mon, 14 Oct 2024 20:26:45 +0000
Subject: [PATCH] Set ACS flag for REP. Reported by Romain Francoise, GitHub
issue 4182.
--- a/input.c
+++ b/input.c
@@ -1145,7 +1145,6 @@ input_print(struct input_ctx *ictx)
ictx->cell.cell.attr |= GRID_ATTR_CHARSET;
else
ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET;
-
utf8_set(&ictx->cell.cell.data, ictx->ch);
screen_write_collect_add(sctx, &ictx->cell.cell);
@@ -1349,7 +1348,7 @@ input_csi_dispatch(struct input_ctx *ictx)
struct screen_write_ctx *sctx = &ictx->ctx;
struct screen *s = sctx->s;
struct input_table_entry *entry;
- int i, n, m, ek;
+ int i, n, m, ek, set;
u_int cx, bg = ictx->cell.cell.bg;
if (ictx->flags & INPUT_DISCARD)
@@ -1592,6 +1591,11 @@ input_csi_dispatch(struct input_ctx *ictx)
if (~ictx->flags & INPUT_LAST)
break;
+ set = ictx->cell.set == 0 ? ictx->cell.g0set : ictx->cell.g1set;
+ if (set == 1)
+ ictx->cell.cell.attr |= GRID_ATTR_CHARSET;
+ else
+ ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET;
utf8_copy(&ictx->cell.cell.data, &ictx->last);
for (i = 0; i < n; i++)
screen_write_collect_add(sctx, &ictx->cell.cell);

View File

@@ -0,0 +1,9 @@
[Unit]
Requires=tmux@%i.socket
[Service]
ExecStart=/usr/bin/tmux -D
[Install]
Also=tmux@%i.socket
DefaultInstance=default

View File

@@ -0,0 +1,8 @@
[Socket]
ListenStream=/tmp/tmux-%U/%i
DirectoryMode=0700
SocketMode=0660
[Install]
WantedBy=sockets.target
DefaultInstance=default

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>shell-tools@gentoo.org</email>
<name>Gentoo Shell Tools Project</name>
</maintainer>
<use>
<flag name="utempter">Include libutempter support</flag>
<flag name="sixel">Include SIXEL graphics support</flag>
</use>
<longdescription>
tmux is a "terminal multiplexer", it enables a number of terminals
(or windows) to be accessed and controlled from a single terminal.
tmux is intended to be a simple, modern, BSD-licensed alternative to
programs such as <pkg>app-misc/screen</pkg>.
</longdescription>
<upstream>
<remote-id type="github">tmux/tmux</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,96 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools flag-o-matic systemd
DESCRIPTION="Terminal multiplexer"
HOMEPAGE="https://tmux.github.io/"
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
SRC_URI="https://raw.githubusercontent.com/przepompownia/tmux-bash-completion/678a27616b70c649c6701cae9cd8c92b58cc051b/completions/tmux -> tmux-bash-completion-678a27616b70c649c6701cae9cd8c92b58cc051b"
EGIT_REPO_URI="https://github.com/tmux/tmux.git"
else
SRC_URI="https://github.com/tmux/tmux/releases/download/${PV}/${P/_/-}.tar.gz"
if [[ ${PV} != *_rc* ]] ; then
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
fi
S="${WORKDIR}/${P/_/-}"
fi
LICENSE="ISC"
SLOT="0"
IUSE="debug selinux systemd utempter vim-syntax +sixel"
DEPEND="
dev-libs/libevent:=
sys-libs/ncurses:=
systemd? ( sys-apps/systemd:= )
utempter? ( sys-libs/libutempter )
kernel_Darwin? ( dev-libs/libutf8proc:= )
"
BDEPEND="
virtual/pkgconfig
app-alternatives/yacc
"
RDEPEND="
${DEPEND}
selinux? ( sec-policy/selinux-screen )
vim-syntax? ( app-vim/vim-tmux )
"
QA_CONFIG_IMPL_DECL_SKIP=(
# BSD only functions
strtonum recallocarray
# missing on musl, tmux has fallback impl which it uses
b64_ntop
)
DOCS=( CHANGES README )
PATCHES=(
"${FILESDIR}"/${PN}-2.4-flags.patch
)
src_prepare() {
default
eautoreconf
}
src_configure() {
# bug 438558
# 1.7 segfaults when entering copy mode if compiled with -Os
replace-flags -Os -O2
local myeconfargs=(
--sysconfdir="${EPREFIX}"/etc
$(use_enable debug)
$(use_enable systemd)
$(use_enable utempter)
$(use_enable sixel)
# For now, we only expose this for macOS, because
# upstream strongly encourage it. I'm not sure it's
# needed on Linux right now.
$(use_enable kernel_Darwin utf8proc)
)
econf "${myeconfargs[@]}"
}
src_install() {
default
einstalldocs
dodoc example_tmux.conf
docompress -x /usr/share/doc/${PF}/example_tmux.conf
if use systemd; then
systemd_newuserunit "${FILESDIR}"/tmux.service tmux@.service
systemd_newuserunit "${FILESDIR}"/tmux.socket tmux@.socket
fi
}