From f5dd18d50c2c3cc2fd7bb0984080c93c54c8aa8b Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Thu, 8 Jul 2021 15:13:06 -0400 Subject: [PATCH] ncurses, dvtm: reduce size of terminfo db --- core/ncurses/build | 39 ++++ core/ncurses/checksums | 1 + core/ncurses/sources | 1 + core/ncurses/version | 1 + extra/dvtm/build | 2 - extra/dvtm/patches/terminfo.patch | 295 ------------------------------ extra/dvtm/sources | 1 - 7 files changed, 42 insertions(+), 298 deletions(-) create mode 100755 core/ncurses/build create mode 100644 core/ncurses/checksums create mode 100644 core/ncurses/sources create mode 100644 core/ncurses/version delete mode 100644 extra/dvtm/patches/terminfo.patch diff --git a/core/ncurses/build b/core/ncurses/build new file mode 100755 index 0000000..ff59a7e --- /dev/null +++ b/core/ncurses/build @@ -0,0 +1,39 @@ +#!/bin/sh -e + +./configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --enable-pc-files \ + --disable-rpath-hack \ + --with-pkg-config-libdir=/usr/lib/pkgconfig \ + --with-shared \ + --enable-widec \ + --without-ada \ + --without-tests \ + --without-debug \ + --without-cxx-binding \ + --with-fallbacks=xterm,xterm-256color,dvtm,dvtm-256color,ansi,vt100,vt220 + +make +make DESTDIR="$1" install + +# Force ncurses to link against wide-character ncurses library. +for lib in ncurses form panel menu; do + rm -f "$1/usr/lib/lib${lib}.so" + printf '%s\n' "INPUT(-l${lib}w)" > "$1/usr/lib/lib${lib}.so" + chmod 755 "$1/usr/lib/lib${lib}.so" + ln -sf "lib${lib}w.a" "$1/usr/lib/lib${lib}.a" +done + +# Some packages look for libcurses instead of libncurses when building. +printf '%s\n' "INPUT(-lncursesw)" > "$1/usr/lib/libcursesw.so" +ln -s libncurses.so "$1/usr/lib/libcurses.so" + +# Fix pkgconfig file. +ln -s ncursesw.pc "$1/usr/lib/pkgconfig/ncurses.pc" + +rm -rf \ + "$1/usr/share/terminfo" \ + "$1/usr/bin/clear" \ + "$1/usr/bin/reset" + diff --git a/core/ncurses/checksums b/core/ncurses/checksums new file mode 100644 index 0000000..3d3b37b --- /dev/null +++ b/core/ncurses/checksums @@ -0,0 +1 @@ +30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d ncurses-6.2.tar.gz diff --git a/core/ncurses/sources b/core/ncurses/sources new file mode 100644 index 0000000..e1e0d6a --- /dev/null +++ b/core/ncurses/sources @@ -0,0 +1 @@ +https://ftp.gnu.org/gnu/ncurses/ncurses-6.2.tar.gz diff --git a/core/ncurses/version b/core/ncurses/version new file mode 100644 index 0000000..724191a --- /dev/null +++ b/core/ncurses/version @@ -0,0 +1 @@ +6.2 5 diff --git a/extra/dvtm/build b/extra/dvtm/build index b3b3a15..88032b7 100755 --- a/extra/dvtm/build +++ b/extra/dvtm/build @@ -1,6 +1,4 @@ #!/bin/sh -e -patch -p1 < terminfo.patch - make PREFIX=/usr make PREFIX=/usr DESTDIR="$1" install diff --git a/extra/dvtm/patches/terminfo.patch b/extra/dvtm/patches/terminfo.patch deleted file mode 100644 index de68162..0000000 --- a/extra/dvtm/patches/terminfo.patch +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - -0001-Decoupled-installation-of-terminfo-profile-from-make.patch — paste.sr.ht - - - - - - - -
-
- -
-
-
-
- -# - -0001-Decoupled-installation-of-terminfo-profile-from-make.patch - - - -rw-r--r-- - - - - - 2.7 KiB - - - - - View raw - - -
-
-
-
-
-
                                                                                
-
1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
-21
-22
-23
-24
-25
-26
-27
-28
-29
-30
-31
-32
-33
-34
-35
-36
-37
-38
-39
-40
-41
-42
-43
-44
-45
-46
-47
-48
-49
-50
-51
-52
-53
-54
-55
-56
-57
-58
-59
-60
-61
-62
-63
-64
-65
-66
-67
-68
-
From 36ae564dbeae08b761541790ae7cf69c75a690bf Mon Sep 17 00:00:00 2001
-From: Ariadna Vigo <arivigodr@gmail.com>
-Date: Sat, 27 Feb 2021 12:15:47 +0100
-Subject: [PATCH] Decoupled installation of terminfo profile from 'make
- install' target
-
-Installation of terminfo profiles is now left as a manual operation to
-the user's discretion. This fixes path issues: /usr/local/share/terminfo is not
-a standard search path location, according to terminfo(5). The only standard
-locations are /usr/share/terminfo and $HOME/.terminfo. The problem with the
-former is that it risks overwriting the dvtm profile files that some distros
-ship with their curses package (Arch Linux). The problem with the latter is
-that leaving TERMINFO blank on config.mk and running 'make install' as root
-(the usual case) may install the profiles under /root/.terminfo, which is
-incorrect. In other cases, as in Debian(-based) systems, the search paths are
-completely non-standard: Debian requires installing local, system-wide terminfo
-profiles under /etc/terminfo and has tic patched to do so when running as root.
-
-So, as many distros already include the profiles by themselves under curses,
-some use completely non-standard approaches to terminfo, and installation under
-$HOME/.terminfo is affected whether you use su or sudo, etc. The best approach
-to solve all these issues is to leave the decision to the user, so that tic
-does whatever the system wants it to do. Decoupling it from 'make install'
-makes it possible to run it as your regular user without any issues, installing
-the profile under $HOME/.terminfo for sure.
----
- Makefile  | 6 ++++--
- config.mk | 3 ---
- 2 files changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 818ca0a..0b84b5b 100644
---- a/Makefile
-+++ b/Makefile
-@@ -50,8 +50,10 @@ install: all
- 		sed -e "s/VERSION/${VERSION}/" < "$$m" >  "${DESTDIR}${MANPREFIX}/man1/$$m" && \
- 		chmod 644 "${DESTDIR}${MANPREFIX}/man1/$$m"; \
- 	done
-+
-+install-terminfo:
- 	@echo installing terminfo description
--	@TERMINFO=${TERMINFO} tic -s dvtm.info
-+	@tic -s dvtm.info
-
- uninstall:
- 	@for b in ${BIN}; do \
-@@ -61,4 +63,4 @@ uninstall:
- 	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
- 	@rm -f ${DESTDIR}${MANPREFIX}/man1/dvtm.1
-
--.PHONY: all clean dist install uninstall debug
-+.PHONY: all clean dist install install-terminfo uninstall debug
-diff --git a/config.mk b/config.mk
-index db25e8a..cd4d9f7 100644
---- a/config.mk
-+++ b/config.mk
-@@ -2,9 +2,6 @@
-
- PREFIX ?= /usr/local
- MANPREFIX = ${PREFIX}/share/man
--# specify your systems terminfo directory
--# leave empty to install into your home folder
--TERMINFO := ${DESTDIR}${PREFIX}/share/terminfo
-
- INCS = -I.
- LIBS = -lc -lutil -lncursesw
---
-2.32.0
-
-
-
-
- - - - \ No newline at end of file diff --git a/extra/dvtm/sources b/extra/dvtm/sources index dabbb45..1493352 100644 --- a/extra/dvtm/sources +++ b/extra/dvtm/sources @@ -1,2 +1 @@ https://git.sr.ht/~kaction/dvtm/archive/v0.15.1.tar.gz -patches/terminfo.patch -- 2.39.2