Skip to content

Commit 1e8221e

Browse files
committed
[libterminfo] add a terminfo parser so we can remove the ncurses dependency completely
1 parent 1f3ae82 commit 1e8221e

33 files changed

Lines changed: 1316 additions & 634 deletions

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ jobs:
1010
resource_class: macos.m1.medium.gen1
1111
steps:
1212
- checkout
13-
- run: brew install pcre2 sqlite ncurses xz zstd libarchive curl autoconf automake libunistring coreutils
13+
- run: brew install pcre2 sqlite xz zstd libarchive curl autoconf automake libunistring coreutils
1414
- run: ./autogen.sh
1515
- run: >-
1616
./configure \
1717
--prefix=/usr/local \
1818
--with-libcurl=$(brew --prefix curl) \
1919
--with-pcre2=$(brew --prefix pcre2) \
2020
--with-sqlite3=$(brew --prefix sqlite3) \
21-
"CPPFLAGS=-I$(brew --prefix ncurses)/include -I$(brew --prefix libunistring)/include" \
21+
"CPPFLAGS=-I$(brew --prefix libunistring)/include" \
2222
"CXXFLAGS=-g2 -O2" \
2323
'CFLAGS=-O2 -g2' \
24-
"LDFLAGS=-L$(brew --prefix ncurses)/lib -L$(brew --prefix xz)/lib -L$(brew --prefix lz4)/lib -L$(brew --prefix zstd)/lib/ -L$(brew --prefix libunistring)/lib/" \
24+
"LDFLAGS=-L$(brew --prefix xz)/lib -L$(brew --prefix lz4)/lib -L$(brew --prefix zstd)/lib/ -L$(brew --prefix libunistring)/lib/" \
2525
--with-libarchive=$(brew --prefix libarchive) \
2626
|| cat config.log
2727
- run: make -j2 || true

.github/workflows/bins.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ jobs:
156156
- name: checkout
157157
uses: actions/checkout@v3
158158
- name: install packages
159-
run: brew install pcre2 sqlite ncurses xz zstd lz4 libarchive curl autoconf automake libunistring
159+
run: brew install pcre2 sqlite xz zstd lz4 libarchive curl autoconf automake libunistring
160160
- name: autogen
161161
run: ./autogen.sh
162162
- name: configure
@@ -165,10 +165,10 @@ jobs:
165165
--with-libcurl=/usr \
166166
--with-pcre2=$(brew --prefix pcre2) \
167167
--with-sqlite3=$(brew --prefix sqlite3) \
168-
"CPPFLAGS=-I$(brew --prefix libunistring)/include -I$(brew --prefix ncurses)/include" \
168+
"CPPFLAGS=-I$(brew --prefix libunistring)/include" \
169169
"CXXFLAGS=-g2 -O2" \
170170
'CFLAGS=-O2 -g2' \
171-
"LDFLAGS=-L$(brew --prefix ncurses)/lib -L$(brew --prefix xz)/lib -L$(brew --prefix zstd)/lib/ -L$(brew --prefix lz4)/lib/ -L$(brew --prefix libunistring)/lib" \
171+
"LDFLAGS=-L$(brew --prefix xz)/lib -L$(brew --prefix zstd)/lib/ -L$(brew --prefix lz4)/lib/ -L$(brew --prefix libunistring)/lib" \
172172
--with-libarchive=$(brew --prefix libarchive) \
173173
"LIBS=-llzma -lexpat -lzstd -liconv -llz4 -lbz2 -lz -lpcre2-8"
174174
- name: make
@@ -242,7 +242,6 @@ jobs:
242242
msys/liblzma-devel
243243
msys/libsqlite-devel
244244
msys/libunistring-devel
245-
msys/ncurses-devel
246245
msys/pcre2-devel
247246
msys/zlib-devel
248247
- name: "🔧 Generate and configure"
@@ -257,7 +256,7 @@ jobs:
257256
../lnav/configure \
258257
--enable-static \
259258
LDFLAGS="-static" \
260-
CPPFLAGS="-O2 -DNCURSES_STATIC" \
259+
CPPFLAGS="-O2" \
261260
CXXFLAGS="-fPIC" \
262261
CFLAGS="-fPIC" \
263262
LIBS="-larchive -lssh2 -llzma -lexpat -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon -lcrypt32" \

