-
-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use FindCurses instead of pkg_check_modules.
This should resolve #217.
- Loading branch information
1 parent
29f1c05
commit abd0be5
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abd0be5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like with this change issue #167 pops up again as FindCurses does not seem to handle a separate libtinfo :-(
See Gentoo bug for reference https://bugs.gentoo.org/648090
abd0be5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, any thoughts on how to handle this? How do other Gentoo packages deal with it?
abd0be5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially this seems to be a bug in FindCurses not handling this situation correctly. There must be a bug somewhere because when looking into it there is a check for tinfo. Funny this check was added after being detected by a Gentoo bug (https://gitlab.kitware.com/cmake/cmake/commit/1f646c6ce0766f8ab59868e7cac24034e6966504).
The Gentoo solution itself was to rely on pkg-config (https://bugs.gentoo.org/457530). However it seems that this approach does not work in any case. As I got it the problem is that ncurses made the installation of pkg-config files optional. Probably the reporter of this bug did use a distribution not shipping these files. For binary distributions these may not that useful anyway. On the contrary for source based distributions like Gentoo and when trying to build packages from source on a binary distribution this files are useful as this bug cleary shows.
The proper solution would be to check if either the ncurses or tinfo library provides a certain function. For autottools this seems to be the AC_SEARCH_LIBS macro (AC_SEARCH_LIBS([cbreak], [tinfo ncurses])) see comment 12 from the above Gentoo bug. There are also references of cbreak and tinfo in the FindCurses routine which also suggests that there is something wrong in FindCurses.
I see you have already defined AC_SEARCH_LIBS in cmake/Conky.cmake. Maybe you can make use of it here too. Or other native functions like CHECK_{LIBRARY,FUNCTION,SYMBOL}_EXISTS of cmake could be of help.
What I also don't know if conky only needs functionality from tinfo so if ncurses is built with a separate tinfo only linking to tinfo is required instead of linking to ncurses and tinfo.
abd0be5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the moment I reverted this change to use pkgconfig again and I actually suggest you to do the same.
Rationale is that I don't think FindCurses will be fixed very soon. There are already bugs [1], [2] open for some time but the developers don't seem to have the resources to fix this or do not really care.
So until this is not fixed properly in cmake it is probably easier to fix this on the distribution level by installing the pkg-config files or to convince the developers of ncurses to install them by default.
[1] https://gitlab.kitware.com/cmake/cmake/issues/16354
[2] https://gitlab.kitware.com/cmake/cmake/issues/17405