Created attachment 742854 [details] CMakeError.log, note line 661 Issue can be reproduced with swipl -g 'tty_size(X, Y).'. Seems like build process fails to detect both ncurses and tgetent during configure phase, which prevents TTY support from being compiled into swipl binary. CMakeError.log is in attachment.
We talked about this a bit on IRC in #gentoo-dev-help: [23:27:03] <tockitj> there is the line where it creates a small c file and tries to link it to use tgetent [23:28:11] <tockitj> /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -fno-strict-aliasing -DCHECK_FUNCTION_EXISTS=tgetent -Wl,-O1 -Wl,--as-needed CMakeFiles/cmTC_0c92b.dir/CheckFunctionExists.c.o -o cmTC_0c92b -ldl -lm -lrt -lcurses /usr/lib64/libform.so /usr/lib64/libgmp.so -lpthread [23:33:02] <@sam_> cmake/Config.cmake:199:check_function_exists(tgetent HAVE_TGETENT) [23:33:05] <@sam_> check_function_exists is old [23:34:05] <@sam_> it doesn't realise it needs to use -ltinfo to get tgetent [23:34:16] <@sam_> but it appears it's a pain to make check_function_exists work properly
Created attachment 743013 [details] ebuild that works on my box I have resolved this on my machine. Solution adds flags to CMake so it can detect split tinfo libs. I doubt my ebuild is production ready, but it might help dev that gets the ticket.
The way to test if tty_size works would be: `swipl -g 'tty_size(X, Y), write("TTY window size "), write(x: X), write(", "), write(y: Y), nl, halt.'`
Thanks for reporting this bug and taking the time to produce a fix. swi-prolog-8.2.4-r3 and swi-prolog-8.3.29-r1 have been included in git with the relevant fix.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5996630a9a0e15e32f629cbff295187b020ff510 commit 5996630a9a0e15e32f629cbff295187b020ff510 Author: Keri Harris <keri@gentoo.org> AuthorDate: 2021-10-10 18:56:07 +0000 Commit: Keri Harris <keri@gentoo.org> CommitDate: 2021-10-10 18:58:04 +0000 dev-lang/swi-prolog: use pkg-config to determine ncurses link flags Closes: https://bugs.gentoo.org/816144 Package-Manager: Portage-3.0.20, Repoman-3.0.2 Signed-off-by: Keri Harris <keri@gentoo.org> dev-lang/swi-prolog/swi-prolog-8.2.4-r3.ebuild | 127 +++++++++++++++++++++++ dev-lang/swi-prolog/swi-prolog-8.3.29-r1.ebuild | 128 ++++++++++++++++++++++++ 2 files changed, 255 insertions(+)
Created attachment 746349 [details] build.log Linking libswipl.so fails now ("undefined reference to `tgetnum'")
(In reply to jan Anja from comment #6) > Created attachment 746349 [details] > build.log > > Linking libswipl.so fails now ("undefined reference to `tgetnum'") I've made a modification to the ebuild to support building when as-needed has been defined in CFLAGS.