.github/workflows/c-cpp.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Update apt
2121
run: sudo apt-get update
2222
- name: Install packages
23-
run: sudo apt-get install libncursesw5-dev libsqlite3-dev libbz2-dev libcurl4-openssl-dev zlib1g-dev lcov libunistring-dev
23+
run: sudo apt-get install libsqlite3-dev libbz2-dev libcurl4-openssl-dev zlib1g-dev lcov libunistring-dev
2424
- name: install cpp-coveralls
2525
run: pip install --user cpp-coveralls
2626
- name: autogen
@@ -72,7 +72,6 @@ jobs:
7272
autoconf
7373
g++
7474
libpcre2-dev
75-
libncurses-dev
7675
libsqlite3-dev
7776
libbz2-dev
7877
libcurl4-openssl-dev

.github/workflows/coverity.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
autoconf
3434
g++
3535
libpcre2-dev
36-
libncurses-dev
3736
libsqlite3-dev
3837
libbz2-dev
3938
libcurl4-openssl-dev

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ jobs:
6363
g++
6464
libpcre2-dev
6565
libpcre3-dev
66-
libncurses-dev
6766
libsqlite3-dev
6867
libbz2-dev
6968
libcurl4-openssl-dev

ARCHITECTURE.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ implemented in the [log_format_impls.cc](src/log_format_impls.cc) file.
9191
## User Interface
9292

9393
The lnav text-user-interface is built on top of
94-
[ncurses](https://invisible-island.net/ncurses/announce.html).
94+
[notcurses](https://notcurses.com).
9595
However, the higher-level functionality of panels, widgets, and such is not
96-
used. Instead, the following custom components are built on top of the ncurses
96+
used. Instead, the following custom components are built on top of the notcurses
9797
primitives:
9898

9999
- [view_curses](src/view_curses.hh) - Provides the basics for text roles, which
@@ -108,13 +108,6 @@ primitives:
108108
displays the logs/plaintext/help is a textview.
109109
- [statusview_curses](src/state-extension-functions.cc) - Draws the status bars
110110
at the top and bottom of the TUI.
111-
- [vt52_curses](src/vt52_curses.hh) - Adapts vt52 escape codes to the ncurses
112-
API.
113-
- [readline_curses](src/readline_curses.hh) - Provides access to the readline
114-
library. The readline code is executed in a child process since readline
115-
does not get along with ncurses. The child process and readline is set to
116-
use a vt52 terminal and the vt52_curses view is uses to translate those
117-
escape codes to ncurses.
118111

119112
The following diagram shows the underlying components that make up the TUI:
120113

README

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ The following software packages are required to build/run lnav:
2020
gcc/clang - A C++14-compatible compiler.
2121
libpcre2 - The Perl Compatible Regular Expression v2 (PCRE2) library.
2222
sqlite - The SQLite database engine. Version 3.9.0 or higher is required.
23-
ncurses - The ncurses text UI library.
2423
zlib - The zlib compression library.
2524
bz2 - The bzip2 compression library.
2625
re2c - The re2c scanner generator.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ The following software packages are required to build lnav:
176176
- gcc/clang - A C++14-compatible compiler.
177177
- libpcre2 - The Perl Compatible Regular Expression v2 (PCRE2) library.
178178
- sqlite - The SQLite database engine. Version 3.9.0 or higher is required.
179-
- ncurses - The ncurses text UI library.
180179
- zlib - The zlib compression library.
181180
- bz2 - The bzip2 compression library.
182181
- libcurl - The cURL library for downloading files from URLs. Version 7.23.0 or higher is required.

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
cygsetup: setup-x86_64.exe
88

99
install:
10-
- C:\%cygwin%\%cygsetup% -qnNdOX -R C:/%cygwin% -l C:/%cygwin%/var/cache/setup -P libpcre2-devel -P libncurses-devel -P libreadline-devel -P zlib-devel -P libbz2-devel -P libsqlite3-devel -P libcurl-devel -P libarchive-devel
10+
- C:\%cygwin%\%cygsetup% -qnNdOX -R C:/%cygwin% -l C:/%cygwin%/var/cache/setup -P libpcre2-devel -P libreadline-devel -P zlib-devel -P libbz2-devel -P libsqlite3-devel -P libcurl-devel -P libarchive-devel
1111

1212
build_script:
1313
- C:\%cygwin%\bin\sh -lc "uname -a && gcc --version && cd /cygdrive/c/projects/lnav && ./autogen.sh && ./configure && make && strip src/lnav.exe && ldd src/lnav.exe"

configure.ac

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,6 @@ AC_SEARCH_LIBS(backtrace, execinfo)
8686
AC_SEARCH_LIBS(uc_width, unistring, [], [AC_MSG_ERROR([libunistring required to build])])
8787
LIBCURL_CHECK_CONFIG([], [7.23.0], [], [AC_MSG_ERROR([libcurl required to build])], [test x"${enable_static}" = x"yes"])
8888

89-
# Sometimes, curses depends on these libraries being linked in...
90-
AC_ARG_ENABLE([tinfo],
91-
AS_HELP_STRING([--disable-tinfo],
92-
[Disable linking with tinfo, enabled by default]),
93-
[], [enable_tinfo="yes"]
94-
)
95-
96-
AS_IF([test "x${enable_tinfo}" != "xno"],
97-
[dnl
98-
AC_MSG_NOTICE([Trying to link with tinfo])
99-
AC_SEARCH_LIBS(cur_term, [tinfow tinfo],
100-
AC_MSG_NOTICE([Linking with tinfo]),
101-
AC_MSG_WARN([libtinfo not found])
102-
)
103-
],
104-
AC_MSG_NOTICE([Building with tinfo linking disabled])
105-
)
106-
10789
dnl libgpm is required on some systems where there is a misconfigured ncurses
10890
dnl and gpm libraries with interdependencies. This check is not required on OS X.
10991
AS_CASE(["$host_os"],
@@ -145,12 +127,6 @@ AS_IF([test "x$with_system_doctest" != "xyes"], [
145127

146128
LNAV_WITH_JEMALLOC
147129

148-
AX_WITH_CURSES
149-
150-
AS_VAR_IF([ax_cv_curses],[yes],[],
151-
AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])dnl
152-
)
153-
154130
AX_PATH_LIB_ARCHIVE
155131
AX_CHECK_PCRE2([8], [], [AC_MSG_ERROR([pcre2 is required to build])])
156132

@@ -201,9 +177,9 @@ AC_DEFINE([_XOPEN_SOURCE_EXTENDED], [1], [Wide character support for ncurses])
201177
AS_VAR_SET(ALL_LDFLAGS, "$SQLITE3_LDFLAGS $LIBARCHIVE_LDFLAGS $LIBCURL $LDFLAGS")
202178

203179
AS_VAR_SET(static_lib_list,
204-
["libncurses.a libncursesw.a libsqlite3.a libz.a libtinfo.a libtinfow.a"])
180+
["libsqlite3.a libz.a"])
205181
AS_VAR_SET(static_lib_list,
206-
["$static_lib_list libpcre2-8.a libncursesw.a libbz2.a"])
182+
["$static_lib_list libpcre2-8.a libbz2.a"])
207183
AS_VAR_SET(static_lib_list,
208184
["$static_lib_list libgpm.a libcurl.a libcrypto.a libssl.a libssh2.a"])
209185
AS_VAR_SET(static_lib_list,

0 commit comments

Comments
 (0)