Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Compile terminfo description when building
@ 2022-07-21 22:04 meator
  2022-07-21 22:11 ` [PR PATCH] [Updated] " meator
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: meator @ 2022-07-21 22:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2180 bytes --]

There is a new pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 12255 bytes --]

From e223d6ef8b40e5f64ad690d4ecfda60685e09e69 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/6] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..d318599651ef 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -xe alacritty,alacritty-direct ../extra/alacritty.info -o ${DESTDIR}/usr/share/terminfo
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From d4e4d75e422b21d4b95526504ab3a8dae824fa8f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/6] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..41552a1472f5 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
+build_style=gnu-makefile
+make_use_env=yes
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 3dfd93d7dec83cdb4169b2e3fffe2cac2944b6ce Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/6] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..a300e6f77a91 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx mtm.ti -o ${DESTDIR}/usr/share/terminfo
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From ae69ff614aa5c30fa08b673f7483ca1d60cebaf3 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/6] rxvt-unicode: do not include .terminfo in the package

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 50d85cb5a12b9cfc0232705c2c35bb6e48772117 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/6] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From e014ed5253ddab8423b0c92b47722c4ce29881e1 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/6] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
@ 2022-07-21 22:11 ` meator
  2022-07-22  5:27 ` meator
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-21 22:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 12245 bytes --]

From e223d6ef8b40e5f64ad690d4ecfda60685e09e69 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/6] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..d318599651ef 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -xe alacritty,alacritty-direct ../extra/alacritty.info -o ${DESTDIR}/usr/share/terminfo
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 786688b9a75ec129f31d496cfdbdc5416665fa6a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/6] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 0417ead463ee861ed2baa8afa307c6ef1240e8f4 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/6] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..a300e6f77a91 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx mtm.ti -o ${DESTDIR}/usr/share/terminfo
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 9fe55c7dde8f7d51072fc2edf493ea1ba055b468 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/6] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 1f494b122004b93c82b70fe26a5e132448ad6d26 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/6] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 9bbb88c8f221da8dc7d7d5ca63baf58246bcba8f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/6] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
  2022-07-21 22:11 ` [PR PATCH] [Updated] " meator
@ 2022-07-22  5:27 ` meator
  2022-07-22  5:47 ` meator
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22  5:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 12245 bytes --]

From 5d96790d0eec23d3e83ee7588a932eeabbc6a9e8 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/6] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a5c9b929b4ad2ce981aa6eb9455ce3a9a4e0611a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/6] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 6c5cfe3d4de17f20eb487043f114ffa1712c1f74 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/6] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6878a2c0e6a326b8d9b1d38cd47fdb825c55fd02 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/6] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 57ff42e9ca59845292f7819d1293df24db5a0585 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/6] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6af489f4a5603cb89ed885234388ca5053d30f37 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/6] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
  2022-07-21 22:11 ` [PR PATCH] [Updated] " meator
  2022-07-22  5:27 ` meator
@ 2022-07-22  5:47 ` meator
  2022-07-22  5:51 ` classabbyamp
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22  5:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192206980

Comment:
One way to solve the conflicts would be to `rm` conflicting files from `ncurses-term` and add the relevant `-terminfo` packages as dependencies of `ncurses-term`. What do you think?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (2 preceding siblings ...)
  2022-07-22  5:47 ` meator
@ 2022-07-22  5:51 ` classabbyamp
  2022-07-22  7:25 ` meator
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-07-22  5:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192209148

Comment:
I think that has been done previously for foot https://github.com/void-linux/void-packages/pull/36884#issuecomment-1131836929

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (3 preceding siblings ...)
  2022-07-22  5:51 ` classabbyamp
@ 2022-07-22  7:25 ` meator
  2022-07-22 13:53 ` paper42
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22  7:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192269040

Comment:
> I think that has been done previously for foot [#36884 (comment)](https://github.com/void-linux/void-packages/pull/36884#issuecomment-1131836929)

This is interesting. But now `ncurses-terminfo` doesn't contain terminfo descriptions for `foot`. I think adding `foot-terminfo` as a dependency of `ncurses-term` would be better. When I install `ncurses-term`, I expect to get all terminfo files, not only ones that do not have its own package.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (4 preceding siblings ...)
  2022-07-22  7:25 ` meator
@ 2022-07-22 13:53 ` paper42
  2022-07-22 13:54 ` paper42
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: paper42 @ 2022-07-22 13:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192600341

Comment:
> > I think that has been done previously for foot [#36884 (comment)](https://github.com/void-linux/void-packages/pull/36884#issuecomment-1131836929)
> 
> This is interesting. But now `ncurses-terminfo` doesn't contain terminfo descriptions for `foot`. I think adding `foot-terminfo` as a dependency of `ncurses-term` would be better. When I install `ncurses-term`, I expect to get all terminfo files, not only ones that do not have its own package.

We can't do that. ncurses is a very core package and shouldn't have any dependencies. Currently it doesn't, so building it is quick even with `-N`. What you are proposing would make the build take hours and most likely introduce a lot of build cycles, for example `ncurses (ncurses-term) -> foot (foot-terminfo) -> ncurses (ncurses-devel)`

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (5 preceding siblings ...)
  2022-07-22 13:53 ` paper42
@ 2022-07-22 13:54 ` paper42
  2022-07-22 17:39 ` [PR PATCH] [Updated] " meator
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: paper42 @ 2022-07-22 13:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192600341

Comment:
> > I think that has been done previously for foot [#36884 (comment)](https://github.com/void-linux/void-packages/pull/36884#issuecomment-1131836929)
> 
> This is interesting. But now `ncurses-terminfo` doesn't contain terminfo descriptions for `foot`. I think adding `foot-terminfo` as a dependency of `ncurses-term` would be better. When I install `ncurses-term`, I expect to get all terminfo files, not only ones that do not have its own package.

We can't do that. ncurses is a very core package and shouldn't have any dependencies. Currently it doesn't, so building it is quick even with `-N`. What you are proposing would make the build take hours and most likely introduce a lot of build cycles, for example `ncurses (ncurses-term) -> foot (foot-terminfo) -> ncurses (ncurses-devel)`

EDIT: even worse, ncurses is a bootstrap package

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (6 preceding siblings ...)
  2022-07-22 13:54 ` paper42
@ 2022-07-22 17:39 ` meator
  2022-07-22 17:41 ` meator
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 20897 bytes --]

From 5d96790d0eec23d3e83ee7588a932eeabbc6a9e8 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a5c9b929b4ad2ce981aa6eb9455ce3a9a4e0611a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 6c5cfe3d4de17f20eb487043f114ffa1712c1f74 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6878a2c0e6a326b8d9b1d38cd47fdb825c55fd02 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 57ff42e9ca59845292f7819d1293df24db5a0585 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6af489f4a5603cb89ed885234388ca5053d30f37 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From d65416896dc0b8dca01970fee359cbcf402007d0 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.
---
 srcpkgs/ncurses/patches/alacritty.patch | 77 +++++++++++++++++++++++++
 srcpkgs/ncurses/patches/dvtm.patch      | 75 ++++++++++++++++++++++++
 srcpkgs/ncurses/patches/st.patch        | 28 +++++++++
 3 files changed, 180 insertions(+)
 create mode 100644 srcpkgs/ncurses/patches/alacritty.patch
 create mode 100644 srcpkgs/ncurses/patches/dvtm.patch
 create mode 100644 srcpkgs/ncurses/patches/st.patch

diff --git a/srcpkgs/ncurses/patches/alacritty.patch b/srcpkgs/ncurses/patches/alacritty.patch
new file mode 100644
index 000000000000..453aa2d8c5c5
--- /dev/null
+++ b/srcpkgs/ncurses/patches/alacritty.patch
@@ -0,0 +1,77 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:38:50.070152052 +0000
+@@ -7422,74 +7422,6 @@
+ 
+ ######## OPENGL CLIENTS
+ 
+-#### Alacritty
+-# https://github.com/jwilm/alacritty
+-# Version 0.6.0 (2020/11/25)
+-# Version 0.4.0 (2019/11/25)
+-# Version 0.3.3 (2019/08/03)
+-# Version 0.2.1 (2018/10/03)
+-# Project started in 2016/02, uses Rust and OpenGL, and in contrast to (most X
+-# terminal programs) is not designed to run with a remote server.
+-#
+-# Packaged in Arch Linux -
+-# vttest:
+-#	initial screensize 24x80
+-#	no DECCOLM (does not switch between 80/132 columns)
+-#	otherwise, passes wrapping test
+-#	no DECSCNM
+-#	identifies as a vt102
+-#	numeric keypad does not send expected codes (seen in 0.4.0)
+-#	passes bce test
+-#	vt220:
+-#		ECH works in 0.3.3 (0.2.1 left text on right margin)
+-#		no SRM, DECSCA
+-#	vt320:
+-#		fails DECXCPR
+-#		does not implement any of the DECRQM/DECRPM controls
+-#		does not implement any of the DECRQSS controls
+-#	vt420:
+-#		no DECLRMM
+-#		no DECBI, DECFI
+-#	other:
+-#		fails CHT, otherwise ECMA-48 cursor movement ok
+-#		fails ERM/SPA, SL, SR, passes REP, SD, SU
+-#	xterm:
+-#		no X10 mouse
+-#		has normal and highlight mouse
+-#		has any-event and button-event mouse
+-#		+ does support SGR-mouse
+-#		+ does not correctly support focus in/out events (seen in 0.4.0)
+-#		cursor-position wrong after alternate-screen (fixed in 0.4.0)
+-#		none of the dtterm controls work
+-# tack:
+-#	bell and flash do not work
+-#	blink does not work
+-#	italics and crossed-out work (latter did not work in 0.2.1)
+-#	function-keys work up (tested combinations which window manager allows)
+-#	treats meta as escape-prefix
+-#
+-# The program sources include "alacritty" and "alacritty-direct", which are
+-# copied from "xterm-256color" and "xterm-direct" (but using semicolon for
+-# subparameter delimiter).  Refactored here to use ncurses building blocks -TD
+-alacritty|alacritty terminal emulator,
+-	rs1=\Ec\E]104\007, use=xterm+256color,
+-	use=alacritty+common,
+-
+-alacritty-direct|alacritty with direct color indexing,
+-	use=xterm+indirect, use=alacritty+common,
+-
+-# cancel km, since it is not actually meta mode -TD
+-# added ecma+strikeout in 0.3.3 -TD
+-# added xterm+sl-twm in 0.3.3 -TD
+-alacritty+common|base fragment for alacritty,
+-	km@, npc,
+-	kb2=\EOE, kbs=^?, kcbt=\E[Z, kent=\EOM, Se=\E[0 q,
+-	Smulx=\E[4:%p1%dm, use=ecma+index, use=xterm+sm+1006,
+-	use=xterm-basic, use=xterm+app, use=ansi+rep,
+-	use=xterm+tmux, use=ecma+strikeout, use=xterm+sl-twm,
+-	use=ecma+italics, use=xterm+pce2, use=xterm+pcc2,
+-	use=xterm+pcf2,
+-
+ #### Kitty
+ # https://github.com/kovidgoyal/kitty
+ # Project started in 2016/10 (see alacritty), but is a Python script rather
diff --git a/srcpkgs/ncurses/patches/dvtm.patch b/srcpkgs/ncurses/patches/dvtm.patch
new file mode 100644
index 000000000000..f17576d52c9d
--- /dev/null
+++ b/srcpkgs/ncurses/patches/dvtm.patch
@@ -0,0 +1,75 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:40:42.188396399 +0000
+@@ -8186,72 +8186,6 @@
+ 	      %{256}%/%{255}%&%d:%p1%{255}%&%d%;m,
+ 	use=xterm+direct, use=tmux,
+ 
+-#### Dvtm
+-
+-# dvtwm 0.15
+-# http://www.brain-dump.org/projects/dvtm/
+-#
+-# + This uses ncurses to manage the display, including support for italics and
+-#   default-colors.
+-# + However, default-colors are incomplete: do not set bce.
+-# + It does not implement flash (since no \e[?5h)
+-# + Do not set XT: dvtm knows about OSC 0 and 2, but not 1.
+-#   Oddly enough, if $TERM contains "linux", it attempts to set the title.
+-# + Some of the program is cut/paste from rxvt-unicode, e.g., the ACS table.
+-# + The built-in table of function-keys (based on rxvt) is incomplete (ends
+-#   with kf22).
+-# + It also omits the shifted cursor- and editing-keypad keys.
+-#   However, it is confused by xterm's shifted cursor- and editing-keypad keys
+-#   (and passes those through without interpretation)
+-#   and may simply pass-through rxvt's, making it appear to work.
+-#   In other cases such as kf23 and up, no pass-through is done.
+-# + Most of the mode-settings in the initialization/reset strings are not
+-#   implemented; dvtm copies its description from rxvt.
+-dvtm|dynamic virtual terminal manager,
+-	am, eo, mir, msgr, xenl, AX,
+-	colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
+-	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+-	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
+-	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+-	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+-	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+-	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
+-	enacs=\E(B\E)0, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
+-	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\n,
+-	is1=\E[?47l\E=\E[?1l,
+-	is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+-	kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kIC=\E[2$, kLFT=\E[d,
+-	kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy,
+-	kb2=\EOu, kbs=^?, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D,
+-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kel=\E[8\^, kend=\E[8~,
+-	kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~,
+-	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+-	kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+-	kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf21=\E[23$,
+-	kf22=\E[24$, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+-	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+-	khome=\E[7~, kind=\E[a, kmous=\E[M, kri=\E[b, op=\E[39;49m,
+-	rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
+-	rmir=\E[4l, rmso=\E[27m, rmul=\E[24m,
+-	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
+-	rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>\E[?1000l\E[?
+-	    25h,
+-	s0ds=\E(B, s1ds=\E(0, sc=\E7, setab=\E[4%p1%dm,
+-	setaf=\E[3%p1%dm,
+-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?
+-	    %p9%t\016%e\017%;,
+-	sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
+-	smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
+-	use=vt220+vtedit, use=vt220+cvis, use=ecma+italics,
+-
+-dvtm-256color|dynamic virtual terminal manager with 256 colors,
+-	colors#0x100, pairs#0x10000,
+-	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
+-	      5;%p1%d%;m,
+-	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5
+-	      ;%p1%d%;m,
+-	use=dvtm,
+-
+ #### NCSA Telnet
+ 
+ # Francesco Potorti <F.Potorti@cnuce.cnr.it>:
diff --git a/srcpkgs/ncurses/patches/st.patch b/srcpkgs/ncurses/patches/st.patch
new file mode 100644
index 000000000000..94d481f91e0f
--- /dev/null
+++ b/srcpkgs/ncurses/patches/st.patch
@@ -0,0 +1,28 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 17:22:30.492083295 +0000
+@@ -7020,9 +7020,6 @@
+ #### SIMPLETERM
+ # st.suckless.org
+ 
+-st|stterm| simpleterm,
+-	use=st-0.8,
+-
+ # Reviewed 0.8.2:
+ # In tack,
+ #	there is some problem turning off line-drawing
+@@ -7193,15 +7190,6 @@
+ 	use=vt220+cvis, use=ecma+index,
+ st-16color|stterm-16color|simpleterm with 16-colors,
+ 	use=ibm+16color, use=st,
+-# Tested with st 0.8.2
+-# The issue with the titlebar is fixed, though st is very slow.
+-# In st 0.7, 256 colors "works", but when running xterm's test-scripts, some
+-# garbage is shown in the titlebar.
+-#
+-# terminal wants to use TERM=stterm-256color, but that is longer than 14
+-# characters, making the choice nonportable.
+-st-256color|stterm-256color|simpleterm with 256 colors,
+-	use=xterm+256color, use=st,
+ 
+ #### TERMINATOR
+ # https://github.com/software-jessies-org/jessies/wiki/Terminator

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (7 preceding siblings ...)
  2022-07-22 17:39 ` [PR PATCH] [Updated] " meator
@ 2022-07-22 17:41 ` meator
  2022-07-22 17:41 ` meator
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 21340 bytes --]

From 5d96790d0eec23d3e83ee7588a932eeabbc6a9e8 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a5c9b929b4ad2ce981aa6eb9455ce3a9a4e0611a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 6c5cfe3d4de17f20eb487043f114ffa1712c1f74 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6878a2c0e6a326b8d9b1d38cd47fdb825c55fd02 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 57ff42e9ca59845292f7819d1293df24db5a0585 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6af489f4a5603cb89ed885234388ca5053d30f37 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From 4306cf094bb5ce6f5705e223d162b682abc935e1 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.
---
 srcpkgs/ncurses/patches/alacritty.patch | 77 +++++++++++++++++++++++++
 srcpkgs/ncurses/patches/dvtm.patch      | 75 ++++++++++++++++++++++++
 srcpkgs/ncurses/patches/st.patch        | 28 +++++++++
 srcpkgs/ncurses/template                |  2 +-
 4 files changed, 181 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ncurses/patches/alacritty.patch
 create mode 100644 srcpkgs/ncurses/patches/dvtm.patch
 create mode 100644 srcpkgs/ncurses/patches/st.patch

diff --git a/srcpkgs/ncurses/patches/alacritty.patch b/srcpkgs/ncurses/patches/alacritty.patch
new file mode 100644
index 000000000000..453aa2d8c5c5
--- /dev/null
+++ b/srcpkgs/ncurses/patches/alacritty.patch
@@ -0,0 +1,77 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:38:50.070152052 +0000
+@@ -7422,74 +7422,6 @@
+ 
+ ######## OPENGL CLIENTS
+ 
+-#### Alacritty
+-# https://github.com/jwilm/alacritty
+-# Version 0.6.0 (2020/11/25)
+-# Version 0.4.0 (2019/11/25)
+-# Version 0.3.3 (2019/08/03)
+-# Version 0.2.1 (2018/10/03)
+-# Project started in 2016/02, uses Rust and OpenGL, and in contrast to (most X
+-# terminal programs) is not designed to run with a remote server.
+-#
+-# Packaged in Arch Linux -
+-# vttest:
+-#	initial screensize 24x80
+-#	no DECCOLM (does not switch between 80/132 columns)
+-#	otherwise, passes wrapping test
+-#	no DECSCNM
+-#	identifies as a vt102
+-#	numeric keypad does not send expected codes (seen in 0.4.0)
+-#	passes bce test
+-#	vt220:
+-#		ECH works in 0.3.3 (0.2.1 left text on right margin)
+-#		no SRM, DECSCA
+-#	vt320:
+-#		fails DECXCPR
+-#		does not implement any of the DECRQM/DECRPM controls
+-#		does not implement any of the DECRQSS controls
+-#	vt420:
+-#		no DECLRMM
+-#		no DECBI, DECFI
+-#	other:
+-#		fails CHT, otherwise ECMA-48 cursor movement ok
+-#		fails ERM/SPA, SL, SR, passes REP, SD, SU
+-#	xterm:
+-#		no X10 mouse
+-#		has normal and highlight mouse
+-#		has any-event and button-event mouse
+-#		+ does support SGR-mouse
+-#		+ does not correctly support focus in/out events (seen in 0.4.0)
+-#		cursor-position wrong after alternate-screen (fixed in 0.4.0)
+-#		none of the dtterm controls work
+-# tack:
+-#	bell and flash do not work
+-#	blink does not work
+-#	italics and crossed-out work (latter did not work in 0.2.1)
+-#	function-keys work up (tested combinations which window manager allows)
+-#	treats meta as escape-prefix
+-#
+-# The program sources include "alacritty" and "alacritty-direct", which are
+-# copied from "xterm-256color" and "xterm-direct" (but using semicolon for
+-# subparameter delimiter).  Refactored here to use ncurses building blocks -TD
+-alacritty|alacritty terminal emulator,
+-	rs1=\Ec\E]104\007, use=xterm+256color,
+-	use=alacritty+common,
+-
+-alacritty-direct|alacritty with direct color indexing,
+-	use=xterm+indirect, use=alacritty+common,
+-
+-# cancel km, since it is not actually meta mode -TD
+-# added ecma+strikeout in 0.3.3 -TD
+-# added xterm+sl-twm in 0.3.3 -TD
+-alacritty+common|base fragment for alacritty,
+-	km@, npc,
+-	kb2=\EOE, kbs=^?, kcbt=\E[Z, kent=\EOM, Se=\E[0 q,
+-	Smulx=\E[4:%p1%dm, use=ecma+index, use=xterm+sm+1006,
+-	use=xterm-basic, use=xterm+app, use=ansi+rep,
+-	use=xterm+tmux, use=ecma+strikeout, use=xterm+sl-twm,
+-	use=ecma+italics, use=xterm+pce2, use=xterm+pcc2,
+-	use=xterm+pcf2,
+-
+ #### Kitty
+ # https://github.com/kovidgoyal/kitty
+ # Project started in 2016/10 (see alacritty), but is a Python script rather
diff --git a/srcpkgs/ncurses/patches/dvtm.patch b/srcpkgs/ncurses/patches/dvtm.patch
new file mode 100644
index 000000000000..f17576d52c9d
--- /dev/null
+++ b/srcpkgs/ncurses/patches/dvtm.patch
@@ -0,0 +1,75 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:40:42.188396399 +0000
+@@ -8186,72 +8186,6 @@
+ 	      %{256}%/%{255}%&%d:%p1%{255}%&%d%;m,
+ 	use=xterm+direct, use=tmux,
+ 
+-#### Dvtm
+-
+-# dvtwm 0.15
+-# http://www.brain-dump.org/projects/dvtm/
+-#
+-# + This uses ncurses to manage the display, including support for italics and
+-#   default-colors.
+-# + However, default-colors are incomplete: do not set bce.
+-# + It does not implement flash (since no \e[?5h)
+-# + Do not set XT: dvtm knows about OSC 0 and 2, but not 1.
+-#   Oddly enough, if $TERM contains "linux", it attempts to set the title.
+-# + Some of the program is cut/paste from rxvt-unicode, e.g., the ACS table.
+-# + The built-in table of function-keys (based on rxvt) is incomplete (ends
+-#   with kf22).
+-# + It also omits the shifted cursor- and editing-keypad keys.
+-#   However, it is confused by xterm's shifted cursor- and editing-keypad keys
+-#   (and passes those through without interpretation)
+-#   and may simply pass-through rxvt's, making it appear to work.
+-#   In other cases such as kf23 and up, no pass-through is done.
+-# + Most of the mode-settings in the initialization/reset strings are not
+-#   implemented; dvtm copies its description from rxvt.
+-dvtm|dynamic virtual terminal manager,
+-	am, eo, mir, msgr, xenl, AX,
+-	colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
+-	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+-	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
+-	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+-	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+-	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+-	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
+-	enacs=\E(B\E)0, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
+-	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\n,
+-	is1=\E[?47l\E=\E[?1l,
+-	is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+-	kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kIC=\E[2$, kLFT=\E[d,
+-	kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy,
+-	kb2=\EOu, kbs=^?, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D,
+-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kel=\E[8\^, kend=\E[8~,
+-	kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~,
+-	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+-	kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+-	kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf21=\E[23$,
+-	kf22=\E[24$, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+-	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+-	khome=\E[7~, kind=\E[a, kmous=\E[M, kri=\E[b, op=\E[39;49m,
+-	rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
+-	rmir=\E[4l, rmso=\E[27m, rmul=\E[24m,
+-	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
+-	rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>\E[?1000l\E[?
+-	    25h,
+-	s0ds=\E(B, s1ds=\E(0, sc=\E7, setab=\E[4%p1%dm,
+-	setaf=\E[3%p1%dm,
+-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?
+-	    %p9%t\016%e\017%;,
+-	sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
+-	smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
+-	use=vt220+vtedit, use=vt220+cvis, use=ecma+italics,
+-
+-dvtm-256color|dynamic virtual terminal manager with 256 colors,
+-	colors#0x100, pairs#0x10000,
+-	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
+-	      5;%p1%d%;m,
+-	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5
+-	      ;%p1%d%;m,
+-	use=dvtm,
+-
+ #### NCSA Telnet
+ 
+ # Francesco Potorti <F.Potorti@cnuce.cnr.it>:
diff --git a/srcpkgs/ncurses/patches/st.patch b/srcpkgs/ncurses/patches/st.patch
new file mode 100644
index 000000000000..94d481f91e0f
--- /dev/null
+++ b/srcpkgs/ncurses/patches/st.patch
@@ -0,0 +1,28 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 17:22:30.492083295 +0000
+@@ -7020,9 +7020,6 @@
+ #### SIMPLETERM
+ # st.suckless.org
+ 
+-st|stterm| simpleterm,
+-	use=st-0.8,
+-
+ # Reviewed 0.8.2:
+ # In tack,
+ #	there is some problem turning off line-drawing
+@@ -7193,15 +7190,6 @@
+ 	use=vt220+cvis, use=ecma+index,
+ st-16color|stterm-16color|simpleterm with 16-colors,
+ 	use=ibm+16color, use=st,
+-# Tested with st 0.8.2
+-# The issue with the titlebar is fixed, though st is very slow.
+-# In st 0.7, 256 colors "works", but when running xterm's test-scripts, some
+-# garbage is shown in the titlebar.
+-#
+-# terminal wants to use TERM=stterm-256color, but that is longer than 14
+-# characters, making the choice nonportable.
+-st-256color|stterm-256color|simpleterm with 256 colors,
+-	use=xterm+256color, use=st,
+ 
+ #### TERMINATOR
+ # https://github.com/software-jessies-org/jessies/wiki/Terminator
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..7893422b750b 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (8 preceding siblings ...)
  2022-07-22 17:41 ` meator
@ 2022-07-22 17:41 ` meator
  2022-07-22 17:48 ` meator
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192800444

Comment:
You are right. It would only create problems. Currently using the same approach as `foot-terminfo`.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (9 preceding siblings ...)
  2022-07-22 17:41 ` meator
@ 2022-07-22 17:48 ` meator
  2022-07-22 17:57 ` [PR PATCH] [Updated] " meator
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1192805506

Comment:
I have removed only the colliding files of `st-terminfo` from `ncurses-term`. `ncurses-term` still contains
```
/usr/share/terminfo/s/st-0.6
/usr/share/terminfo/s/st-0.7
/usr/share/terminfo/s/st-0.8
/usr/share/terminfo/s/st-16color
/usr/share/terminfo/s/st-direct
/usr/share/terminfo/s/stterm-16color
/usr/share/terminfo/s/simpleterm
/usr/share/terminfo/o/old-st
/usr/share/terminfo/s/stterm-16color
```
And probably some more I've forgotten. Is that okay?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (10 preceding siblings ...)
  2022-07-22 17:48 ` meator
@ 2022-07-22 17:57 ` meator
  2022-07-22 17:59 ` meator
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 21863 bytes --]

From 5d96790d0eec23d3e83ee7588a932eeabbc6a9e8 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a5c9b929b4ad2ce981aa6eb9455ce3a9a4e0611a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 6c5cfe3d4de17f20eb487043f114ffa1712c1f74 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6878a2c0e6a326b8d9b1d38cd47fdb825c55fd02 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 57ff42e9ca59845292f7819d1293df24db5a0585 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6af489f4a5603cb89ed885234388ca5053d30f37 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From f0e9a50481af303b1c8e881a86a92ff7dcba392a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.
---
 srcpkgs/ncurses/patches/alacritty.patch | 77 +++++++++++++++++++++++++
 srcpkgs/ncurses/patches/dvtm.patch      | 75 ++++++++++++++++++++++++
 srcpkgs/ncurses/patches/st.patch        | 40 +++++++++++++
 srcpkgs/ncurses/template                |  2 +-
 4 files changed, 193 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ncurses/patches/alacritty.patch
 create mode 100644 srcpkgs/ncurses/patches/dvtm.patch
 create mode 100644 srcpkgs/ncurses/patches/st.patch

diff --git a/srcpkgs/ncurses/patches/alacritty.patch b/srcpkgs/ncurses/patches/alacritty.patch
new file mode 100644
index 000000000000..453aa2d8c5c5
--- /dev/null
+++ b/srcpkgs/ncurses/patches/alacritty.patch
@@ -0,0 +1,77 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:38:50.070152052 +0000
+@@ -7422,74 +7422,6 @@
+ 
+ ######## OPENGL CLIENTS
+ 
+-#### Alacritty
+-# https://github.com/jwilm/alacritty
+-# Version 0.6.0 (2020/11/25)
+-# Version 0.4.0 (2019/11/25)
+-# Version 0.3.3 (2019/08/03)
+-# Version 0.2.1 (2018/10/03)
+-# Project started in 2016/02, uses Rust and OpenGL, and in contrast to (most X
+-# terminal programs) is not designed to run with a remote server.
+-#
+-# Packaged in Arch Linux -
+-# vttest:
+-#	initial screensize 24x80
+-#	no DECCOLM (does not switch between 80/132 columns)
+-#	otherwise, passes wrapping test
+-#	no DECSCNM
+-#	identifies as a vt102
+-#	numeric keypad does not send expected codes (seen in 0.4.0)
+-#	passes bce test
+-#	vt220:
+-#		ECH works in 0.3.3 (0.2.1 left text on right margin)
+-#		no SRM, DECSCA
+-#	vt320:
+-#		fails DECXCPR
+-#		does not implement any of the DECRQM/DECRPM controls
+-#		does not implement any of the DECRQSS controls
+-#	vt420:
+-#		no DECLRMM
+-#		no DECBI, DECFI
+-#	other:
+-#		fails CHT, otherwise ECMA-48 cursor movement ok
+-#		fails ERM/SPA, SL, SR, passes REP, SD, SU
+-#	xterm:
+-#		no X10 mouse
+-#		has normal and highlight mouse
+-#		has any-event and button-event mouse
+-#		+ does support SGR-mouse
+-#		+ does not correctly support focus in/out events (seen in 0.4.0)
+-#		cursor-position wrong after alternate-screen (fixed in 0.4.0)
+-#		none of the dtterm controls work
+-# tack:
+-#	bell and flash do not work
+-#	blink does not work
+-#	italics and crossed-out work (latter did not work in 0.2.1)
+-#	function-keys work up (tested combinations which window manager allows)
+-#	treats meta as escape-prefix
+-#
+-# The program sources include "alacritty" and "alacritty-direct", which are
+-# copied from "xterm-256color" and "xterm-direct" (but using semicolon for
+-# subparameter delimiter).  Refactored here to use ncurses building blocks -TD
+-alacritty|alacritty terminal emulator,
+-	rs1=\Ec\E]104\007, use=xterm+256color,
+-	use=alacritty+common,
+-
+-alacritty-direct|alacritty with direct color indexing,
+-	use=xterm+indirect, use=alacritty+common,
+-
+-# cancel km, since it is not actually meta mode -TD
+-# added ecma+strikeout in 0.3.3 -TD
+-# added xterm+sl-twm in 0.3.3 -TD
+-alacritty+common|base fragment for alacritty,
+-	km@, npc,
+-	kb2=\EOE, kbs=^?, kcbt=\E[Z, kent=\EOM, Se=\E[0 q,
+-	Smulx=\E[4:%p1%dm, use=ecma+index, use=xterm+sm+1006,
+-	use=xterm-basic, use=xterm+app, use=ansi+rep,
+-	use=xterm+tmux, use=ecma+strikeout, use=xterm+sl-twm,
+-	use=ecma+italics, use=xterm+pce2, use=xterm+pcc2,
+-	use=xterm+pcf2,
+-
+ #### Kitty
+ # https://github.com/kovidgoyal/kitty
+ # Project started in 2016/10 (see alacritty), but is a Python script rather
diff --git a/srcpkgs/ncurses/patches/dvtm.patch b/srcpkgs/ncurses/patches/dvtm.patch
new file mode 100644
index 000000000000..f17576d52c9d
--- /dev/null
+++ b/srcpkgs/ncurses/patches/dvtm.patch
@@ -0,0 +1,75 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:40:42.188396399 +0000
+@@ -8186,72 +8186,6 @@
+ 	      %{256}%/%{255}%&%d:%p1%{255}%&%d%;m,
+ 	use=xterm+direct, use=tmux,
+ 
+-#### Dvtm
+-
+-# dvtwm 0.15
+-# http://www.brain-dump.org/projects/dvtm/
+-#
+-# + This uses ncurses to manage the display, including support for italics and
+-#   default-colors.
+-# + However, default-colors are incomplete: do not set bce.
+-# + It does not implement flash (since no \e[?5h)
+-# + Do not set XT: dvtm knows about OSC 0 and 2, but not 1.
+-#   Oddly enough, if $TERM contains "linux", it attempts to set the title.
+-# + Some of the program is cut/paste from rxvt-unicode, e.g., the ACS table.
+-# + The built-in table of function-keys (based on rxvt) is incomplete (ends
+-#   with kf22).
+-# + It also omits the shifted cursor- and editing-keypad keys.
+-#   However, it is confused by xterm's shifted cursor- and editing-keypad keys
+-#   (and passes those through without interpretation)
+-#   and may simply pass-through rxvt's, making it appear to work.
+-#   In other cases such as kf23 and up, no pass-through is done.
+-# + Most of the mode-settings in the initialization/reset strings are not
+-#   implemented; dvtm copies its description from rxvt.
+-dvtm|dynamic virtual terminal manager,
+-	am, eo, mir, msgr, xenl, AX,
+-	colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
+-	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+-	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
+-	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+-	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+-	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+-	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
+-	enacs=\E(B\E)0, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
+-	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\n,
+-	is1=\E[?47l\E=\E[?1l,
+-	is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+-	kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kIC=\E[2$, kLFT=\E[d,
+-	kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy,
+-	kb2=\EOu, kbs=^?, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D,
+-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kel=\E[8\^, kend=\E[8~,
+-	kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~,
+-	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+-	kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+-	kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf21=\E[23$,
+-	kf22=\E[24$, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+-	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+-	khome=\E[7~, kind=\E[a, kmous=\E[M, kri=\E[b, op=\E[39;49m,
+-	rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
+-	rmir=\E[4l, rmso=\E[27m, rmul=\E[24m,
+-	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
+-	rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>\E[?1000l\E[?
+-	    25h,
+-	s0ds=\E(B, s1ds=\E(0, sc=\E7, setab=\E[4%p1%dm,
+-	setaf=\E[3%p1%dm,
+-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?
+-	    %p9%t\016%e\017%;,
+-	sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
+-	smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
+-	use=vt220+vtedit, use=vt220+cvis, use=ecma+italics,
+-
+-dvtm-256color|dynamic virtual terminal manager with 256 colors,
+-	colors#0x100, pairs#0x10000,
+-	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
+-	      5;%p1%d%;m,
+-	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5
+-	      ;%p1%d%;m,
+-	use=dvtm,
+-
+ #### NCSA Telnet
+ 
+ # Francesco Potorti <F.Potorti@cnuce.cnr.it>:
diff --git a/srcpkgs/ncurses/patches/st.patch b/srcpkgs/ncurses/patches/st.patch
new file mode 100644
index 000000000000..1ff9c395a00f
--- /dev/null
+++ b/srcpkgs/ncurses/patches/st.patch
@@ -0,0 +1,40 @@
+diff '--color=auto' -Naur a/misc/terminfo.src b/misc/terminfo.src
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 17:52:29.915846874 +0000
+@@ -5259,7 +5259,7 @@
+ konsole-direct|konsole with direct-color indexing,
+ 	use=xterm+indirect, use=konsole,
+ st-direct|simpleterm with direct-color indexing,
+-	use=xterm+indirect, use=st,
++	use=xterm+indirect, use=st-0.8,
+ vte-direct|VTE with direct-color indexing,
+ 	use=xterm+indirect, use=vte,
+ # reportedly in Apple's Mohave (fall 2018), but untested -TD
+@@ -7020,9 +7020,6 @@
+ #### SIMPLETERM
+ # st.suckless.org
+ 
+-st|stterm| simpleterm,
+-	use=st-0.8,
+-
+ # Reviewed 0.8.2:
+ # In tack,
+ #	there is some problem turning off line-drawing
+@@ -7192,16 +7189,7 @@
+ 	sgr0=\E[0m, smacs=\E(0, smso=\E[7m, smul=\E[4m,
+ 	use=vt220+cvis, use=ecma+index,
+ st-16color|stterm-16color|simpleterm with 16-colors,
+-	use=ibm+16color, use=st,
+-# Tested with st 0.8.2
+-# The issue with the titlebar is fixed, though st is very slow.
+-# In st 0.7, 256 colors "works", but when running xterm's test-scripts, some
+-# garbage is shown in the titlebar.
+-#
+-# terminal wants to use TERM=stterm-256color, but that is longer than 14
+-# characters, making the choice nonportable.
+-st-256color|stterm-256color|simpleterm with 256 colors,
+-	use=xterm+256color, use=st,
++	use=ibm+16color, use=st-0.8,
+ 
+ #### TERMINATOR
+ # https://github.com/software-jessies-org/jessies/wiki/Terminator
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..7893422b750b 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (11 preceding siblings ...)
  2022-07-22 17:57 ` [PR PATCH] [Updated] " meator
@ 2022-07-22 17:59 ` meator
  2022-07-23 15:08 ` sgn
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-22 17:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 21796 bytes --]

From 5d96790d0eec23d3e83ee7588a932eeabbc6a9e8 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a5c9b929b4ad2ce981aa6eb9455ce3a9a4e0611a Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 6c5cfe3d4de17f20eb487043f114ffa1712c1f74 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6878a2c0e6a326b8d9b1d38cd47fdb825c55fd02 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 57ff42e9ca59845292f7819d1293df24db5a0585 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6af489f4a5603cb89ed885234388ca5053d30f37 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From ac2c732cc77a754d698ddf278a0d52ab1d2b215f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.
---
 srcpkgs/ncurses/patches/alacritty.patch | 77 +++++++++++++++++++++++++
 srcpkgs/ncurses/patches/dvtm.patch      | 75 ++++++++++++++++++++++++
 srcpkgs/ncurses/patches/st.patch        | 39 +++++++++++++
 srcpkgs/ncurses/template                |  2 +-
 4 files changed, 192 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/ncurses/patches/alacritty.patch
 create mode 100644 srcpkgs/ncurses/patches/dvtm.patch
 create mode 100644 srcpkgs/ncurses/patches/st.patch

diff --git a/srcpkgs/ncurses/patches/alacritty.patch b/srcpkgs/ncurses/patches/alacritty.patch
new file mode 100644
index 000000000000..453aa2d8c5c5
--- /dev/null
+++ b/srcpkgs/ncurses/patches/alacritty.patch
@@ -0,0 +1,77 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:38:50.070152052 +0000
+@@ -7422,74 +7422,6 @@
+ 
+ ######## OPENGL CLIENTS
+ 
+-#### Alacritty
+-# https://github.com/jwilm/alacritty
+-# Version 0.6.0 (2020/11/25)
+-# Version 0.4.0 (2019/11/25)
+-# Version 0.3.3 (2019/08/03)
+-# Version 0.2.1 (2018/10/03)
+-# Project started in 2016/02, uses Rust and OpenGL, and in contrast to (most X
+-# terminal programs) is not designed to run with a remote server.
+-#
+-# Packaged in Arch Linux -
+-# vttest:
+-#	initial screensize 24x80
+-#	no DECCOLM (does not switch between 80/132 columns)
+-#	otherwise, passes wrapping test
+-#	no DECSCNM
+-#	identifies as a vt102
+-#	numeric keypad does not send expected codes (seen in 0.4.0)
+-#	passes bce test
+-#	vt220:
+-#		ECH works in 0.3.3 (0.2.1 left text on right margin)
+-#		no SRM, DECSCA
+-#	vt320:
+-#		fails DECXCPR
+-#		does not implement any of the DECRQM/DECRPM controls
+-#		does not implement any of the DECRQSS controls
+-#	vt420:
+-#		no DECLRMM
+-#		no DECBI, DECFI
+-#	other:
+-#		fails CHT, otherwise ECMA-48 cursor movement ok
+-#		fails ERM/SPA, SL, SR, passes REP, SD, SU
+-#	xterm:
+-#		no X10 mouse
+-#		has normal and highlight mouse
+-#		has any-event and button-event mouse
+-#		+ does support SGR-mouse
+-#		+ does not correctly support focus in/out events (seen in 0.4.0)
+-#		cursor-position wrong after alternate-screen (fixed in 0.4.0)
+-#		none of the dtterm controls work
+-# tack:
+-#	bell and flash do not work
+-#	blink does not work
+-#	italics and crossed-out work (latter did not work in 0.2.1)
+-#	function-keys work up (tested combinations which window manager allows)
+-#	treats meta as escape-prefix
+-#
+-# The program sources include "alacritty" and "alacritty-direct", which are
+-# copied from "xterm-256color" and "xterm-direct" (but using semicolon for
+-# subparameter delimiter).  Refactored here to use ncurses building blocks -TD
+-alacritty|alacritty terminal emulator,
+-	rs1=\Ec\E]104\007, use=xterm+256color,
+-	use=alacritty+common,
+-
+-alacritty-direct|alacritty with direct color indexing,
+-	use=xterm+indirect, use=alacritty+common,
+-
+-# cancel km, since it is not actually meta mode -TD
+-# added ecma+strikeout in 0.3.3 -TD
+-# added xterm+sl-twm in 0.3.3 -TD
+-alacritty+common|base fragment for alacritty,
+-	km@, npc,
+-	kb2=\EOE, kbs=^?, kcbt=\E[Z, kent=\EOM, Se=\E[0 q,
+-	Smulx=\E[4:%p1%dm, use=ecma+index, use=xterm+sm+1006,
+-	use=xterm-basic, use=xterm+app, use=ansi+rep,
+-	use=xterm+tmux, use=ecma+strikeout, use=xterm+sl-twm,
+-	use=ecma+italics, use=xterm+pce2, use=xterm+pcc2,
+-	use=xterm+pcf2,
+-
+ #### Kitty
+ # https://github.com/kovidgoyal/kitty
+ # Project started in 2016/10 (see alacritty), but is a Python script rather
diff --git a/srcpkgs/ncurses/patches/dvtm.patch b/srcpkgs/ncurses/patches/dvtm.patch
new file mode 100644
index 000000000000..f17576d52c9d
--- /dev/null
+++ b/srcpkgs/ncurses/patches/dvtm.patch
@@ -0,0 +1,75 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 16:40:42.188396399 +0000
+@@ -8186,72 +8186,6 @@
+ 	      %{256}%/%{255}%&%d:%p1%{255}%&%d%;m,
+ 	use=xterm+direct, use=tmux,
+ 
+-#### Dvtm
+-
+-# dvtwm 0.15
+-# http://www.brain-dump.org/projects/dvtm/
+-#
+-# + This uses ncurses to manage the display, including support for italics and
+-#   default-colors.
+-# + However, default-colors are incomplete: do not set bce.
+-# + It does not implement flash (since no \e[?5h)
+-# + Do not set XT: dvtm knows about OSC 0 and 2, but not 1.
+-#   Oddly enough, if $TERM contains "linux", it attempts to set the title.
+-# + Some of the program is cut/paste from rxvt-unicode, e.g., the ACS table.
+-# + The built-in table of function-keys (based on rxvt) is incomplete (ends
+-#   with kf22).
+-# + It also omits the shifted cursor- and editing-keypad keys.
+-#   However, it is confused by xterm's shifted cursor- and editing-keypad keys
+-#   (and passes those through without interpretation)
+-#   and may simply pass-through rxvt's, making it appear to work.
+-#   In other cases such as kf23 and up, no pass-through is done.
+-# + Most of the mode-settings in the initialization/reset strings are not
+-#   implemented; dvtm copies its description from rxvt.
+-dvtm|dynamic virtual terminal manager,
+-	am, eo, mir, msgr, xenl, AX,
+-	colors#8, cols#80, it#8, lines#24, ncv@, pairs#64,
+-	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
+-	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
+-	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+-	cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
+-	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
+-	dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K,
+-	enacs=\E(B\E)0, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
+-	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\n,
+-	is1=\E[?47l\E=\E[?1l,
+-	is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
+-	kDC=\E[3$, kEND=\E[8$, kHOM=\E[7$, kIC=\E[2$, kLFT=\E[d,
+-	kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, ka1=\EOw, ka3=\EOy,
+-	kb2=\EOu, kbs=^?, kc1=\EOq, kc3=\EOs, kcbt=\E[Z, kcub1=\E[D,
+-	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kel=\E[8\^, kend=\E[8~,
+-	kent=\EOM, kf0=\E[21~, kf1=\E[11~, kf10=\E[21~,
+-	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+-	kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+-	kf19=\E[33~, kf2=\E[12~, kf20=\E[34~, kf21=\E[23$,
+-	kf22=\E[24$, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~,
+-	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+-	khome=\E[7~, kind=\E[a, kmous=\E[M, kri=\E[b, op=\E[39;49m,
+-	rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8,
+-	rmir=\E[4l, rmso=\E[27m, rmul=\E[24m,
+-	rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
+-	rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>\E[?1000l\E[?
+-	    25h,
+-	s0ds=\E(B, s1ds=\E(0, sc=\E7, setab=\E[4%p1%dm,
+-	setaf=\E[3%p1%dm,
+-	sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;m%?
+-	    %p9%t\016%e\017%;,
+-	sgr0=\E[m\017, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h,
+-	smso=\E[7m, smul=\E[4m, tbc=\E[3g, vpa=\E[%i%p1%dd,
+-	use=vt220+vtedit, use=vt220+cvis, use=ecma+italics,
+-
+-dvtm-256color|dynamic virtual terminal manager with 256 colors,
+-	colors#0x100, pairs#0x10000,
+-	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;
+-	      5;%p1%d%;m,
+-	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5
+-	      ;%p1%d%;m,
+-	use=dvtm,
+-
+ #### NCSA Telnet
+ 
+ # Francesco Potorti <F.Potorti@cnuce.cnr.it>:
diff --git a/srcpkgs/ncurses/patches/st.patch b/srcpkgs/ncurses/patches/st.patch
new file mode 100644
index 000000000000..2c3fc04a7086
--- /dev/null
+++ b/srcpkgs/ncurses/patches/st.patch
@@ -0,0 +1,39 @@
+--- a/misc/terminfo.src	2021-10-14 00:40:38.000000000 +0000
++++ b/misc/terminfo.src	2022-07-22 17:52:29.915846874 +0000
+@@ -5259,7 +5259,7 @@
+ konsole-direct|konsole with direct-color indexing,
+ 	use=xterm+indirect, use=konsole,
+ st-direct|simpleterm with direct-color indexing,
+-	use=xterm+indirect, use=st,
++	use=xterm+indirect, use=st-0.8,
+ vte-direct|VTE with direct-color indexing,
+ 	use=xterm+indirect, use=vte,
+ # reportedly in Apple's Mohave (fall 2018), but untested -TD
+@@ -7020,9 +7020,6 @@
+ #### SIMPLETERM
+ # st.suckless.org
+ 
+-st|stterm| simpleterm,
+-	use=st-0.8,
+-
+ # Reviewed 0.8.2:
+ # In tack,
+ #	there is some problem turning off line-drawing
+@@ -7192,16 +7189,7 @@
+ 	sgr0=\E[0m, smacs=\E(0, smso=\E[7m, smul=\E[4m,
+ 	use=vt220+cvis, use=ecma+index,
+ st-16color|stterm-16color|simpleterm with 16-colors,
+-	use=ibm+16color, use=st,
+-# Tested with st 0.8.2
+-# The issue with the titlebar is fixed, though st is very slow.
+-# In st 0.7, 256 colors "works", but when running xterm's test-scripts, some
+-# garbage is shown in the titlebar.
+-#
+-# terminal wants to use TERM=stterm-256color, but that is longer than 14
+-# characters, making the choice nonportable.
+-st-256color|stterm-256color|simpleterm with 256 colors,
+-	use=xterm+256color, use=st,
++	use=ibm+16color, use=st-0.8,
+ 
+ #### TERMINATOR
+ # https://github.com/software-jessies-org/jessies/wiki/Terminator
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..7893422b750b 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (12 preceding siblings ...)
  2022-07-22 17:59 ` meator
@ 2022-07-23 15:08 ` sgn
  2022-07-23 21:02 ` [PR PATCH] [Updated] " meator
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: sgn @ 2022-07-23 15:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1193140129

Comment:
I think it's better to remove those conflicts in `post_install` instead of patching.
Anyway, I support compile terminfo.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (13 preceding siblings ...)
  2022-07-23 15:08 ` sgn
@ 2022-07-23 21:02 ` meator
  2022-09-30  0:28 ` classabbyamp
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-07-23 21:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 16569 bytes --]

From 0068219bc5c3c7c0b52b0c90d23795d669c740e9 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 94bf361be18d..ed74956d0f52 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.10.1
-revision=1
+revision=2
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a8efd807f9172faca3ac0fe2705af7d0b9f51abd Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From e800d55690df0e5cf837ab9919da1269f19fcd21 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From a9813ad4f2b4e6d0adbdf76482b362e5bbc572aa Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From a363b00356c9b9bc7860ff48b28a2685646a0daa Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 5afe529b611442090dda1843e7d129826649520f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From 540c892633432fc691c4f24593ad8947c307df0c Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.

This also replaces the remove-foot.patch with rm in post_install() to
make handling of terminfo conflicts consistent.
---
 srcpkgs/ncurses/patches/remove-foot.patch | 64 -----------------------
 srcpkgs/ncurses/template                  | 10 +++-
 2 files changed, 9 insertions(+), 65 deletions(-)
 delete mode 100644 srcpkgs/ncurses/patches/remove-foot.patch

diff --git a/srcpkgs/ncurses/patches/remove-foot.patch b/srcpkgs/ncurses/patches/remove-foot.patch
deleted file mode 100644
index 0328c5c4dad8..000000000000
--- a/srcpkgs/ncurses/patches/remove-foot.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -ruN ncurses-6.3_orig/misc/terminfo.src ncurses-6.3/misc/terminfo.src
---- ncurses-6.3_orig/misc/terminfo.src	2022-05-17 17:22:53.886017351 +0200
-+++ ncurses-6.3/misc/terminfo.src	2022-05-17 17:23:31.941720306 +0200
-@@ -7627,60 +7627,6 @@
- 
- ######## WAYLAND CLIENTS
- 
--#### Foot
--# https://codeberg.org/dnkl/foot/
--# Version 1.8.2
--#
--# This identifies as a VT220 with 4=sixel and 22=color, however:
--# tack:
--#	bell does not work
--#	status-line does not work because foot does not set the window title
--#	sends escape when meta key is used, whether or not smm/rmm enabled
--# vttest:
--#	wrap-test fails
--#	no application-mode for numeric keypad (unless private mode 1035 is set)
--#	no NRCS
--#	no VT52
--#	no SRM
--#	protected areas do not work
--#	SU/SD work, SL/SR do not
--#	DECRPM responds, but not the corresponding ANSI reports.
--#	otherwise few reports, except cursor-position and mouse and some dtterm
--#	VT520 cursor-movement works, except for left/right margins
--#	supports xterm/DECSCUSR, though default case in vttest does not blink
--#		Send: <27> [ 0 <32> q 
--#		Text: The cursor should be a blinking rectangle
--#	partial support for xterm mouse any-event mode and button-event mode:
--#	+ does not report focus-in/focus-out
--#	+ does not report buttons 6/7
--#	alternate-screen works
--foot|foot terminal emulator,
--	oc=\E]104\E\\, use=xterm+256color2, use=foot+base,
--
--foot-direct|foot with direct color indexing,
--	use=xterm+direct, use=foot+base,
--
--foot+base|foot base fragment,
--	am, bce, bw, hs, mir, msgr, npc, xenl, AX, XT,
--	cols#80, it#8, lines#24,
--	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
--	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
--	cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
--	el1=\E[1K, flash=\E]555\E\\, ind=\n, invis=\E[8m,
--	is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^?, kcbt=\E[Z,
--	oc=\E]104\E\\, op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B,
--	rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
--	rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>,
--	sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;
--	    %?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
--	sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smkx=\E[?1h\E=,
--	smso=\E[7m, smul=\E[4m, E3=\E[3J, use=att610+cvis,
--	use=ansi+csr, use=ansi+cup, use=ansi+enq, use=ansi+local,
--	use=ansi+idc, use=ansi+idl, use=ansi+rca2, use=ansi+rep,
--	use=ansi+tabs, use=ecma+index, use=ecma+italics,
--	use=ecma+strikeout, use=xterm+alt+title,
--	use=xterm+pcfkeys, use=xterm+sm+1006, use=xterm+tmux2,
--
- ######## WEB CLIENTS
- 
- #### DomTerm
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..858119189715 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"
@@ -97,6 +97,14 @@ do_install() {
 	fi
 }
 
+post_install() {
+    # resolve conflict with *-terminfo packages
+	rm ${DESTDIR}/usr/share/terminfo/a/alacritty{,-direct}
+	rm ${DESTDIR}/usr/share/terminfo/d/dvtm{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/s/st{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/f/foot{,-direct}
+}
+
 ncurses-libs_package() {
 	short_desc+=" -- shared libraries"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (14 preceding siblings ...)
  2022-07-23 21:02 ` [PR PATCH] [Updated] " meator
@ 2022-09-30  0:28 ` classabbyamp
  2022-09-30 17:20 ` meator
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-09-30  0:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1262966450

Comment:
what's the status of this?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (15 preceding siblings ...)
  2022-09-30  0:28 ` classabbyamp
@ 2022-09-30 17:20 ` meator
  2022-09-30 17:21 ` [PR PATCH] [Updated] " meator
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-09-30 17:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1263826478

Comment:
This should be still ready to merge. I won't fix the lint error because I know nothing about rust and the lint error is unrelated to the changes I'm proposing.

And while I'm here, I might as well fix the indentation of one comment I made. I don't know if this is a feature but `xlint` doesn't check that comments are indented with tabs instead of spaces.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (16 preceding siblings ...)
  2022-09-30 17:20 ` meator
@ 2022-09-30 17:21 ` meator
  2022-09-30 20:12 ` classabbyamp
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-09-30 17:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 16371 bytes --]

From 57007ff740d3f84e504b7a181146874eb7cc1712 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 3 +--
 3 files changed, 1 insertion(+), 15 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 354614c35545..32c191b8e432 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From b8d91e4753c9349e9e68943353c01899a9e638d1 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From 1a196d35410c305e40806f55ffaa615cf2246a8e Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From d8d2e0114d5dc9146b6594d319fd13337378c94c Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From da7aa13c2890168062ec9e52827acee771e8fcf2 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6127c1bfd89b2e01f5c3a821dbf381b9a77a284d Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From 5e4ec0a573ec2a0850ddce27c4d69b7985b9dd24 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] nurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.

This also replaces the remove-foot.patch with rm in post_install() to
make handling of terminfo conflicts consistent.
---
 srcpkgs/ncurses/patches/remove-foot.patch | 64 -----------------------
 srcpkgs/ncurses/template                  | 10 +++-
 2 files changed, 9 insertions(+), 65 deletions(-)
 delete mode 100644 srcpkgs/ncurses/patches/remove-foot.patch

diff --git a/srcpkgs/ncurses/patches/remove-foot.patch b/srcpkgs/ncurses/patches/remove-foot.patch
deleted file mode 100644
index 0328c5c4dad8..000000000000
--- a/srcpkgs/ncurses/patches/remove-foot.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -ruN ncurses-6.3_orig/misc/terminfo.src ncurses-6.3/misc/terminfo.src
---- ncurses-6.3_orig/misc/terminfo.src	2022-05-17 17:22:53.886017351 +0200
-+++ ncurses-6.3/misc/terminfo.src	2022-05-17 17:23:31.941720306 +0200
-@@ -7627,60 +7627,6 @@
- 
- ######## WAYLAND CLIENTS
- 
--#### Foot
--# https://codeberg.org/dnkl/foot/
--# Version 1.8.2
--#
--# This identifies as a VT220 with 4=sixel and 22=color, however:
--# tack:
--#	bell does not work
--#	status-line does not work because foot does not set the window title
--#	sends escape when meta key is used, whether or not smm/rmm enabled
--# vttest:
--#	wrap-test fails
--#	no application-mode for numeric keypad (unless private mode 1035 is set)
--#	no NRCS
--#	no VT52
--#	no SRM
--#	protected areas do not work
--#	SU/SD work, SL/SR do not
--#	DECRPM responds, but not the corresponding ANSI reports.
--#	otherwise few reports, except cursor-position and mouse and some dtterm
--#	VT520 cursor-movement works, except for left/right margins
--#	supports xterm/DECSCUSR, though default case in vttest does not blink
--#		Send: <27> [ 0 <32> q 
--#		Text: The cursor should be a blinking rectangle
--#	partial support for xterm mouse any-event mode and button-event mode:
--#	+ does not report focus-in/focus-out
--#	+ does not report buttons 6/7
--#	alternate-screen works
--foot|foot terminal emulator,
--	oc=\E]104\E\\, use=xterm+256color2, use=foot+base,
--
--foot-direct|foot with direct color indexing,
--	use=xterm+direct, use=foot+base,
--
--foot+base|foot base fragment,
--	am, bce, bw, hs, mir, msgr, npc, xenl, AX, XT,
--	cols#80, it#8, lines#24,
--	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
--	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
--	cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
--	el1=\E[1K, flash=\E]555\E\\, ind=\n, invis=\E[8m,
--	is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^?, kcbt=\E[Z,
--	oc=\E]104\E\\, op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B,
--	rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
--	rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>,
--	sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;
--	    %?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
--	sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smkx=\E[?1h\E=,
--	smso=\E[7m, smul=\E[4m, E3=\E[3J, use=att610+cvis,
--	use=ansi+csr, use=ansi+cup, use=ansi+enq, use=ansi+local,
--	use=ansi+idc, use=ansi+idl, use=ansi+rca2, use=ansi+rep,
--	use=ansi+tabs, use=ecma+index, use=ecma+italics,
--	use=ecma+strikeout, use=xterm+alt+title,
--	use=xterm+pcfkeys, use=xterm+sm+1006, use=xterm+tmux2,
--
- ######## WEB CLIENTS
- 
- #### DomTerm
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..4dcbc95bcb62 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"
@@ -97,6 +97,14 @@ do_install() {
 	fi
 }
 
+post_install() {
+	# resolve conflict with *-terminfo packages
+	rm ${DESTDIR}/usr/share/terminfo/a/alacritty{,-direct}
+	rm ${DESTDIR}/usr/share/terminfo/d/dvtm{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/s/st{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/f/foot{,-direct}
+}
+
 ncurses-libs_package() {
 	short_desc+=" -- shared libraries"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (17 preceding siblings ...)
  2022-09-30 17:21 ` [PR PATCH] [Updated] " meator
@ 2022-09-30 20:12 ` classabbyamp
  2022-09-30 20:14 ` classabbyamp
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-09-30 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1263979476

Comment:
the lint can be fixed by making it `--package autocfg:1.0.1`

```
=> alacritty-0.10.1_2: running post_patch ...
    Updating crates.io index
    Updating autocfg v1.0.1 -> v1.1.0
```

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (18 preceding siblings ...)
  2022-09-30 20:12 ` classabbyamp
@ 2022-09-30 20:14 ` classabbyamp
  2022-10-01 13:08 ` [PR PATCH] [Updated] " meator
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-09-30 20:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1263981569

Comment:
and there's a typo in the last commit, `ncurses` not `nurses`

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (19 preceding siblings ...)
  2022-09-30 20:14 ` classabbyamp
@ 2022-10-01 13:08 ` meator
  2022-10-01 16:21 ` classabbyamp
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-10-01 13:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 16779 bytes --]

From 388f5634469c8ee8829340da6e8f55d01a12ffc5 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

This commit also fixes a xlint warning about including the specific
version of autocfg in cargo update.
---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 354614c35545..9e6180a05a6d 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -17,7 +17,7 @@ checksum=e48d4b10762c2707bb17fd8f89bd98f0dcccc450d223cade706fdd9cfaefb308
 
 post_patch() {
 	# fixes an indexmap error when cross compiling
-	cargo update --package autocfg --precise 1.1.0
+	cargo update --package autocfg:1.0.1 --precise 1.1.0
 }
 
 case "$XBPS_TARGET_MACHINE" in
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From aab094752fe7acb3b710358a503a3a8955c164d4 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From b439e2d36cc1e48de2bf938d984139c8967b0a9c Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 5394d54c337c1cf4a38ceba64836f72ea8dc05fa Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 2b55dd1a730a5cf2ef3557144fdb501fbc490bf7 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6fab02b35ced318dc7c7df0843b4bbc2f65f8f6f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From 787006fa1523cd0c04d56b4ae10140395e079d95 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] ncurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.

This also replaces the remove-foot.patch with rm in post_install() to
make handling of terminfo conflicts consistent.
---
 srcpkgs/ncurses/patches/remove-foot.patch | 64 -----------------------
 srcpkgs/ncurses/template                  | 10 +++-
 2 files changed, 9 insertions(+), 65 deletions(-)
 delete mode 100644 srcpkgs/ncurses/patches/remove-foot.patch

diff --git a/srcpkgs/ncurses/patches/remove-foot.patch b/srcpkgs/ncurses/patches/remove-foot.patch
deleted file mode 100644
index 0328c5c4dad8..000000000000
--- a/srcpkgs/ncurses/patches/remove-foot.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -ruN ncurses-6.3_orig/misc/terminfo.src ncurses-6.3/misc/terminfo.src
---- ncurses-6.3_orig/misc/terminfo.src	2022-05-17 17:22:53.886017351 +0200
-+++ ncurses-6.3/misc/terminfo.src	2022-05-17 17:23:31.941720306 +0200
-@@ -7627,60 +7627,6 @@
- 
- ######## WAYLAND CLIENTS
- 
--#### Foot
--# https://codeberg.org/dnkl/foot/
--# Version 1.8.2
--#
--# This identifies as a VT220 with 4=sixel and 22=color, however:
--# tack:
--#	bell does not work
--#	status-line does not work because foot does not set the window title
--#	sends escape when meta key is used, whether or not smm/rmm enabled
--# vttest:
--#	wrap-test fails
--#	no application-mode for numeric keypad (unless private mode 1035 is set)
--#	no NRCS
--#	no VT52
--#	no SRM
--#	protected areas do not work
--#	SU/SD work, SL/SR do not
--#	DECRPM responds, but not the corresponding ANSI reports.
--#	otherwise few reports, except cursor-position and mouse and some dtterm
--#	VT520 cursor-movement works, except for left/right margins
--#	supports xterm/DECSCUSR, though default case in vttest does not blink
--#		Send: <27> [ 0 <32> q 
--#		Text: The cursor should be a blinking rectangle
--#	partial support for xterm mouse any-event mode and button-event mode:
--#	+ does not report focus-in/focus-out
--#	+ does not report buttons 6/7
--#	alternate-screen works
--foot|foot terminal emulator,
--	oc=\E]104\E\\, use=xterm+256color2, use=foot+base,
--
--foot-direct|foot with direct color indexing,
--	use=xterm+direct, use=foot+base,
--
--foot+base|foot base fragment,
--	am, bce, bw, hs, mir, msgr, npc, xenl, AX, XT,
--	cols#80, it#8, lines#24,
--	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
--	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
--	cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
--	el1=\E[1K, flash=\E]555\E\\, ind=\n, invis=\E[8m,
--	is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^?, kcbt=\E[Z,
--	oc=\E]104\E\\, op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B,
--	rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
--	rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>,
--	sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;
--	    %?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
--	sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smkx=\E[?1h\E=,
--	smso=\E[7m, smul=\E[4m, E3=\E[3J, use=att610+cvis,
--	use=ansi+csr, use=ansi+cup, use=ansi+enq, use=ansi+local,
--	use=ansi+idc, use=ansi+idl, use=ansi+rca2, use=ansi+rep,
--	use=ansi+tabs, use=ecma+index, use=ecma+italics,
--	use=ecma+strikeout, use=xterm+alt+title,
--	use=xterm+pcfkeys, use=xterm+sm+1006, use=xterm+tmux2,
--
- ######## WEB CLIENTS
- 
- #### DomTerm
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..4dcbc95bcb62 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"
@@ -97,6 +97,14 @@ do_install() {
 	fi
 }
 
+post_install() {
+	# resolve conflict with *-terminfo packages
+	rm ${DESTDIR}/usr/share/terminfo/a/alacritty{,-direct}
+	rm ${DESTDIR}/usr/share/terminfo/d/dvtm{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/s/st{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/f/foot{,-direct}
+}
+
 ncurses-libs_package() {
 	short_desc+=" -- shared libraries"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (20 preceding siblings ...)
  2022-10-01 13:08 ` [PR PATCH] [Updated] " meator
@ 2022-10-01 16:21 ` classabbyamp
  2022-10-01 16:45 ` [PR PATCH] [Updated] " meator
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-10-01 16:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1264412391

Comment:
hm i see ncurses still has a foot+base terminfo, is that fine?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Updated] Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (21 preceding siblings ...)
  2022-10-01 16:21 ` classabbyamp
@ 2022-10-01 16:45 ` meator
  2022-10-01 16:48 ` meator
  2022-10-01 21:51 ` [PR PATCH] [Merged]: " classabbyamp
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-10-01 16:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2185 bytes --]

There is an updated pull request by meator against master on the void-packages repository

https://github.com/meator/void-packages terminfo
https://github.com/void-linux/void-packages/pull/38179

Compile terminfo description when building
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

A patch file from https://github.com/void-linux/void-packages/pull/38179.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-terminfo-38179.patch --]
[-- Type: text/x-diff, Size: 16785 bytes --]

From 388f5634469c8ee8829340da6e8f55d01a12ffc5 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 19:58:31 +0200
Subject: [PATCH 1/7] alacritty: generate terminfo when building

This commit also fixes a xlint warning about including the specific
version of autocfg in cargo update.
---
 srcpkgs/alacritty/alacritty-terminfo.INSTALL | 6 ------
 srcpkgs/alacritty/alacritty-terminfo.REMOVE  | 7 -------
 srcpkgs/alacritty/template                   | 5 ++---
 3 files changed, 2 insertions(+), 16 deletions(-)
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.INSTALL
 delete mode 100644 srcpkgs/alacritty/alacritty-terminfo.REMOVE

diff --git a/srcpkgs/alacritty/alacritty-terminfo.INSTALL b/srcpkgs/alacritty/alacritty-terminfo.INSTALL
deleted file mode 100644
index 71e122147942..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -xe alacritty,alacritty-direct usr/share/terminfo/a/alacritty.info
-	;;
-esac
diff --git a/srcpkgs/alacritty/alacritty-terminfo.REMOVE b/srcpkgs/alacritty/alacritty-terminfo.REMOVE
deleted file mode 100644
index 572df4e79ba9..000000000000
--- a/srcpkgs/alacritty/alacritty-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/a/alacritty
-	rm -f usr/share/terminfo/a/alacritty-direct
-	;;
-esac
diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 354614c35545..9e6180a05a6d 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -17,7 +17,7 @@ checksum=e48d4b10762c2707bb17fd8f89bd98f0dcccc450d223cade706fdd9cfaefb308
 
 post_patch() {
 	# fixes an indexmap error when cross compiling
-	cargo update --package autocfg --precise 1.1.0
+	cargo update --package autocfg:1.0.1 --precise 1.1.0
 }
 
 case "$XBPS_TARGET_MACHINE" in
@@ -31,14 +31,13 @@ post_install() {
 	vinstall ../extra/completions/alacritty.bash 644 usr/share/bash-completion/completions alacritty
 	vinstall ../extra/completions/_alacritty 644 usr/share/zsh/site-functions
 	vinstall ../extra/completions/alacritty.fish 644 usr/share/fish/vendor_completions.d
-	vinstall ../extra/alacritty.info 644 usr/share/terminfo/a
+	tic -o ${DESTDIR}/usr/share/terminfo -xe alacritty,alacritty-direct ../extra/alacritty.info
 	vman ../extra/alacritty.man alacritty.1
 	vsconf ../alacritty.yml
 }
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From aab094752fe7acb3b710358a503a3a8955c164d4 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 10:56:03 +0200
Subject: [PATCH 2/7] dvtm: generate terminfo when building & simplify

Generating terminfo in INSTALL is unnecessary and leaves .info file in
/usr/share/terminfo which can confuse some programs.

Dvtm now also uses proper build_style=gnu_makefile instead of calling
make explicitly.
---
 srcpkgs/dvtm/INSTALL  |  6 ------
 srcpkgs/dvtm/REMOVE   |  7 -------
 srcpkgs/dvtm/template | 15 +++++----------
 3 files changed, 5 insertions(+), 23 deletions(-)
 delete mode 100644 srcpkgs/dvtm/INSTALL
 delete mode 100644 srcpkgs/dvtm/REMOVE

diff --git a/srcpkgs/dvtm/INSTALL b/srcpkgs/dvtm/INSTALL
deleted file mode 100644
index 61fb79d9537d..000000000000
--- a/srcpkgs/dvtm/INSTALL
+++ /dev/null
@@ -1,6 +0,0 @@
-case "$ACTION" in
-post)
-	# Compile the terminfo description.
-	tic -s usr/share/terminfo/d/dvtm.info
-	;;
-esac
diff --git a/srcpkgs/dvtm/REMOVE b/srcpkgs/dvtm/REMOVE
deleted file mode 100644
index 7ea17f65f6c1..000000000000
--- a/srcpkgs/dvtm/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "$ACTION" in
-pre)
-	# Remove compiled terminfo files.
-	rm -f usr/share/terminfo/d/dvtm-256color
-	rm -f usr/share/terminfo/d/dvtm
-	;;
-esac
diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c2..e16b36bd8677 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,9 +1,11 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
+build_style=gnu-makefile
+make_use_env=yes
+hostmakedepends="ncurses"
 makedepends="ncurses-devel"
-depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
@@ -11,13 +13,6 @@ homepage="http://www.brain-dump.org/projects/dvtm/"
 distfiles="http://www.brain-dump.org/projects/dvtm/$pkgname-$version.tar.gz"
 checksum=8f2015c05e2ad82f12ae4cf12b363d34f527a4bbc8c369667f239e4542e1e510
 
-do_build() {
-	# Do not run tic, useless in build environment.
-	sed -i 's,tic,/bin/true,g' Makefile
-	make CC=$CC V=1
-}
-do_install() {
-	make PREFIX=/usr DESTDIR=${DESTDIR} install
+post_install() {
 	vlicense LICENSE
-	vinstall dvtm.info 644 usr/share/terminfo/d
 }

From b439e2d36cc1e48de2bf938d984139c8967b0a9c Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:33:12 +0200
Subject: [PATCH 3/7] mtm: generate terminfo when building

This commit also removes build_style=gnu-makefile because do_build() and
do_install() are defined anyway.
---
 srcpkgs/mtm/mtm-terminfo.INSTALL | 5 -----
 srcpkgs/mtm/mtm-terminfo.REMOVE  | 7 -------
 srcpkgs/mtm/template             | 9 ++++-----
 3 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.INSTALL
 delete mode 100644 srcpkgs/mtm/mtm-terminfo.REMOVE

diff --git a/srcpkgs/mtm/mtm-terminfo.INSTALL b/srcpkgs/mtm/mtm-terminfo.INSTALL
deleted file mode 100644
index 4c2d03b145ca..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/m/mtm.ti
-	;;
-esac
diff --git a/srcpkgs/mtm/mtm-terminfo.REMOVE b/srcpkgs/mtm/mtm-terminfo.REMOVE
deleted file mode 100644
index 767b67b2bee4..000000000000
--- a/srcpkgs/mtm/mtm-terminfo.REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/m/mtm
-	rm usr/share/terminfo/m/mtm-256color
-	rm usr/share/terminfo/m/mtm-noutf
-	;;
-esac
diff --git a/srcpkgs/mtm/template b/srcpkgs/mtm/template
index a6cfd2c104ce..599fa463410d 100644
--- a/srcpkgs/mtm/template
+++ b/srcpkgs/mtm/template
@@ -1,10 +1,9 @@
 # Template file for 'mtm'
 pkgname=mtm
 version=1.2.0
-revision=3
-build_style=gnu-makefile
+revision=4
+hostmakedepends="ncurses"
 makedepends="ncurses-devel ncurses-libs"
-depends="ncurses"
 short_desc="Micro Terminal Multiplexer"
 maintainer="travankor <travankor@tuta.io>"
 license="GPL-3.0-or-later"
@@ -18,13 +17,13 @@ do_build() {
 
 do_install() {
 	vbin mtm
-	vinstall mtm.ti 644 usr/share/terminfo/m
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+	tic -sx -o ${DESTDIR}/usr/share/terminfo mtm.ti
 	vman mtm.1
 }
 
 mtm-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 5394d54c337c1cf4a38ceba64836f72ea8dc05fa Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:38:59 +0200
Subject: [PATCH 4/7] rxvt-unicode: do not include .terminfo file

xrvt-unicode already compiles the terminfo descriptions so having the
raw version in /usr/share/terminfo is unnecessary.
---
 srcpkgs/rxvt-unicode/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/rxvt-unicode/template b/srcpkgs/rxvt-unicode/template
index 1ad3c47e2448..6593340186ef 100644
--- a/srcpkgs/rxvt-unicode/template
+++ b/srcpkgs/rxvt-unicode/template
@@ -1,7 +1,7 @@
 # Template file for 'rxvt-unicode'
 pkgname=rxvt-unicode
 version=9.30
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="
  --with-terminfo=/usr/share/terminfo --enable-256-color
@@ -69,7 +69,6 @@ pre_install() {
 }
 
 post_install() {
-	vinstall doc/etc/rxvt-unicode.terminfo 644 usr/share/terminfo/r
 	vinstall ${FILESDIR}/${pkgname}.desktop 644 usr/share/applications
 	vinstall ${FILESDIR}/${pkgname}.png 644 usr/share/pixmaps
 }

From 2b55dd1a730a5cf2ef3557144fdb501fbc490bf7 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:50:12 +0200
Subject: [PATCH 5/7] st: generate terminfo when building & adopt

---
 srcpkgs/st/st-terminfo.INSTALL |  5 -----
 srcpkgs/st/st-terminfo.REMOVE  | 11 -----------
 srcpkgs/st/template            | 13 +++++++------
 3 files changed, 7 insertions(+), 22 deletions(-)
 delete mode 100644 srcpkgs/st/st-terminfo.INSTALL
 delete mode 100644 srcpkgs/st/st-terminfo.REMOVE

diff --git a/srcpkgs/st/st-terminfo.INSTALL b/srcpkgs/st/st-terminfo.INSTALL
deleted file mode 100644
index 53bfb42d10f8..000000000000
--- a/srcpkgs/st/st-terminfo.INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/s/st.terminfo
-	;;
-esac
diff --git a/srcpkgs/st/st-terminfo.REMOVE b/srcpkgs/st/st-terminfo.REMOVE
deleted file mode 100644
index ad3893f3269a..000000000000
--- a/srcpkgs/st/st-terminfo.REMOVE
+++ /dev/null
@@ -1,11 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/s/st
-	rm usr/share/terminfo/s/st-bs
-	rm usr/share/terminfo/s/st-bs-256color
-	rm usr/share/terminfo/s/st-mono
-	rm usr/share/terminfo/s/st-meta
-	rm usr/share/terminfo/s/st-meta-256color
-	rm usr/share/terminfo/s/st-256color
-	;;
-esac
diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 9376a0c0c983..e6d7e3beb977 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,14 +1,14 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.5
-revision=1
+revision=2
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
 makedepends="fontconfig-devel libX11-devel libXft-devel"
 depends="ncurses st-terminfo-${version}_${revision}"
 short_desc="Simple terminal implementation for X"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="meator <meator.dev@gmail.com>"
 license="MIT"
 homepage="https://st.suckless.org"
 distfiles="https://dl.suckless.org/${pkgname}/${pkgname}-${version}.tar.gz"
@@ -17,19 +17,20 @@ checksum=ea6832203ed02ff74182bcb8adaa9ec454c8f989e79232cb859665e2f544ab37
 pre_build() {
 	sed -i 's|Liberation Mono|Monospace|g' config.def.h
 	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
-	# We will use tic after install. See INSTALL.
-	vsed -i Makefile -e '/tic/d'
+	mkdir -p ${DESTDIR}/usr/share/terminfo
+}
+
+pre_install() {
+	export TERMINFO=${DESTDIR}/usr/share/terminfo
 }
 
 post_install() {
-	vinstall st.info 644 usr/share/terminfo/s st.terminfo
 	vdoc README
 	vlicense LICENSE
 }
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
-	depends="ncurses"
 	pkg_install() {
 		vmove usr/share/terminfo
 	}

From 6fab02b35ced318dc7c7df0843b4bbc2f65f8f6f Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Thu, 21 Jul 2022 21:56:28 +0200
Subject: [PATCH 6/7] xst: generate terminfo when building & simplify

---
 srcpkgs/xst/INSTALL  | 5 -----
 srcpkgs/xst/REMOVE   | 8 --------
 srcpkgs/xst/template | 8 ++------
 3 files changed, 2 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/xst/INSTALL
 delete mode 100644 srcpkgs/xst/REMOVE

diff --git a/srcpkgs/xst/INSTALL b/srcpkgs/xst/INSTALL
deleted file mode 100644
index fcad0563b681..000000000000
--- a/srcpkgs/xst/INSTALL
+++ /dev/null
@@ -1,5 +0,0 @@
-case "${ACTION}" in
-post)
-	tic -sx usr/share/terminfo/x/xst.terminfo
-	;;
-esac
diff --git a/srcpkgs/xst/REMOVE b/srcpkgs/xst/REMOVE
deleted file mode 100644
index b46f677d7fdf..000000000000
--- a/srcpkgs/xst/REMOVE
+++ /dev/null
@@ -1,8 +0,0 @@
-case "${ACTION}" in
-pre)
-	rm usr/share/terminfo/x/xst
-	rm usr/share/terminfo/x/xst-meta
-	rm usr/share/terminfo/x/xst-meta-256color
-	rm usr/share/terminfo/x/xst-256color
-	;;
-esac
diff --git a/srcpkgs/xst/template b/srcpkgs/xst/template
index 8600c680ae36..f06dbed9b3d5 100644
--- a/srcpkgs/xst/template
+++ b/srcpkgs/xst/template
@@ -1,7 +1,7 @@
 # Template file for 'xst'
 pkgname=xst
 version=0.8.4.1
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -14,11 +14,7 @@ homepage="https://github.com/gnotclub/xst"
 distfiles="https://github.com/gnotclub/xst/archive/v${version}.tar.gz"
 checksum=cbeb2da6c289415d1168559c6f58b4ce47fd266edefbabc38fd59e8b7c87226d
 
-do_install() {
-	vbin xst
-	vman st.1 xst.1
-
-	vinstall st.info 644 usr/share/terminfo/x xst.terminfo
+post_install() {
 	vdoc README
 	vdoc FAQ
 	vdoc .Xresources Xresources

From 01b844e95a57e3e4cdbe792a4bd56726d6474fd7 Mon Sep 17 00:00:00 2001
From: meator <meator.dev@gmail.com>
Date: Fri, 22 Jul 2022 19:35:48 +0200
Subject: [PATCH 7/7] ncurses: Resolve conflicts with -terminfo packages

ncurses-term provides terminfo entries only for terminals which don't
have their own -terminfo subackage now.

This also replaces the remove-foot.patch with rm in post_install() to
make handling of terminfo conflicts consistent.
---
 srcpkgs/ncurses/patches/remove-foot.patch | 64 -----------------------
 srcpkgs/ncurses/template                  | 10 +++-
 2 files changed, 9 insertions(+), 65 deletions(-)
 delete mode 100644 srcpkgs/ncurses/patches/remove-foot.patch

diff --git a/srcpkgs/ncurses/patches/remove-foot.patch b/srcpkgs/ncurses/patches/remove-foot.patch
deleted file mode 100644
index 0328c5c4dad8..000000000000
--- a/srcpkgs/ncurses/patches/remove-foot.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff -ruN ncurses-6.3_orig/misc/terminfo.src ncurses-6.3/misc/terminfo.src
---- ncurses-6.3_orig/misc/terminfo.src	2022-05-17 17:22:53.886017351 +0200
-+++ ncurses-6.3/misc/terminfo.src	2022-05-17 17:23:31.941720306 +0200
-@@ -7627,60 +7627,6 @@
- 
- ######## WAYLAND CLIENTS
- 
--#### Foot
--# https://codeberg.org/dnkl/foot/
--# Version 1.8.2
--#
--# This identifies as a VT220 with 4=sixel and 22=color, however:
--# tack:
--#	bell does not work
--#	status-line does not work because foot does not set the window title
--#	sends escape when meta key is used, whether or not smm/rmm enabled
--# vttest:
--#	wrap-test fails
--#	no application-mode for numeric keypad (unless private mode 1035 is set)
--#	no NRCS
--#	no VT52
--#	no SRM
--#	protected areas do not work
--#	SU/SD work, SL/SR do not
--#	DECRPM responds, but not the corresponding ANSI reports.
--#	otherwise few reports, except cursor-position and mouse and some dtterm
--#	VT520 cursor-movement works, except for left/right margins
--#	supports xterm/DECSCUSR, though default case in vttest does not blink
--#		Send: <27> [ 0 <32> q 
--#		Text: The cursor should be a blinking rectangle
--#	partial support for xterm mouse any-event mode and button-event mode:
--#	+ does not report focus-in/focus-out
--#	+ does not report buttons 6/7
--#	alternate-screen works
--foot|foot terminal emulator,
--	oc=\E]104\E\\, use=xterm+256color2, use=foot+base,
--
--foot-direct|foot with direct color indexing,
--	use=xterm+direct, use=foot+base,
--
--foot+base|foot base fragment,
--	am, bce, bw, hs, mir, msgr, npc, xenl, AX, XT,
--	cols#80, it#8, lines#24,
--	acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
--	bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[2J, cr=\r,
--	cub1=^H, cud1=\n, dim=\E[2m, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
--	el1=\E[1K, flash=\E]555\E\\, ind=\n, invis=\E[8m,
--	is2=\E[!p\E[?3;4l\E[4l\E>, kbs=^?, kcbt=\E[Z,
--	oc=\E]104\E\\, op=\E[39;49m, rev=\E[7m, ri=\EM, rmacs=\E(B,
--	rmam=\E[?7l, rmkx=\E[?1l\E>, rmso=\E[27m, rmul=\E[24m,
--	rs1=\Ec, rs2=\E[!p\E[?3;4l\E[4l\E>,
--	sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;
--	    %?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
--	sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smkx=\E[?1h\E=,
--	smso=\E[7m, smul=\E[4m, E3=\E[3J, use=att610+cvis,
--	use=ansi+csr, use=ansi+cup, use=ansi+enq, use=ansi+local,
--	use=ansi+idc, use=ansi+idl, use=ansi+rca2, use=ansi+rep,
--	use=ansi+tabs, use=ecma+index, use=ecma+italics,
--	use=ecma+strikeout, use=xterm+alt+title,
--	use=xterm+pcfkeys, use=xterm+sm+1006, use=xterm+tmux2,
--
- ######## WEB CLIENTS
- 
- #### DomTerm
diff --git a/srcpkgs/ncurses/template b/srcpkgs/ncurses/template
index 8386760db22f..7a56c537bf2e 100644
--- a/srcpkgs/ncurses/template
+++ b/srcpkgs/ncurses/template
@@ -1,7 +1,7 @@
 # Template file for 'ncurses'
 pkgname=ncurses
 version=6.3
-revision=2
+revision=3
 bootstrap=yes
 configure_args="--enable-big-core"
 short_desc="System V Release 4.0 curses emulation library"
@@ -97,6 +97,14 @@ do_install() {
 	fi
 }
 
+post_install() {
+	# resolve conflict with *-terminfo packages
+	rm ${DESTDIR}/usr/share/terminfo/a/alacritty{,-direct}
+	rm ${DESTDIR}/usr/share/terminfo/d/dvtm{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/s/st{,-256color}
+	rm ${DESTDIR}/usr/share/terminfo/f/foot{,-direct,+base}
+}
+
 ncurses-libs_package() {
 	short_desc+=" -- shared libraries"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (22 preceding siblings ...)
  2022-10-01 16:45 ` [PR PATCH] [Updated] " meator
@ 2022-10-01 16:48 ` meator
  2022-10-01 21:51 ` [PR PATCH] [Merged]: " classabbyamp
  24 siblings, 0 replies; 26+ messages in thread
From: meator @ 2022-10-01 16:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by meator on void-packages repository

https://github.com/void-linux/void-packages/pull/38179#issuecomment-1264417440

Comment:
It isn't. The `rm` should be equivalent to the patch. Thanks for pointing that out!

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PR PATCH] [Merged]: Compile terminfo description when building
  2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
                   ` (23 preceding siblings ...)
  2022-10-01 16:48 ` meator
@ 2022-10-01 21:51 ` classabbyamp
  24 siblings, 0 replies; 26+ messages in thread
From: classabbyamp @ 2022-10-01 21:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

There's a merged pull request on the void-packages repository

Compile terminfo description when building
https://github.com/void-linux/void-packages/pull/38179

Description:
Some `*-terminfo` packages do not actually provide compiled terminal descriptions, but only the source file. They then have to compile it with `tic` in `INSTALL` and then remove in in `REMOVE`. This approach is more complicated, adds `ncurses` (the provider of `tic`) as a runtime dependency of these packages and it has to explicitly specify completions to remove from `/usr/share/terminfo` (I've already had to add missing ones to `st-terminfo` in #33116 because some were missing).

As far as I know this approach doesn't have any advantages over just compiling the terminfo files and then shipping them in the package. If compiling these files "locally" has some purpose than please comment here and explain.

The presence of terminfo files that haven't been compiled in `/usr/share/terminfo` can also confuse some programs. For example when I install all packages which this PR modifies and then run `toe > /dev/null`, it shows:
```
toe: couldn't open terminfo file xst.terminfo.
toe: couldn't open terminfo file st.terminfo.
toe: couldn't open terminfo file rxvt-unicode.terminfo.
toe: couldn't open terminfo file mtm.ti.
toe: couldn't open terminfo file dvtm.info.
toe: couldn't open terminfo file alacritty.info.
```

I've also tried to simplify the templates I've been working with and I've adopted `st` because I'm an active user of it. And does `st` really depend on `ncurses`? I didn't want to mess with this but it could be possible that this dependency was added because of terminfo generation before `st` and `st-terminfo` were separate packages.

Ping @thypon (maintainer of `alacritty`)
Ping @travankor (maintainer of `mtm`)
Ping @leahneukirchen (maintainer of `rxvt-unicode`)
Ping @ndowens (maintainer of `xst`)
Ping @erwin

#### Testing the changes
- I tested the changes in this PR: **briefly**

closes #34392

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-10-01 21:51 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 22:04 [PR PATCH] Compile terminfo description when building meator
2022-07-21 22:11 ` [PR PATCH] [Updated] " meator
2022-07-22  5:27 ` meator
2022-07-22  5:47 ` meator
2022-07-22  5:51 ` classabbyamp
2022-07-22  7:25 ` meator
2022-07-22 13:53 ` paper42
2022-07-22 13:54 ` paper42
2022-07-22 17:39 ` [PR PATCH] [Updated] " meator
2022-07-22 17:41 ` meator
2022-07-22 17:41 ` meator
2022-07-22 17:48 ` meator
2022-07-22 17:57 ` [PR PATCH] [Updated] " meator
2022-07-22 17:59 ` meator
2022-07-23 15:08 ` sgn
2022-07-23 21:02 ` [PR PATCH] [Updated] " meator
2022-09-30  0:28 ` classabbyamp
2022-09-30 17:20 ` meator
2022-09-30 17:21 ` [PR PATCH] [Updated] " meator
2022-09-30 20:12 ` classabbyamp
2022-09-30 20:14 ` classabbyamp
2022-10-01 13:08 ` [PR PATCH] [Updated] " meator
2022-10-01 16:21 ` classabbyamp
2022-10-01 16:45 ` [PR PATCH] [Updated] " meator
2022-10-01 16:48 ` meator
2022-10-01 21:51 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).