[drone] build without static libs on debian

This commit is contained in:
nick black 2021-12-11 22:14:45 -05:00
parent 2e745ba753
commit b13d27a058
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
7 changed files with 33 additions and 24 deletions

View File

@ -11,7 +11,7 @@ steps:
- export TERM=xterm - export TERM=xterm
- mkdir build - mkdir build
- cd build - cd build
- cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_GPM=on -DUSE_QRCODEGEN=on -DDFSG_BUILD=on - cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_STATIC=off -DUSE_GPM=on -DUSE_QRCODEGEN=on -DDFSG_BUILD=on
- make -j2 - make -j2
- ./notcurses-info - ./notcurses-info
- ctest --output-on-failure - ctest --output-on-failure

View File

@ -637,15 +637,15 @@ target_link_libraries(nctetris
endif() endif()
############################################################################ ############################################################################
# ncman # tfman
if(NOT WIN32) if(NOT WIN32)
file(GLOB NCMANSRCS CONFIGURE_DEPENDS src/man/*.c) file(GLOB tfmanSRCS CONFIGURE_DEPENDS src/man/*.c)
add_executable(ncman ${NCMANSRCS} ${COMPATSRC}) add_executable(tfman ${tfmanSRCS} ${COMPATSRC})
target_compile_definitions(ncman target_compile_definitions(tfman
PRIVATE PRIVATE
_GNU_SOURCE _GNU_SOURCE
) )
target_include_directories(ncman target_include_directories(tfman
BEFORE BEFORE
PRIVATE PRIVATE
include include
@ -655,7 +655,7 @@ target_include_directories(ncman
"${libdeflate_INCLUDE_DIRS}" "${libdeflate_INCLUDE_DIRS}"
"${ZLIB_INCLUDE_DIRS}" "${ZLIB_INCLUDE_DIRS}"
) )
target_link_libraries(ncman target_link_libraries(tfman
PRIVATE PRIVATE
notcurses-core notcurses-core
"${libdeflate}" "${libdeflate}"
@ -988,7 +988,7 @@ install(TARGETS notcurses-demo DESTINATION bin)
install(TARGETS notcurses-info DESTINATION bin) install(TARGETS notcurses-info DESTINATION bin)
install(TARGETS ncneofetch DESTINATION bin) install(TARGETS ncneofetch DESTINATION bin)
if(NOT WIN32) if(NOT WIN32)
install(TARGETS ncman DESTINATION bin) install(TARGETS tfman DESTINATION bin)
endif() endif()
if(${USE_CXX}) if(${USE_CXX})
install(TARGETS notcurses-input DESTINATION bin) install(TARGETS notcurses-input DESTINATION bin)

View File

@ -140,7 +140,6 @@ others are external.
Nine binaries are installed as part of Notcurses: Nine binaries are installed as part of Notcurses:
* `ncls`: an `ls` that displays multimedia in the terminal * `ncls`: an `ls` that displays multimedia in the terminal
* `ncman`: a fancy manual browser
* `ncneofetch`: a [neofetch](https://github.com/dylanaraps/neofetch) ripoff * `ncneofetch`: a [neofetch](https://github.com/dylanaraps/neofetch) ripoff
* `ncplayer`: renders visual media (images/videos) * `ncplayer`: renders visual media (images/videos)
* `nctetris`: a tetris clone * `nctetris`: a tetris clone
@ -148,6 +147,7 @@ Nine binaries are installed as part of Notcurses:
* `notcurses-info`: detect and print terminal capabilities/diagnostics * `notcurses-info`: detect and print terminal capabilities/diagnostics
* `notcurses-input`: decode and print keypresses * `notcurses-input`: decode and print keypresses
* `notcurses-tester`: unit testing * `notcurses-tester`: unit testing
* `tfman`: a fancy manual browser
To run `notcurses-demo` from a checkout, provide the `data` directory via To run `notcurses-demo` from a checkout, provide the `data` directory via
the `-p` argument. Demos requiring data files will otherwise abort. The base the `-p` argument. Demos requiring data files will otherwise abort. The base

View File

@ -42,7 +42,6 @@
<a href="notcurses.3.html">notcurses(3)</a>—a blingful TUI library<br/> <a href="notcurses.3.html">notcurses(3)</a>—a blingful TUI library<br/>
<h3>Executables (section 1)</h3> <h3>Executables (section 1)</h3>
<a href="ncls.1.html">ncls</a>—list files, displaying multimedia along with them<br/> <a href="ncls.1.html">ncls</a>—list files, displaying multimedia along with them<br/>
<a href="ncman.1.html">ncman</a>—swank man page browser<br/>
<a href="ncneofetch.1.html">ncneofetch</a>—generate low-effort posts for r/unixporn<br/> <a href="ncneofetch.1.html">ncneofetch</a>—generate low-effort posts for r/unixporn<br/>
<a href="ncplayer.1.html">ncplayer</a>—renders images and video to a terminal<br/> <a href="ncplayer.1.html">ncplayer</a>—renders images and video to a terminal<br/>
<a href="nctetris.1.html">nctetris</a>—Tetris in a terminal<br/> <a href="nctetris.1.html">nctetris</a>—Tetris in a terminal<br/>
@ -52,6 +51,7 @@
<a href="notcurses-tester.1.html">notcurses-tester</a>—unit test driver<br/> <a href="notcurses-tester.1.html">notcurses-tester</a>—unit test driver<br/>
<a href="ncdirect-pydemo.1.html">ncdirect-pydemo</a>—validates the Python direct-mode wrappers<br/> <a href="ncdirect-pydemo.1.html">ncdirect-pydemo</a>—validates the Python direct-mode wrappers<br/>
<a href="notcurses-pydemo.1.html">notcurses-pydemo</a>—validates the Python wrappers<br/> <a href="notcurses-pydemo.1.html">notcurses-pydemo</a>—validates the Python wrappers<br/>
<a href="tfman.1.html">tfman</a>—swank man page browser<br/>
<h3>C library (section 3)</h3> <h3>C library (section 3)</h3>
<a href="notcurses_capabilities.3.html">notcurses_capabilities</a>—runtime capability detection<br/> <a href="notcurses_capabilities.3.html">notcurses_capabilities</a>—runtime capability detection<br/>
<a href="notcurses_cell.3.html">notcurses_cell</a>—operations on <tt>nccell</tt> objects<br/> <a href="notcurses_cell.3.html">notcurses_cell</a>—operations on <tt>nccell</tt> objects<br/>

View File

@ -1,18 +1,18 @@
% ncman(1) % tfman(1)
% nick black <nickblack@linux.com> % nick black <nickblack@linux.com>
% v3.0.0 % v3.0.0
# NAME # NAME
ncman - Swank manual page browser tfman - Swank manual page browser
# SYNOPSIS # SYNOPSIS
**ncman** [**-h**] [**-V**] files **tfman** [**-h**] [**-V**] files
# DESCRIPTION # DESCRIPTION
**ncman** displays manual pages ala **man(1)** using the Notcurses **tfman** displays manual pages ala **man(1)** using the Notcurses
(**notcurses(3)**) terminal UI library. (**notcurses(3)**) terminal UI library.
# OPTIONS # OPTIONS
@ -27,6 +27,10 @@ The following keypresses are recognized:
* **Ctrl-L**: Redraw the screen. * **Ctrl-L**: Redraw the screen.
* **q**: Quit. * **q**: Quit.
* **k**/**up**: Move up by one line.
* **b**/**pgup**: Move up by one page.
* **j**/**down**: Move down by one line.
* **f**/**pgdown**: Move down by one page.
# NOTES # NOTES

View File

@ -1829,11 +1829,10 @@ ictx_independent_p(const inputctx* ictx){
} }
// try to lex a single control sequence off of buf. return the number of bytes // try to lex a single control sequence off of buf. return the number of bytes
// consumed if we do so, and -1 otherwise. buf is almost certainly *not* // consumed if we do so. otherwise, return the negative number of bytes
// NUL-terminated. if we are definitely *not* an escape, or we're unsure when // examined. set ictx->midescape if we're uncertain. we preserve a->used,
// we run out of input, return the negated relevant number of bytes, setting // a->state, etc. across runs to avoid reprocessing. buf is almost certainly
// ictx->midescape if we're uncertain. we preserve a->used, a->state, etc. // *not* NUL-terminated.
// across runs to avoid reprocessing.
// //
// our rule is: an escape must arrive as a single unit to be interpreted as // our rule is: an escape must arrive as a single unit to be interpreted as
// an escape. this is most relevant for Alt+keypress (Esc followed by the // an escape. this is most relevant for Alt+keypress (Esc followed by the
@ -1846,6 +1845,7 @@ static int
process_escape(inputctx* ictx, const unsigned char* buf, int buflen){ process_escape(inputctx* ictx, const unsigned char* buf, int buflen){
assert(ictx->amata.used < buflen); assert(ictx->amata.used < buflen);
while(ictx->amata.used < buflen){ while(ictx->amata.used < buflen){
fprintf(stderr, "AMATA USED: %u buflen: %d\n", ictx->amata.used, buflen);
unsigned char candidate = buf[ictx->amata.used++]; unsigned char candidate = buf[ictx->amata.used++];
unsigned used = ictx->amata.used; unsigned used = ictx->amata.used;
if(candidate >= 0x80){ if(candidate >= 0x80){
@ -1902,9 +1902,10 @@ process_escapes(inputctx* ictx, unsigned char* buf, int* bufused){
// if we aren't certain, that's not a control sequence unless we're at // if we aren't certain, that's not a control sequence unless we're at
// the end of the tbuf, in which case we really do try reading more. if // the end of the tbuf, in which case we really do try reading more. if
// this was not a sequence, we'll catch it on the next read. // this was not a sequence, we'll catch it on the next read.
fprintf(stderr, "ESCAPE PROC: %d %d %d MID: %u\n", *bufused, consumed, offset, ictx->midescape);
if(consumed < 0){ if(consumed < 0){
int tavailable = sizeof(ictx->tbuf) - (offset + *bufused - consumed); int tavailable = sizeof(ictx->tbuf) - (offset + *bufused - consumed);
// if midescape is not set, the negative return menas invalid escape. if // if midescape is not set, the negative return means invalid escape. if
// there was space available, we needn't worry about this escape having // there was space available, we needn't worry about this escape having
// been broken across distinct reads. in either case, replay it to the // been broken across distinct reads. in either case, replay it to the
// bulk input buffer; our automaton will have been reset. // bulk input buffer; our automaton will have been reset.
@ -1919,15 +1920,17 @@ process_escapes(inputctx* ictx, unsigned char* buf, int* bufused){
memcpy(ictx->ibuf + ictx->ibufvalid, buf + offset, available); memcpy(ictx->ibuf + ictx->ibufvalid, buf + offset, available);
ictx->ibufvalid += available; ictx->ibufvalid += available;
} }
*bufused -= consumed;
offset += consumed; offset += consumed;
ictx->midescape = 0; ictx->midescape = 0;
*bufused -= consumed;
}else{ }else{
break; break;
} }
} }
fprintf(stderr, "TIME FOR BIG SUB %d - %d -> %d : %d\n", *bufused, consumed, *bufused - consumed, offset);
*bufused -= consumed; *bufused -= consumed;
offset += consumed; offset += consumed;
assert(0 <= *bufused);
} }
// move any leftovers to the front; only happens if we fill output queue, // move any leftovers to the front; only happens if we fill output queue,
// or ran out of input data mid-escape // or ran out of input data mid-escape
@ -2093,7 +2096,9 @@ process_ibuf(inputctx* ictx){
if(ictx->tbufvalid){ if(ictx->tbufvalid){
// we could theoretically do this in parallel with process_bulk, but it // we could theoretically do this in parallel with process_bulk, but it
// hardly seems worthwhile without breaking apart the fetches of input. // hardly seems worthwhile without breaking apart the fetches of input.
fprintf(stderr, "TBUFVALID: %u\n", ictx->tbufvalid);
process_escapes(ictx, ictx->tbuf, &ictx->tbufvalid); process_escapes(ictx, ictx->tbuf, &ictx->tbufvalid);
fprintf(stderr, "TBUFVALIDPOST: %u\n", ictx->tbufvalid);
} }
if(ictx->ibufvalid){ if(ictx->ibufvalid){
if(ictx_independent_p(ictx)){ if(ictx_independent_p(ictx)){

View File

@ -32,7 +32,7 @@ parse_args(int argc, char** argv){
case 'h': usage(argv0, stdout); case 'h': usage(argv0, stdout);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
break; break;
case 'V': fprintf(stderr, "ncman version %s\n", notcurses_version()); case 'V': fprintf(stderr, "%s version %s\n", argv[0], notcurses_version());
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
break; break;
default: usage(argv0, stderr); default: usage(argv0, stderr);
@ -956,7 +956,7 @@ done:
} }
static int static int
ncman(struct notcurses* nc, const char* arg){ tfman(struct notcurses* nc, const char* arg){
int r = manloop(nc, arg); int r = manloop(nc, arg);
return r; return r;
} }
@ -975,7 +975,7 @@ int main(int argc, char** argv){
bool success; bool success;
for(int i = 0 ; i < argc - nonopt ; ++i){ for(int i = 0 ; i < argc - nonopt ; ++i){
success = false; success = false;
if(ncman(nc, argv[nonopt + i])){ if(tfman(nc, argv[nonopt + i])){
break; break;
} }
success = true; success = true;