~alpine/aports

community/foot: fix terminfo override v2 REJECTED

Stacy Harper: 1
 community/foot: fix terminfo override

 2 files changed, 6 insertions(+), 3 deletions(-)
most popular/used terminfo (most used terminal emulators) are candidate for ncurses-terminfo-base. Other goes to ncurses-terminfo

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177191
Ok, now I've read up on this MR and its changes, but I do think this wouldn't be needed with 1.9.0.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177200
https://codeberg.org/dnkl/foot/commit/76391868650240b2314a66d182e4d07cf8491f54
https://codeberg.org/dnkl/foot/issues/671

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177201
Okay you right. But with 1.9.0 we also have to adapt the build to add the terminfo subpackage.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177208
@omni yes, it is 'fixed' upstream with 1.9.0

Only question is should we remove foot terminfo from ncurses?

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177209
I don't think we need to remove it from ncurses and I'm not sure about a foot terminfo subpackage, since the path is different would others make use of it?

Or, should foot terminfo be packaged with ncurses and if so also rxvt-unicode-terminfo?

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177231
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/3608/mbox | git am -3
Learn more about email & git

[PATCH v2] community/foot: fix terminfo override Export this patch

ncurses-terminfo now got foot terminfo files.

ERROR: foot-1.8.2-r3: trying to overwrite usr/share/terminfo/f/foot owned by ncurses-terminfo-6.2_p20210814-r1.
ERROR: foot-1.8.2-r3: trying to overwrite usr/share/terminfo/f/foot-direct owned by ncurses-terminfo-6.2_p20210814-r1.

As other terminals packages do, we strip those terminfo from foot itself
foot and rely on ncurses-terminfo-base

Signed-off-by: Stacy Harper <contact@stacyharper.net>
---
 community/foot/APKBUILD | 5 ++++-
 main/ncurses/APKBUILD   | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

This also add foot-direct in the ncurse package

diff --git a/community/foot/APKBUILD b/community/foot/APKBUILD
index 1d30b9c18c..03c4692ad6 100644
--- a/community/foot/APKBUILD
+++ b/community/foot/APKBUILD
@@ -1,11 +1,12 @@
# Maintainer: Alex McGrath <amk@amk.ie>
pkgname=foot
pkgver=1.8.2
pkgrel=1
pkgrel=2
pkgdesc="A fast, lightweight and minimalistic Wayland terminal emulator"
url="https://codeberg.org/dnkl/foot.git"
arch="all !ppc64le" # ppc64le build fails
license="MIT"
depends="ncurses-terminfo-base"
makedepends="
	meson
	scdoc
@@ -40,6 +41,8 @@ package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 foot.ini "$pkgdir"/usr/share/foot/foot.ini
	mv "$pkgdir"/usr/share/fish/vendor_completions.d "$pkgdir"/usr/share/fish/completions
	rm "$pkgdir"/usr/share/terminfo/f/foot
	rm "$pkgdir"/usr/share/terminfo/f/foot-direct
}

sha512sums="
diff --git a/main/ncurses/APKBUILD b/main/ncurses/APKBUILD
index 6285f9b70e..9f40aa52b8 100644
--- a/main/ncurses/APKBUILD
+++ b/main/ncurses/APKBUILD
@@ -2,7 +2,7 @@
pkgname=ncurses
pkgver=6.2_p20210814
_ver=${pkgver/_p/-}
pkgrel=0
pkgrel=1
pkgdesc="Console display library"
url="https://invisible-island.net/ncurses/"
arch="all"
@@ -50,7 +50,7 @@ package() {
			alacritty tmux tmux-256color terminator 'terminology*' \
			vte vte-256color gnome gnome-256color kitty konsole konsole-256color \
			konsole-linux putty putty-256color rxvt-256color 'st-*' \
			screen-256color; do
			screen-256color foot foot-direct; do
		local termfiles=$(find "$pkgdir"/usr/share/terminfo/ -name "$i" 2>/dev/null) || true

		[ -z "$termfiles" ] && continue
-- 
2.33.0
Hello there ! Is there someone that could give a feedback on this ? Apk is just broken with foot and ask a fix from two weeks now.

I'm not sure of the way I handled it and if terminfo are setted up correctly. I just reproduced the way other terminal handled it. 

Thanks a lot !

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177105
what is rationale for foot terminfo to go to ncurses-terminfo-base and not to ncurses-terminfo where they are already?

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177168
So you recommend to depend on ncurses-terminfo and not ncurses-terminfo-base ? So just drop the terminfo from foot and not adapt ncurses build ?

I dont have an opinion on this. I mimiced alacritty which does that. And I'm not sure why all terminfo are used this way on ncurses-terminfo-base.

Anyway, if it looks like not the good way, I'm very open other recommendation.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177174
The conflicting file ownership should've been fixed by !24226 but the latest release (!24740, not merged/packaged at the time of writing) has a new default location for terminfo files.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177196
While foot-1.9.0 _did_ change its default terminfo install location to a custom one (and exported  `TERMINFO` to point to it), it turned out to cause too many problems with applications not recognizing `TERMINFO`, sudo/doas/ssh dropping `TERMINFO` from the environment etc.

The new recommendation is to install foot's terminfo to the default location, **if** the distributions ncurses does not yet have foot. If it does, the recommendation is to use that instead.

Note that ncurses' version does not include a couple of non-standard capabilities (mostly used by tmux, for truecolor support). Meaning, if you **do** rely on ncurses' version, tmux needs to be configured for truecolor support in foot.

There is still support for installing foot's terminfo in a custom location (in which case foot still exports `TERMINFO`). This isn't really recommended due the application breakage mentioned above.

You can also install foot's terminfo under a different name (e.g `foot-extra`, or `foot-alpine` or whatever). But that too isn't really recommended since it breaks applications that check if `$TERM == "foot"`.

The defaults (the meson command line options) has changed post-1.9.0, and will be included in 1.9.1. You can still revert back to the old install location (without waitingn for 1.9.1, or backporting patches) by setting `-Dterminfo=disabled -Dcustom-terminfo-install-location=no`, and then manually build and install the terminfo. This is what the Arch AUR packages does (see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=foot and https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=foot-terminfo).

Note that this is for the **1.9.0** release. 1.9.1 **will** require minor changes yet again (mostly coming down to not setting `-Dcustom-terminfo-install-location` at all).

Of course, if you decide to use ncurses' version, then all you need to do is set `-Dterminfo=disabled` and simply not generate a `foot-terminfo` package at all.

* Issue detailing the problems with `TERMINFO`: https://codeberg.org/dnkl/foot/issues/695
* PR changing the meson command line defaults: https://codeberg.org/dnkl/foot/pulls/698 (there are minor changes to INSTALL.md made after this PR was merged).

Really sorry about all this. Foot being added to ncurses came out of the blue. I did not request it, nor was I notified about it. I was lucky and noticed the addition by pure luck (looking through the terminfo sources for something completely different).

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177559
Okay we'll try to figure out what the best option. Thanks for your detailed report on this ! I really feel like the ncurse approach is wrong and/or that the terminfo implementation lack some use cases.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177571
> I really feel like the ncurse approach is wrong and/or that the terminfo implementation lack some use cases.
The main issue with terminfo, imho, is that it is for ncurses primarily. Other applications may use it if they want, but capabilities usually aren't added to ncurses' terminfos unless ncurses uses them. It's just that no other alternatives have emerged.

Feel free to ping me if you have any questions, now or in the future.

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177577
This have to be closed in favor of : https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24845

Sorry, I'll dont use the lists.sr.ht proxy. Too annoying to manage my own patches...

-- 
via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24357#note_177611