Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517270 - x11-misc/slim-1.3.6-r3 - In file included from .../work/slim-1.3.6/panel.cpp:15: /usr/include/X11/Xft/Xft.h:39:22: fatal error: ft2build.h: No such file or directory
Summary: x11-misc/slim-1.3.6-r3 - In file included from .../work/slim-1.3.6/panel.cpp:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ian Stakenvicius (RETIRED)
URL:
Whiteboard:
Keywords:
: 531730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-16 22:25 UTC by januszmk
Modified: 2014-12-05 21:02 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (file_517270.txt,14.04 KB, text/plain)
2014-07-16 22:27 UTC, januszmk
Details
emerge --info (file_517270.txt,5.61 KB, text/plain)
2014-07-16 22:28 UTC, januszmk
Details
CMakeCache.txt (CMakeCache.txt,32.07 KB, text/plain)
2014-07-17 21:59 UTC, januszmk
Details
slim-include_ft2build_path.patch (slim-include_ft2build_path.patch,408 bytes, patch)
2014-11-11 19:45 UTC, Tomáš Čech
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description januszmk 2014-07-16 22:25:42 UTC
Reproducible: Always
Comment 1 januszmk 2014-07-16 22:27:19 UTC
Created attachment 380848 [details]
build.log
Comment 2 januszmk 2014-07-16 22:28:38 UTC
Created attachment 380850 [details]
emerge --info
Comment 3 januszmk 2014-07-16 22:31:18 UTC
when trying to compile slim, I am getting /usr/include/X11/Xft/Xft.h:39:22: fatal error: ft2build.h: no such file or directory, while I have it in /usr/include/freetype{,2}/ft2build.h
Comment 4 januszmk 2014-07-16 22:33:40 UTC
dev-util/cmake-2.8.12.2-r1 was built with the following:
USE="ncurses qt4 -emacs (-qt5) -test" ABI_X86="64"
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-17 21:03:56 UTC
(In reply to januszmk from comment #3)
> when trying to compile slim, I am getting /usr/include/X11/Xft/Xft.h:39:22:
> fatal error: ft2build.h: no such file or directory, while I have it in
> /usr/include/freetype{,2}/ft2build.h

I have media-libs/freetype-2.4.11 putting ft2build.h in /usr/include/ directly.  

Since it's Xft.h that seems to need it, I'm thinking the issue is either with x11-libs/libXft or it's with freetype2's pkg-config file not being modified despite the change in the install location.

I expect you are seeing failures with other packages that depend on libXft as well?
Comment 6 januszmk 2014-07-17 21:19:26 UTC
> I expect you are seeing failures with other packages that depend on libXft
> as well?

no, I can emerge openbox or dmenu without a problem
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-17 21:22:05 UTC
I updated freetype to 2.5.3-r1, and ran another test -- with dev-util/cmake-2.8.12.2, the include path to ft2build.h is found and added just fine for me.

So this might also be a failure of the cmake version you have installed, if it's not setting FREETYPE_INCLUDE_DIR_ft2build properly.

Could you attach the ${WORKDIR}/slim-1.3.6_build/CMakeCache.txt file to confirm please?
Comment 8 januszmk 2014-07-17 21:59:35 UTC
Created attachment 380922 [details]
CMakeCache.txt
Comment 9 Ian Stakenvicius (RETIRED) gentoo-dev 2014-07-18 12:24:33 UTC
(In reply to januszmk from comment #8)
> Created attachment 380922 [details]
> CMakeCache.txt

So for freetype-2.5.3-r1, my cmake is reporting:

FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/include/freetype2
FREETYPE_INCLUDE_DIR_ft2build:PATH=/usr/include/freetype2

...while yours is reporting:

FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/include
FREETYPE_INCLUDE_DIR_ft2build:PATH=/usr/include/freetype2


Although this particular discrepancy seems backwards to the issue (and wrong according to your description of where files are installed), since right now slim only includes $FREETYPE_INCLUDE_DIR_freetype2 in the set of include paths it would cause the issue you are seeing.

I can add $FREETYPE_INCLUDE_DIR_ft2build to the list of default paths, but the actual breakage here is that FREETYPE_INCLUDE_DIR_freetype2 isn't being set by cmake to /usr/include/freetype2 as it should be.  

CC'ing KDE herd regarding cmake behaviour and to seek advice about the correct usage of the FREETYPE_INCLUDE_DIR_* vars.
Comment 10 Michael Palimaka (kensington) gentoo-dev 2014-07-18 18:38:23 UTC
CMake shouldn't be be setting the variable unless it actually finds what it's looking for.

Some ideas:
* Can you please confirm the version of freetype installed, including revision?
* Are there stray FindFreetype.cmake files on your system anywhere?
* What's the output of 'pkg-config --cflags xft'?
* What's the output of 'find /usr/include -name ftheader.h'?
Comment 11 januszmk 2014-07-18 20:12:49 UTC
(In reply to Michael Palimaka (kensington) from comment #10)
> CMake shouldn't be be setting the variable unless it actually finds what
> it's looking for.
> 
> Some ideas:
> * Can you please confirm the version of freetype installed, including
> revision?
media-libs/freetype-2.5.3-r1
> * Are there stray FindFreetype.cmake files on your system anywhere?
I don't see any
> * What's the output of 'pkg-config --cflags xft'?
pkg-config --cflags xft
-I/usr/include/freetype2 

> * What's the output of 'find /usr/include -name ftheader.h'?

find /usr/include -name ftheader.h
/usr/include/freetype2/config/ftheader.h
Comment 12 januszmk 2014-08-19 22:54:46 UTC
I have problems with others packages because of this, does someone have idea what can cause this? any good workarround for this?
Comment 13 Michael Palimaka (kensington) gentoo-dev 2014-10-31 15:53:12 UTC
(In reply to januszmk from comment #3)
> when trying to compile slim, I am getting /usr/include/X11/Xft/Xft.h:39:22:
> fatal error: ft2build.h: no such file or directory, while I have it in
> /usr/include/freetype{,2}/ft2build.h

You have /usr/include/freetype/ft2build.h too - which package owns it?
Comment 14 Drew Richardson 2014-11-02 13:50:56 UTC
I was able to duplicate this issue until I deleted the softlink /usr/include/freetype -> freetype2. After that slim rebuilt just fine. Not sure why the softlink from freetype to freetype2 exists, I may have added it manually at some point.
Comment 15 Tomáš Čech 2014-11-11 19:45:38 UTC
Created attachment 389116 [details, diff]
slim-include_ft2build_path.patch

This patch fixed my issue.
Comment 16 Tomáš Čech 2014-11-12 07:32:55 UTC
OK, I read rest of comments and I'm sorry for my obvious patch.

(In reply to Ian Stakenvicius from comment #7)
> I updated freetype to 2.5.3-r1, and ran another test -- with
> dev-util/cmake-2.8.12.2, the include path to ft2build.h is found and added
> just fine for me.

I reproduced the issue on freetype-2.5.3-r1 with cmake-2.8.12.2...
 
> So this might also be a failure of the cmake version you have installed, if
> it's not setting FREETYPE_INCLUDE_DIR_ft2build properly.

... so I don't think it is correct assumption.

(In reply to Drew Richardson from comment #14)
> I was able to duplicate this issue until I deleted the softlink
> /usr/include/freetype -> freetype2. After that slim rebuilt just fine. Not
> sure why the softlink from freetype to freetype2 exists, I may have added it
> manually at some point.

Removing symlink fixed the issue for me as well... Still, I feel better adding path to fix the issue in slim than preventing some other package from finding headers where are expected...

I found this file as part of cmake package - /usr/share/cmake/Modules/FindFreetype.cmake. On the top of it there is:
# - Locate FreeType library
# This module defines
#  FREETYPE_LIBRARIES, the library to link against
#  FREETYPE_FOUND, if false, do not try to link to FREETYPE
#  FREETYPE_INCLUDE_DIRS, where to find headers.
#  FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
#  This is the concatenation of the paths:
#  FREETYPE_INCLUDE_DIR_ft2build
#  FREETYPE_INCLUDE_DIR_freetype2

I believe that intended use here was FREETYPE_INCLUDE_DIRS instead of using FREETYPE_INCLUDE_DIR_* separately. This patches fixes the issue as well and I believe it is even correct.

--- ./CMakeLists.txt.orig       2014-11-12 08:31:40.627367327 +0100
+++ ./CMakeLists.txt    2014-11-12 08:31:50.097367160 +0100
@@ -165,7 +165,7 @@ include_directories(
        ${X11_Xft_INCLUDE_PATH}
        ${X11_Xrender_INCLUDE_PATH}
        ${X11_Xrandr_INCLUDE_PATH}
-       ${FREETYPE_INCLUDE_DIR_freetype2}
+       ${FREETYPE_INCLUDE_DIRS}
        ${X11_Xmu_INCLUDE_PATH}
        ${ZLIB_INCLUDE_DIR}
        ${JPEG_INCLUDE_DIR}
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-05 08:00:23 UTC
*** Bug 531730 has been marked as a duplicate of this bug. ***
Comment 18 Ian Stakenvicius (RETIRED) gentoo-dev 2014-12-05 21:02:24 UTC
OK this has been open long enough; still think the issue is with this dangling symlink, but it's an easy enough workaround and it shouldn't break anything...


+  05 Dec 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org>
+  +files/slim-1.3.6-freetype.patch, slim-1.3.6-r3.ebuild, slim-1.3.6-r4.ebuild:
+  fixed CMakeLists.txt to include all freetype headers, bug 517270
+