I'd be interested in the output of cmake, in particular, if it displays the message "Falling back to pkg-config for (n)curses detection" - if not, that's why the pkg-config attempt doesn't work. Possibly the configure check should try pkgconfig first, though I'm not sure if that will work on systems that don't have it installed.
Setting the CMAKE_SYSTEM_PREFIX_PATH should do the job, so that might be worth investigating.
-- The C compiler identification is GNU 5.5.0
-- The CXX compiler identification is GNU 5.5.0
-- Check for working C compiler: /home/utils/gcc-5.5.0/bin/gcc
-- Check for working C compiler: /home/utils/gcc-5.5.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/utils/gcc-5.5.0/bin/g++
-- Check for working CXX compiler: /home/utils/gcc-5.5.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Falling back to pkg-config for (n)curses detection
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- Checking for one of the modules 'ncurses;curses'
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- The following OPTIONAL packages have not been found:
I do see this in CMakeCache.txt, so it looks like pkgconfig finds ncurses.
//Path to a library.
I've been running into this myself. If I'm working on a server where I'm not an administrator, sometimes it's easiest to just build ncurses and fish-shell from source. #5466 might be related, not sure.
# install prereqsRUN apk update \
&& apk add git g++ make cmake
# build and install ncurses (to nonstandard prefix)RUN wget ftp://ftp.invisible-island.net/ncurses/ncurses-6.2.tar.gz
RUN tar xf ncurses-6.2.tar.gz
RUN cd ncurses-6.2 \
&& ./configure --prefix=/ncurses-prefix \
&& make -j$nthreads install
# build fish# (clone the fish-shell repo alongside this Dockerfile)COPY fish-shell fish-shell
RUN cd fish-shell \
&& cmake . -DCMAKE_PREFIX_PATH=/ncurses-prefix \
&& make -j$nthreads install
The resulting error is
/fish-shell/src/builtin_set_color.cpp:12:10: fatal error: ncurses/curses.h: No such file or directory
12 | #include <ncurses/curses.h>
I have no local /usr installation of ncurses with development files. It is in a non-standard location.
If I set PKG_CONFIG_PATH to have the ncurses pkgconfig dir, ncurses is not found.
I also tried setting PATH so ncurses5-config could be found.
So I set
And then ncurses is found in the path that I expect.
However, it does not seem that the include path gets added to the build, I encounter this error when building:
So additionally I am setting CFLAGS/CXXFLAGS
(the files here in "include" are links to "include/ncursesw" files)
In the end the build looks something like:
But ideally I would not have to set the CFLAGS/CXXFLAGS.
The text was updated successfully, but these errors were encountered: