wrong glib includes in gentoo install-finds 32 bit

Bug #1859778 reported by Mike Johnson
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Compiz
Fix Released
Undecided
Unassigned

Bug Description

Gentoo has recently changed it's /usr/lib directory from a symbolic link to /usr/lib64. /usr/lib now contains 32 bit libraries (multilib). The install works fine for most libraries, finds the 64 bit libs, but it finds /usr/lib/glib-2.0/includes, which are 32 bit headers, rather than /usr/lib64/glib-2.0/includes, causing failure. There doesn't appear to be a cmake directive to fix this. Please see this post: https://forums.gentoo.org/viewtopic-p-8409582.html#8409582.

**************
In file included from /usr/lib/glib-2.0/include/glibconfig.h:9,
                            ^^
                 from /usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from /var/tmp/portage/x11-wm/compiz-0.9.14.1/work/compiz-0.9.14.1/gtk/window-decorator/gwd-settings-storage.c:25:
/var/tmp/portage/x11-wm/compiz-0.9.14.1/work/compiz-0.9.14.1/gtk/window-decorator/gwd-settings-storage.c: In function ‘gwd_settings_storage_get_type’:
/usr/include/glib-2.0/glib/gmacros.h:292:53: error: size of array ‘_GStaticAssertCompileTimeAssertion_1’ is negative
**************

It appears the only way to remedy this is either a patch or a change to the source. I haven't been successful in figuring out what to patch :)
Thanks for your attention (and all the hard work. Love modern compiz)

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

What you get from `pkg-config --cflags glib-2.0`?

Revision history for this message
Mike Johnson (yuyuyak) wrote :

# pkg-config --cflags glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Compiz use `pkg_check_modules` to find/get include directories... What `grep -r GTK_WINDOW_DECORATOR_INCLUDE_DIRS` from build dir shows?

Revision history for this message
Mike Johnson (yuyuyak) wrote :

# grep -r GTK_WINDOW_DECORATOR_INCLUDE_DIRS
CMakeCache.txt:GTK_WINDOW_DECORATOR_INCLUDE_DIRS:INTERNAL=/usr/include/gtk-3.0;/usr/include/pango-1.0;/usr/include/glib-2.0;/usr/lib/glib-2.0/include;/usr/lib/libffi/include;/usr/include/fribidi;/usr/include/cairo;/usr/include/pixman-1;/usr/include/freetype2;/usr/include/uuid;/usr/include/libdrm;/usr/include/libpng16;/usr/include/harfbuzz;/usr/include/gdk-pixbuf-2.0;/usr/include/libmount;/usr/include/blkid;/usr/include/gio-unix-2.0;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib/dbus-1.0/include;/usr/include/libwnck-3.0

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

"/usr/include/glib-2.0;/usr/lib/glib-2.0/include;"

Interesting... Maybe bug in cmake? I would expect that pkg_check_modules returns same include flags as as pkg-config.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

https://git.launchpad.net/compiz/tree/cmake/base.cmake#n41

Maybe this has something to do with your problem!?

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

diff --git a/cmake/FindCompiz.cmake b/cmake/FindCompiz.cmake
index b19bcf257..5f101afcf 100644
--- a/cmake/FindCompiz.cmake
+++ b/cmake/FindCompiz.cmake
@@ -53,23 +53,6 @@ if (NOT _COMPIZ_INTERNAL)
      endif ()
  endif ()

