diff mbox

[06/31] gnu: kwindowsystem: Update to 5.24.0.

Message ID 20160801181342.16203-7-david@craven.ch
State New
Headers show

Commit Message

David Craven Aug. 1, 2016, 6:13 p.m. UTC
* gnu/packages/kde-frameworks.scm: Update to 5.24.0.
---
 gnu/packages/kde-frameworks.scm | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

Comments

Andreas Enge Aug. 1, 2016, 9:10 p.m. UTC | #1
On Mon, Aug 01, 2016 at 08:13:17PM +0200, David Craven wrote:
> * gnu/packages/kde-frameworks.scm: Update to 5.24.0.

Here also, mention all changes:

> -        (uri (string-append "http://download.kde.org/stable/frameworks/"
> +        (uri (string-append "mirror://kde/stable/frameworks/"

This.

>      (native-inputs
> -     `(("pkg-config" ,pkg-config)
> +     `(("extra-cmake-modules" ,extra-cmake-modules)
> +       ("pkg-config" ,pkg-config)
>         ("xorg-server" ,xorg-server))) ; for the tests
>      (inputs
> -     `(("extra-cmake-modules" ,extra-cmake-modules)

The move of extra-cmake-modules.

> -       ("qt" ,qt)
> +       ("qtbase" ,qtbase)
> +       ("qtx11extras" ,qtx11extras)

And the switch from the monolithic to the modular Qt.

For qtx11extras that is not found, here is the error message:

CMake Error at /gnu/store/6d3qjij1k7z2sjlsq9c0b8ql53xgn34v-qtbase-5.6.1-1/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5X11Extras" with
  any of the following names:

    Qt5X11ExtrasConfig.cmake
    qt5x11extras-config.cmake

  Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set
  "Qt5X11Extras_DIR" to a directory containing one of the above files.  If
  "Qt5X11Extras" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:54 (find_package)
-- Configuring incomplete, errors occurred!
See also "/tmp/guix-build-kwindowsystem-5.24.0.drv-0/build/CMakeFiles/CMakeOutput.log".
phase `configure' failed after 4.4 seconds

One can go into /tmp/guix-build-kwindowsystem-5.24.0.drv-0 and look at the
file environment-variables. It does contain
export CMAKE_PREFIX_PATH="...:/gnu/store/3a5v3gh59hif13w7jqk8lhp5kvwbwk2i-qtx11extras-5.6.1-1/:..."

This is the installation prefix, and it is added to CMAKE_PREFIX_PATH as
required. Strange!

Inside, in the directory lib/cmake/Qt5X11Extras/, there are
Qt5X11ExtrasConfig.cmake and Qt5X11ExtrasConfigVersion.cmake.

It should be possible to define the environment variable Qt5X11Extras_DIR,
but it would be good to understand the problem...

According to the cmake documentation:
   https://cmake.org/cmake/help/v3.0/command/find_package.html
the Qt5X11ExtrasConfig.cmake file is searched for in the following directories
(the "(U)" stands for "Unix"):
<prefix>/(lib/<arch>|lib|share)/cmake/<name>*/          (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/                (U)
<prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/  (U)

In our case, the file is actually in
<prefix>/lib/cmake/<name>/, which should be fine.

The exact failing line 54 of CMakeLists.txt is:
   find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED X11Extras)
This actually does not correspond to the regular expression for find_package
in the cmake documentation...
I think it actually looks for Qt5Config.cmake, which it finds in qtbase, see
the line in the above error message:
CMake Error at /gnu/store/6d3qjij1k7z2sjlsq9c0b8ql53xgn34v-qtbase-5.6.1-1/lib/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5X11Extras" with
Lines 25 following of Qt5Config.cmake look like this:
foreach(module ${Qt5_FIND_COMPONENTS})
    find_package(Qt5${module}
        ${_Qt5_FIND_PARTS_QUIET}
        ${_Qt5_FIND_PARTS_REQUIRED}
        PATHS "${_qt5_install_prefix}" NO_DEFAULT_PATH
    )
So it looks like "find_package" is called with the argument "Qt5X11Extras",
but also with the suspicious additional parameters
   PATHS "${_qt5_install_prefix}" NO_DEFAULT_PATH
Since we install qt5x11extras to a different directory from qt5base,
the thing following the PATHS keyword is probably wrong.

See the cmake documentation:
"The set of installation prefixes is constructed using the following steps. If NO_DEFAULT_PATH is specified all NO_* options are enabled.
    Search paths specified in cmake-specific cache variables. These are intended to be used on the command line with a -DVAR=value. This can be skipped if NO_CMAKE_PATH is passed:
    CMAKE_PREFIX_PATH
    CMAKE_FRAMEWORK_PATH
    CMAKE_APPBUNDLE_PATH"

So I would say the error message is totally misleading; the NO_DEFAULT_PATH
keyword explicitly disables the CMAKE_PREFIX_PATH.

Unfortunately the store is read-only (in former times, I sometimes modified
store items by hand; now I do not dare overwrite the special file system
flags any more...), otherwise I would have tried to modify the file by hand...

Sorry for the long message, which follows my own path in trying to debug
this mess. To quickly summarise it:
I think we need to modify the qtbase package to drop the
NO_DEFAULT_PATH from Qt5Config.cmake.

Ceterum censeo that cmake should not be used, but this is not our choice;
autotools based projects usually do not create these problems...

Andreas
diff mbox

Patch

diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 39e2292..7b9bcba 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -63,26 +63,28 @@  common build settings used in software produced by the KDE community.")
     (license license:bsd-3)))
 
 (define-public kwindowsystem
+;;; TODO qtx11extras isn't found
   (package
     (name "kwindowsystem")
-    (version kde-frameworks-version)
+    (version "5.24.0")
     (source
       (origin
         (method url-fetch)
-        (uri (string-append "http://download.kde.org/stable/frameworks/"
+        (uri (string-append "mirror://kde/stable/frameworks/"
                             (version-major+minor version) "/"
                             name "-" version ".tar.xz"))
         (sha256
          (base32
-          "13lfwpw5a4in0mp5y8d15jg6xhhrka2qmw73wrdzcvj22n6ldzzi"))))
+          "0w5ym8msl80v3q65253pdpj9f1fmb658rnndlbkrgpmm1rv1n6dz"))))
     (build-system cmake-build-system)
     (native-inputs
-     `(("pkg-config" ,pkg-config)
+     `(("extra-cmake-modules" ,extra-cmake-modules)
+       ("pkg-config" ,pkg-config)
        ("xorg-server" ,xorg-server))) ; for the tests
     (inputs
-     `(("extra-cmake-modules" ,extra-cmake-modules)
-       ("libxrender" ,libxrender)
-       ("qt" ,qt)
+     `(("libxrender" ,libxrender)
+       ("qtbase" ,qtbase)
+       ("qtx11extras" ,qtx11extras)
        ("xcb-utils-keysyms" ,xcb-util-keysyms)))
     (arguments
      `(#:tests? #f)) ; FIXME: The first seven tests fail with "Exception".