Bug 346283

Summary: Cantor's FindLibSpectre.cmake uses the discouraged pkg-config macros and practices
Product: [Applications] cantor Reporter: Thomas Anderson <tanderson>
Component: generalAssignee: Alexander Rieder <alexanderrieder>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Exherbo   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thomas Anderson 2015-04-17 02:54:24 UTC
The cmake/FindLibSpectre.cmake script uses PKGCONFIG() which is discouraged. Still worse, it tries EXEC_PROGRAM for `pkg-config` which is horrible since it disrespects the $PKGCONFIG environment variable. The end result is that this breaks on Exherbo Linux since we support cross-compiling and so need to prepend the system triplet to pkg-config. Most of KDE gets this right, but cantor is broken.

Reproducible: Always




cmake -DCMAKE_COLOR_MAKEFILE:BOOL=TRUE -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=None -DCMAKE_C_FLAGS:STRING=-pipe -O2 -march=native -DNDEBUG -DQT_NO_DEBUG -DCMAKE_CXX_FLAGS:STRING=-pipe -O2 -march=native -pipe -O2 -march=native -DNDEBUG -DQT_NO_DEBUG -DCMAKE_AR:PATH=x86_64-pc-linux-gnu-ar -DCMAKE_RANLIB:PATH=x86_64-pc-linux-gnu-ranlib -DCMAKE_NM:PATH=x86_64-pc-linux-gnu-nm -DCMAKE_C_COMPILER:PATH=x86_64-pc-linux-gnu-gcc -DCMAKE_CXX_COMPILER:PATH=x86_64-pc-linux-gnu-g++ -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_DATAROOTDIR=/usr/share/ -DCMAKE_INSTALL_FULL_DATAROOTDIR=/usr/share/ -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu -DKDE4_ENABLE_HTMLHANDBOOK:BOOL=TRUE -DKDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR:BOOL=TRUE -DWITH_STRICT_DEPENDENCIES:BOOL=TRUE -DKDE4_BUILD_TESTS:BOOL=FALSE -DWITH_libspectre:BOOL=TRUE -DWITH_Analitza:BOOL=FALSE -DWITH_LuaJIT:BOOL=FALSE -DWITH_PythonLibs:BOOL=FALSE -DWITH_Qalculate:BOOL=FALSE -DWITH_R:BOOL=TRUE /var/tmp/paludis/build/kde-cantor-14.12.3-r1/work/cantor-14.12.3
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
-- Found Qt-Version 4.8.6 (using /usr/bin/qmake)
-- Looking for XOpenDisplay in /usr/x86_64-pc-linux-gnu/lib64/libX11.so;/usr/x86_64-pc-linux-gnu/lib64/libXext.so;/usr/x86_64-pc-linux-gnu/lib64/libXft.so;/usr/x86_64-pc-linux-gnu/lib64/libXau.so;/usr/x86_64-pc-linux-gnu/lib64/libXdmcp.so;/usr/x86_64-pc-linux-gnu/lib64/libXpm.so
-- Looking for XOpenDisplay in /usr/x86_64-pc-linux-gnu/lib64/libX11.so;/usr/x86_64-pc-linux-gnu/lib64/libXext.so;/usr/x86_64-pc-linux-gnu/lib64/libXft.so;/usr/x86_64-pc-linux-gnu/lib64/libXau.so;/usr/x86_64-pc-linux-gnu/lib64/libXdmcp.so;/usr/x86_64-pc-linux-gnu/lib64/libXpm.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/x86_64-pc-linux-gnu/lib64/libX11.so
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/x86_64-pc-linux-gnu/lib64/libssl.so;/usr/x86_64-pc-linux-gnu/lib64/libcrypto.so (found version "1.0.2a") 
-- Looking for _POSIX_TIMERS
-- Looking for _POSIX_TIMERS - found
-- Found Automoc4: /usr/bin/automoc4  
-- Found Perl: /usr/bin/perl (found version "5.20.2") 
-- Found Phonon: /usr/x86_64-pc-linux-gnu/include (Required is at least version "4.3.80") 
CMake Warning (dev) at /usr/share/apps/cmake/modules/FindKDE4Internal.cmake:614 (get_target_property):
  Policy CMP0045 is not set: Error on non-existent target in
  get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  get_target_property() called with non-existent target
  "KDE4__kauth-policy-gen".
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindKDE4.cmake:108 (find_package)
  CMakeLists.txt:3 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_FPIE_SUPPORT