- # add install prefix to pkgconfig search path if needed
- string (REGEX REPLACE "([\\+\\(\\)\\^\\\$\\.\\-\\*\\?\\|])" "\\\\\\1" PKGCONFIG_REGEX ${CMAKE_INSTALL_PREFIX})
- set (PKGCONFIG_REGEX ".*${PKGCONFIG_REGEX}/lib/pkgconfig:${PKGCONFIG_REGEX}/share/pkgconfig.*")
-
- if (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-
- if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
- if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
- else ()
- set (ENV{PKG_CONFIG_PATH}
- "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
- endif ()
- endif ()
-
- endif (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-
  # look for compiz
  pkg_check_modules (COMPIZ ${_req} "compiz${_comp_ver}")

diff --git a/cmake/base.cmake b/cmake/base.cmake
index 7731017fa..db4683cc7 100644
--- a/cmake/base.cmake
+++ b/cmake/base.cmake
@@ -37,16 +37,3 @@ function (_check_compiz_cmake_macro)
  ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/compizconfig/libcompizconfig/cmake/FindCompizConfig.cmake ${CMAKE_ROOT}/Modules
     )
 endfunction ()
-
-# add install prefix to pkgconfig search path if needed
-string (REGEX REPLACE "([\\+\\(\\)\\^\\\$\\.\\-\\*\\?\\|])" "\\\\\\1" PKGCONFIG_REGEX ${CMAKE_INSTALL_PREFIX})
-set (PKGCONFIG_REGEX ".*${PKGCONFIG_REGEX}/lib/pkgconfig:${PKGCONFIG_REGEX}/share/pkgconfig.*")
-
-if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
- if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
- else ()
- set (ENV{PKG_CONFIG_PATH}
- "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
- endif ()
-endif ()

Can you test if that works?

Revision history for this message
Mike Johnson (yuyuyak) wrote :

I had trouble with the patch, rather than waste time on that I patched by hand, and it worked!
# grep GTK_WINDOW_DECORATOR_INCLUDE_DIRS *
CMakeCache.txt:GTK_WINDOW_DECORATOR_INCLUDE_DIRS:INTERNAL=/usr/include/gtk-3.0;/usr/include/pango-1.0;/usr/include/glib-2.0;/usr/lib64/glib-2.0/include;/usr/lib64/libffi/include;/usr/include/fribidi;/usr/include/cairo;/usr/include/pixman-1;/usr/include/freetype2;/usr/include/uuid;/usr/include/libdrm;/usr/include/libpng16;/usr/include/harfbuzz;/usr/include/gdk-pixbuf-2.0;/usr/include/libmount;/usr/include/blkid;/usr/include/gio-unix-2.0;/usr/include/atk-1.0;/usr/include/at-spi2-atk/2.0;/usr/include/at-spi-2.0;/usr/include/dbus-1.0;/usr/lib64/dbus-1.0/include;/usr/include/libwnck-3.0

I'll fix whatever is wrong with patch. Thanks very much muktupavels :D

Revision history for this message
Mike Johnson (yuyuyak) wrote :

Probably it was just from pasting/copying here, which means this is a futile effort, but for posterity this is the working patch:
libdecoration-include-dirs-fix.patch
*********
--- a/cmake/FindCompiz.cmake 2019-11-27 05:24:31.000000000 -0800
+++ b/cmake/FindCompiz.cmake 2020-01-16 13:18:23.761715257 -0800
@@ -53,23 +53,6 @@
      endif ()
  endif ()

- # add install prefix to pkgconfig search path if needed
- string (REGEX REPLACE "([\\+\\(\\)\\^\\\$\\.\\-\\*\\?\\|])" "\\\\\\1" PKGCONFIG_REGEX ${CMAKE_INSTALL_PREFIX})
- set (PKGCONFIG_REGEX ".*${PKGCONFIG_REGEX}/lib/pkgconfig:${PKGCONFIG_REGEX}/share/pkgconfig.*")
-
- if (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-
- if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
- if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
- else ()
- set (ENV{PKG_CONFIG_PATH}
- "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
- endif ()
- endif ()
-
- endif (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-
  # look for compiz
  pkg_check_modules (COMPIZ ${_req} "compiz${_comp_ver}")

--- a/cmake/base.cmake 2019-11-27 05:24:31.000000000 -0800
+++ b/cmake/base.cmake 2020-01-16 13:19:12.952505060 -0800
@@ -38,15 +38,3 @@
     )
 endfunction ()

-# add install prefix to pkgconfig search path if needed
-string (REGEX REPLACE "([\\+\\(\\)\\^\\\$\\.\\-\\*\\?\\|])" "\\\\\\1" PKGCONFIG_REGEX ${CMAKE_INSTALL_PREFIX})
-set (PKGCONFIG_REGEX ".*${PKGCONFIG_REGEX}/lib/pkgconfig:${PKGCONFIG_REGEX}/share/pkgconfig.*")
-
-if (NOT "$ENV{PKG_CONFIG_PATH}" MATCHES "${PKGCONFIG_REGEX}")
- if ("" STREQUAL "$ENV{PKG_CONFIG_PATH}")
- set (ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig")
- else ()
- set (ENV{PKG_CONFIG_PATH}
- "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${CMAKE_INSTALL_PREFIX}/share/pkgconfig:$ENV{PKG_CONFIG_PATH}")
- endif ()
-endif ()
**************

Once again, thank you muktupavels, this works fine. Just ran ebuild and installed no problem.

Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

Can you rested linked merge request? There was one more place where pkg-config search path was changed...

Revision history for this message
Mike Johnson (yuyuyak) wrote :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

This is now fixed in compiz master branch.

Changed in compiz:
status: New → Fix Committed
Revision history for this message
Mike Johnson (yuyuyak) wrote :

Thank you to all.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

I have released version 0.9.14.2 today, which includes this fix.

Changed in compiz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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