Bug 130150 - [EFL][GTK] Get CMake to find Freetype2 properly
Summary: [EFL][GTK] Get CMake to find Freetype2 properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Thiago de Barros Lacerda
URL:
Keywords:
: 130107 (view as bug list)
Depends on: 130512
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-12 11:52 PDT by Thiago de Barros Lacerda
Modified: 2014-03-20 20:48 PDT (History)
12 users (show)

See Also:


Attachments
Patch (8.84 KB, patch)
2014-03-12 11:59 PDT, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff
Patch (11.13 KB, patch)
2014-03-18 14:48 PDT, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff
Fix for Fretype version>=2.5.1 (11.26 KB, patch)
2014-03-20 13:22 PDT, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff
Fix for Fretype version>=2.5.1 and putting version back to 2.4.2 (11.26 KB, patch)
2014-03-20 13:34 PDT, Thiago de Barros Lacerda
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago de Barros Lacerda 2014-03-12 11:52:41 PDT
Newer versions of CMake are not able to find Freetype2 correctly.
Comment 1 Thiago de Barros Lacerda 2014-03-12 11:59:19 PDT
Created attachment 226542 [details]
Patch
Comment 2 Martin Robinson 2014-03-12 11:59:56 PDT
*** Bug 130107 has been marked as a duplicate of this bug. ***
Comment 3 Martin Robinson 2014-03-12 12:01:46 PDT
Comment on attachment 226542 [details]
Patch

It should be possible to properly use the version information with pkgconfig. See FindGeoclue.cmake for how we have done this in WebKitGTK+.
Comment 4 Thiago de Barros Lacerda 2014-03-18 14:48:04 PDT
Created attachment 227113 [details]
Patch
Comment 5 Martin Robinson 2014-03-18 15:31:42 PDT
Comment on attachment 227113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227113&action=review

> Source/cmake/FindFreetype2.cmake:2
> +# Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies).
> +#

For the purposes of GTK+, it is just sufficient to look at the pkgconfig file. I don't know about EFL.

> Source/cmake/OptionsGTK.cmake:173
> -find_package(Freetype 2.4.2 REQUIRED)
> +find_package(Freetype2 2.4.11 REQUIRED)

I'm not sure I understand this change. You are raising the freetype dependency requirements. We cannot do that for GTK+ at least. My understanding of the situation is that the FreeType pkgconfig file lists the libtool version triple in it instead of the actual version. So here we need to figure out what the version listed in the FreeType 2.4.11 release is and then put that version here. It would also be good to put a comment explaining the situation.
Comment 6 Thiago de Barros Lacerda 2014-03-18 15:42:26 PDT
Comment on attachment 227113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227113&action=review

>> Source/cmake/FindFreetype2.cmake:2
>> +#
> 
> For the purposes of GTK+, it is just sufficient to look at the pkgconfig file. I don't know about EFL.

Huum... maybe you commented in the wrong line?

>> Source/cmake/OptionsGTK.cmake:173
>> +find_package(Freetype2 2.4.11 REQUIRED)
> 
> I'm not sure I understand this change. You are raising the freetype dependency requirements. We cannot do that for GTK+ at least. My understanding of the situation is that the FreeType pkgconfig file lists the libtool version triple in it instead of the actual version. So here we need to figure out what the version listed in the FreeType 2.4.11 release is and then put that version here. It would also be good to put a comment explaining the situation.