-- Performing Test HAVE_FPIE_SUPPORT - Success
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success
-- Performing Test __KDE_HAVE_GCC_VISIBILITY
-- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success
-- Found KDE 4.12 include dir: /usr/x86_64-pc-linux-gnu/include/KDE4
-- Found KDE 4.12 library dir: /usr/x86_64-pc-linux-gnu/lib
-- Found the KDE4 kconfig_compiler preprocessor: /usr/x86_64-pc-linux-gnu/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
Error:
  * In program cave perform install --hooks --managed-output --output-exclusivity with-others =kde/cantor-14.12.3-r1:4::kde --destination installed --x-of-y 1 of 1:
  * When installing 'kde/cantor-14.12.3-r1:4::kde':
  * When running an ebuild command on 'kde/cantor-14.12.3-r1:4::kde':
  * Install failed for 'kde/cantor-14.12.3-r1:4::kde' (paludis::ActionFailedError)

-- Found R: /usr/bin/R  
-- WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig
-- WARNING: PKGCONFIG() indicates that the tool pkg-config has not been found on your system. You should install it.
-- Configuring incomplete, errors occurred!
See also "/var/tmp/paludis/build/kde-cantor-14.12.3-r1/work/build/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/paludis/build/kde-cantor-14.12.3-r1/work/build/CMakeFiles/CMakeError.log".
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find LibSpectre (missing: LIBSPECTRE_LIBRARY
  LIBSPECTRE_INTERNAL_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLibSpectre.cmake:61 (find_package_handle_standard_args)
  /usr/share/apps/cmake/modules/MacroOptionalFindPackage.cmake:34 (find_package)
  CMakeLists.txt:15 (macro_optional_find_package)



!!! ERROR in kde/cantor-14.12.3-r1::kde:
!!! In edo at line 1475
!!! cmake -DCMAKE_COLOR_MAKEFILE:BOOL=TRUE -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=None -DCMAKE_C_FLAGS:STRING=-pipe -O2 -march=native -DNDEBUG -DQT_NO_DEBUG -DCMAKE_CXX_FLAGS:STRING=-pipe -O2 -march=native -pipe -O2 -march=native -DNDEBUG -DQT_NO_DEBUG -DCMAKE_AR:PATH=x86_64-pc-linux-gnu-ar -DCMAKE_RANLIB:PATH=x86_64-pc-linux-gnu-ranlib -DCMAKE_NM:PATH=x86_64-pc-linux-gnu-nm -DCMAKE_C_COMPILER:PATH=x86_64-pc-linux-gnu-gcc -DCMAKE_CXX_COMPILER:PATH=x86_64-pc-linux-gnu-g++ -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_SYSTEM_PREFIX_PATH:PATH=/usr/x86_64-pc-linux-gnu -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_DATAROOTDIR=/usr/share/ -DCMAKE_INSTALL_FULL_DATAROOTDIR=/usr/share/ -DCMAKE_INSTALL_PREFIX:PATH=/usr/x86_64-pc-linux-gnu -DKDE4_ENABLE_HTMLHANDBOOK:BOOL=TRUE -DKDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR:BOOL=TRUE -DWITH_STRICT_DEPENDENCIES:BOOL=TRUE -DKDE4_BUILD_TESTS:BOOL=FALSE -DWITH_libspectre:BOOL=TRUE -DWITH_Analitza:BOOL=FALSE -DWITH_LuaJIT:BOOL=FALSE -DWITH_PythonLibs:BOOL=FALSE -DWITH_Qalculate:BOOL=FALSE -DWITH_R:BOOL=TRUE /var/tmp/paludis/build/kde-cantor-14.12.3-r1/work/cantor-14.12.3 failed
Comment 1 Heiko Becker 2015-05-09 17:56:49 UTC
Git commit 6a57ff8a5267a5b5d88efb340a146b53b2542505 by Heiko Becker.
Committed on 09/05/2015 at 17:47.
Pushed by heikobecker into branch 'master'.

FindLibSpectre: Use FindPkgConfig instead of UsePkgConfig

The latter is deprecated and doesn't respect the PKG_CONFIG
environment variable which makes it easy to deal with differently
named pkg-config executables, e.g. arch-prefixed ones.
REVIEW: 123394

M  +23   -31   cmake/FindLibSpectre.cmake

http://commits.kde.org/cantor/6a57ff8a5267a5b5d88efb340a146b53b2542505