Problem with cmake module FindGTK2.cmake in Ubuntu >= 11.04 (Natty Narwhal)

Bug #751940 reported by Tehnick
70
This bug affects 14 people
Affects Status Importance Assigned to Milestone
cmake (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: libglib2.0-dev

Hi,

I compared:
http://packages.ubuntu.com/maverick/i386/libglib2.0-dev/filelist
http://packages.ubuntu.com/natty/i386/libglib2.0-dev/filelist

Why you still move file:
/usr/lib/glib-2.0/include/glibconfig.h
to directories:
/usr/lib/i386-linux-gnu/glib-2.0/include/
/usr/lib/x86_64-linux-gnu/glib-2.0/include/
?

It is broke compilation of some programs which use cmake.
There is only warning on configuration stage:
"-- Some or all of the gtk libraries were not found. (missing: GTK2_GLIBCONFIG_INCLUDE_DIR)"
But compilation fails...

See string #426 in /usr/share/cmake-2.8/Modules/FindGTK2.cmake
"_GTK2_FIND_INCLUDE_DIR(GTK2_GLIBCONFIG_INCLUDE_DIR glibconfig.h)"

Next I found in changelog file that glibconfig.h was moved in glib2.0 version 2.25.12-2 in Debian Experimental
http://changelogs.ubuntu.com/changelogs/pool/main/g/glib2.0/glib2.0_2.28.5-0ubuntu1/changelog
http://packages.debian.org/changelogs/pool/main/g/glib2.0/current/changelog.html
But it was long time ago...

Now this problem affects only libglib2.0-dev (2.28.5-0ubuntu1) in Ubuntu Natty.
The package libglib2.0-dev (2.28.4-1) in Debian Sid is correct:
http://packages.debian.org/sid/libglib2.0-dev
http://packages.debian.org/sid/i386/libglib2.0-dev/filelist

Temporary I solved this problem in our project with following patch:
--- a/cmake/FindGTK2.cmake
+++ b/cmake/FindGTK2.cmake
@@ -185,6 +185,10 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)

     find_path(${_var} ${_hdr}
         PATHS
+ # fix for Ubuntu >= 11.04 (Natty Narwhal)
+ /usr/lib/i386-linux-gnu/
+ /usr/lib/x86_64-linux-gnu/
+ # end fix for Ubuntu >= 11.04 (Natty Narwhal)
             /usr/local/lib64
             /usr/local/lib
             /usr/lib64

But this is bad idea to push such patch in cmake upstream or to modify cmake-data package in Ubuntu.

So problem must be fixed in this package I think.

Regards,
Boris

Revision history for this message
Steve Langasek (vorlon) wrote :

This is a buggy assumption on the part of cmake. The standard interface that glib provides for consumers to query its library paths and cflags is pkg-config. On natty:

$ pkg-config --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
$

cmake should use pkg-config in FindGTK2.cmake. If there's a need to search additional paths, this should be done by permuting the *pkg-config* search path, using the PKG_CONFIG_PATH env var.

affects: glib2.0 (Ubuntu) → cmake (Ubuntu)
Changed in cmake (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Tehnick (tehnick)
summary: - Problems with cmake in Ubuntu Ubuntu >= 11.04 (Natty Narwhal)
+ Problem with cmake in Ubuntu >= 11.04 (Natty Narwhal)
summary: - Problem with cmake in Ubuntu >= 11.04 (Natty Narwhal)
+ Problem with cmake module FindGTK2.cmake in Ubuntu >= 11.04 (Natty
+ Narwhal)
Revision history for this message
Tehnick (tehnick) wrote :

Ok, I sent bug report to upstream:
http://www.cmake.org/Bug/view.php?id=12049

Revision history for this message
Tehnick (tehnick) wrote :

Cmake developers explained me that problem is related with multiarch support that is being implemented in Debian and Ubuntu now.

More details: http://www.cmake.org/Bug/view.php?id=12037

Revision history for this message
Tehnick (tehnick) wrote :

Hmm, I hastened to mark the bug as a duplicate.
Bug #737137 is marked as Fix Released but problem described by me is not solved yet in Ubuntu Natty.

Revision history for this message
Tehnick (tehnick) wrote :

And still I don't agree with moving the bug report from glib2.0 to cmake.

Debian also has multiarch support:
http://wiki.debian.org/Multiarch
But it was made more carefully in Debian.

You can see duplicates of this bug to observe packages affected by this issue.
Both packages (eiskaltdcpp and sciteproj) have no problem with builds in Debian.

As I wrote above file glibconfig.h in Debian placed in /usr/lib/glib-2.0/include/ directory:
http://packages.debian.org/sid/i386/libglib2.0-dev/filelist

I inspected this file and I didn't find platform-specific code.

Package in Ubuntu Oneiric has version 2.28.6-0ubuntu1 and it differ from the 2.28.6-1 version of this package in Debian Sid:
https://launchpad.net/ubuntu/+source/glib2.0
http://packages.debian.org/sid/libglib2.0-dev

Why don't you want just to sync your package with the package in Debian?
What's the profit from this incompatibility?

Tehnick (tehnick)
affects: cmake (Ubuntu) → glib2.0 (Ubuntu)
Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 751940] Re: Problem with cmake module FindGTK2.cmake in Ubuntu >= 11.04 (Natty Narwhal)

On Sun, Jun 05, 2011 at 01:09:01PM -0000, Tehnick wrote:
> Debian also has multiarch support:

No, it doesn't.

> http://wiki.debian.org/Multiarch
> But it was made more carefully in Debian.

No, it's being done in exactly the same way, merely on a different schedule
owing to differences in Debian and Ubuntu processes and release schedules.

> You can see duplicates of this bug to observe packages affected by this issue.
> Both packages (eiskaltdcpp and sciteproj) have no problem with builds in Debian.

Because multiarch is not implemented in Debian.

> As I wrote above file glibconfig.h in Debian placed in /usr/lib/glib-2.0/include/ directory:
> http://packages.debian.org/sid/i386/libglib2.0-dev/filelist

> I inspected this file and I didn't find platform-specific code.

Then you don't know what you're looking for.

#define G_GINT64_MODIFIER "l"

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

affects: glib2.0 (Ubuntu) → cmake (Ubuntu)
Revision history for this message
Tehnick (tehnick) wrote :

Sorry, I was mistaken. =(

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cmake - 2.8.4+dfsg.1-3

---------------
cmake (2.8.4+dfsg.1-3) unstable; urgency=low

  * Merge 2.8.2+dfsg.1-0+squeeze1 changes.
  * Do not start cmake description synopsis with an article.
  * Generate colour Makefiles when $TERM is set to 'screen-256color-bce'.
    Thanks to Davide Mancusi for the patch (screen-256color-bce.diff).
    (Closes: #627853)
  * Add libxmlrpc-core-c3-dev as a preferred alternative to libxmlrpc-c3-dev
    in Build-Depends. libxmlrpc-c3-dev has become a transitional package.
  * Bump Standards-Version to 3.9.2: no changes needed.
  * Switch Vcs-* debian/control fields to anonscm.debian.org.
  * Fix find_library() to find libraries in multiarch library paths (patch
    multiarch_library_directory_hack.diff). While the patch is not a good fix
    (hackish by nature, no cross-compilation support etc.), it should do the
    job in majority of cases. Also require dpkg-dev >= 1.16 at both build
    time (Build-Depends) and runtime (cmake Depends) because the patch needs
    dpkg-architecture -qDEB_HOST_MULTIARCH. (Closes: #618932)
  * Make FindGTK2.cmake work with Debian multiarch
    (patch multiarch_findgtk2_fix.diff). (LP: #751940)
 -- Felix Geyer <email address hidden> Wed, 08 Jun 2011 23:47:14 +0000

Changed in cmake (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
gregory (gregory-hainaut) wrote :

Would be possible to backport all multiarch fix in Oneiric to Natty? It is a nighmare for project that use cmake and GTK with natty users. Thanks you very much.

Revision history for this message
Pali (pali) wrote :

+1 for backporting to natty. Projects which use CMake and GTK should be compiled on natty without problems too!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.