2.4.11 is the version that GTK (and also EFL) is using in jhbuild.modules. Looking at the original FindFreetype.cmake (usually in /usr/share/cmake<version>/Modules) I noticed that it searches for the version in the freetype.h header, which is the same of the package in jhbuild.modules, not that number that is in freetype2.pc file.
So we can use the version that is present in jhbuild.modules
Comment 7 Martin Robinson 2014-03-18 15:48:47 PDT
(In reply to comment #6)

> 2.4.11 is the version that GTK (and also EFL) is using in jhbuild.modules. Looking at the original FindFreetype.cmake (usually in /usr/share/cmake<version>/Modules) I noticed that it searches for the version in the freetype.h header, which is the same of the package in jhbuild.modules, not that number that is in freetype2.pc file.
> So we can use the version that is present in jhbuild.modules


Okay. That seems better. In this case we don't need to raise the dependency at all.
Comment 8 Gyuyoung Kim 2014-03-18 20:58:44 PDT
Comment on attachment 227113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227113&action=review

LGTM on EFL port side.

>>> Source/cmake/FindFreetype2.cmake:2
>>> +#
>> 
>> For the purposes of GTK+, it is just sufficient to look at the pkgconfig file. I don't know about EFL.
> 
> Huum... maybe you commented in the wrong line?

I'm not sure I understand what Martin said. It seems to me that Martin think we don't need to keep FindFreetype2.cmake. But, I think Changelog explains why FindFreetype2.cmake is needed, isn't it ?
Comment 9 Gyuyoung Kim 2014-03-18 20:59:43 PDT
Comment on attachment 227113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=227113&action=review

LGTM on EFL port side.

>>>> Source/cmake/FindFreetype2.cmake:2
>>>> +#
>>> 
>>> For the purposes of GTK+, it is just sufficient to look at the pkgconfig file. I don't know about EFL.
>> 
>> Huum... maybe you commented in the wrong line?
> 
> I'm not sure I understand what Martin said. It seems to me that Martin think we don't need to keep FindFreetype2.cmake. But, I think Changelog explains why FindFreetype2.cmake is needed, isn't it ?

I'm not sure I understand what Martin said. It seems to me that Martin think we don't need to keep FindFreetype2.cmake. But, I think Changelog explains why FindFreetype2.cmake is needed, isn't it ?
Comment 10 Gyuyoung Kim 2014-03-18 21:02:50 PDT
Comment on attachment 227113 [details]
Patch

LGTM on EFL port side.
Comment 11 Gyuyoung Kim 2014-03-18 21:10:00 PDT
(In reply to comment #10)
> (From update of attachment 227113 [details])
> LGTM on EFL port side.

Oops, sorry for duplicated comments. My internet connection was weird for a while. :(
Comment 12 Thiago de Barros Lacerda 2014-03-19 06:01:24 PDT
(In reply to comment #11)
> (In reply to comment #10)
> > (From update of attachment 227113 [details] [details])
> > LGTM on EFL port side.
> 
> Oops, sorry for duplicated comments. My internet connection was weird for a while. :(

Looks like it is OK for both GTK and EFL. Who is going to r+? :)
Comment 13 Csaba Osztrogonác 2014-03-20 06:45:30 PDT
Comment on attachment 227113 [details]
Patch

r=me based on previous comments.
Comment 14 WebKit Commit Bot 2014-03-20 07:19:28 PDT
Comment on attachment 227113 [details]
Patch

Clearing flags on attachment: 227113

Committed r165962: <http://trac.webkit.org/changeset/165962>
Comment 15 WebKit Commit Bot 2014-03-20 07:19:35 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Martin Robinson 2014-03-20 08:13:07 PDT
This raised the Freetype2 dependency for GTK+ which is against our port policy. Why did it increase the version requirement?
Comment 17 Csaba Osztrogonác 2014-03-20 08:25:38 PDT
(In reply to comment #16)
> This raised the Freetype2 dependency for GTK+ which is against our port policy. Why did it increase the version requirement?

It didn' raise, GTK already uses 2.4.11 via jhbuild.modules
as you agreed previously in comment #7 .
Comment 18 Alberto Garcia 2014-03-20 08:28:35 PDT
The build is broken here since this patch:

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Freetype2 (missing: FREETYPE2_INCLUDE_DIRS) (Required is at
  least version "2.4.11")
Comment 19 Alberto Garcia 2014-03-20 08:31:35 PDT
The problem seems to be this one:

find_path(FREETYPE2_ROOT_INCLUDE_DIR
    NAMES freetype/freetype.h
    HINTS ${PC_FREETYPE2_INCLUDE_DIRS}
          ${PC_FREETYPE2_INCLUDEDIR}
)


There's no freetype/freetype.h since FreeType 2.5.1

See bug 125074
Comment 20 Martin Robinson 2014-03-20 08:32:05 PDT
(In reply to comment #17)

> It didn' raise, GTK already uses 2.4.11 via jhbuild.modules
> as you agreed previously in comment #7 .

This patch causes everyone compiling WebKitGTK+ to have a newer version of FreeType. The version of FreeType in the JHBuild module is the one that developers and the bots use for testing.
Comment 21 WebKit Commit Bot 2014-03-20 08:32:33 PDT
Re-opened since this is blocked by bug 130512
Comment 22 Martin Robinson 2014-03-20 08:33:46 PDT
(In reply to comment #17)
> (In reply to comment #16)
> > This raised the Freetype2 dependency for GTK+ which is against our port policy. Why did it increase the version requirement?
> 
> It didn' raise, GTK already uses 2.4.11 via jhbuild.modules
> as you agreed previously in comment #7 .

Ah, apologies about comment 7. I think we managed to talk past on another there. My conclusion was that we didn't need to raise the dependency.
Comment 23 Martin Robinson 2014-03-20 08:34:54 PDT
For the purposes of EFL and GTK+ can't we just accept the pkgconfig results? We are doing this for other packages. The only thing we need to do is to translate the versions to ones that are in the pkgconfig files.
Comment 24 Csaba Osztrogonác 2014-03-20 08:36:59 PDT
Sorry, I misundertood it, I thought you agreead about it. And I thought 
the version in jhbuild is the minimum required version. Good to know 
if it isn't. I rolled it out to unbreak the build.
Comment 25 Thiago de Barros Lacerda 2014-03-20 13:22:58 PDT
Created attachment 227323 [details]
Fix for Fretype version>=2.5.1
Comment 26 Thiago de Barros Lacerda 2014-03-20 13:25:25 PDT
As Ossy said, I did not raised the version of freetype, I just used the one that is present on jhbuild.
Anyway, I uploaded a new patch that is supposed to work with other versions. Can you guys check?
Comment 27 Martin Robinson 2014-03-20 13:28:54 PDT
Comment on attachment 227323 [details]
Fix for Fretype version>=2.5.1

View in context: https://bugs.webkit.org/attachment.cgi?id=227323&action=review

> Source/cmake/OptionsGTK.cmake:173
> -find_package(Freetype 2.4.2 REQUIRED)
> +find_package(Freetype2 2.4.11 REQUIRED)

This is the line where you raise the freetype dependency.
Comment 28 Thiago de Barros Lacerda 2014-03-20 13:31:35 PDT
(In reply to comment #27)
> (From update of attachment 227323 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=227323&action=review
> 
> > Source/cmake/OptionsGTK.cmake:173
> > -find_package(Freetype 2.4.2 REQUIRED)
> > +find_package(Freetype2 2.4.11 REQUIRED)
> 
> This is the line where you raise the freetype dependency.

OK, I will put it back to 2.4.2. Is that OK?
Comment 29 Martin Robinson 2014-03-20 13:32:22 PDT
(In reply to comment #28)
> (In reply to comment #27)
> > (From update of attachment 227323 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=227323&action=review
> > 
> > > Source/cmake/OptionsGTK.cmake:173
> > > -find_package(Freetype 2.4.2 REQUIRED)
> > > +find_package(Freetype2 2.4.11 REQUIRED)
> > 
> > This is the line where you raise the freetype dependency.
> 
> OK, I will put it back to 2.4.2. Is that OK?

Thanks. :)
Comment 30 Thiago de Barros Lacerda 2014-03-20 13:34:37 PDT
Created attachment 227325 [details]
Fix for Fretype version>=2.5.1 and putting version back to 2.4.2
Comment 31 Thiago de Barros Lacerda 2014-03-20 19:49:56 PDT
Martin, Gyuyoung and Alberto, is that OK now?
If so, Martin or Gyuyoung, could you r+?
Thanks
Comment 32 WebKit Commit Bot 2014-03-20 20:47:57 PDT
Comment on attachment 227325 [details]
Fix for Fretype version>=2.5.1 and putting version back to 2.4.2

Clearing flags on attachment: 227325

Committed r166037: <http://trac.webkit.org/changeset/166037>
Comment 33 WebKit Commit Bot 2014-03-20 20:48:05 PDT
All reviewed patches have been landed.  Closing bug.