unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* QT install and search paths
@ 2017-08-23 18:25 Hartmut Goebel
  2017-08-24 11:37 ` Thomas Danckaert
  2017-08-24 11:59 ` 宋文武
  0 siblings, 2 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-08-23 18:25 UTC (permalink / raw)
  To: guix-devel, Sou Bunnbu (宋文武)


[-- Attachment #1.1: Type: text/plain, Size: 1386 bytes --]

Hi,

I'm currently working on the build of KDE's plasma-desktop. When
strac-ing the tets, I dicoverd that plaugins are searched in

    /gnu/store/…-qtbase-5.9.1/plugins/…

while most of the KDE program use

    /gnu/store/…-plasma-workspace-5.10.4/lib/plugins/…  (mind the
    additional `lib`)

which is not searched. Wondering why, I found this in qt.scm (qtbase):

           (search-path-specification
            (variable "QT_PLUGIN_PATH")
            (files '("plugins")))

This means that `lib/plugins` is *not* included in QT_PLUGIN_PATH and
thus not searched. (Which I assume is the reason for many test-failures.)

Also in qt.scm (qtbase) there is:

               (substitute* qt_config.prf
                  …
                 (("\\$\\$\\[QT_INSTALL_PLUGINS\\]")
                  "$$replace(dir, mkspecs/modules, plugins)")

I assume this should make the plugins to be in stalled in …/plugins, but
KDE framework is installing into …/lib/plugins.

So I assume this is wrong or there are other places which need to be
adpoted to the changed directory layout.

What do you think?

All of the written above is true for the `qml` directory.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #1.2: Type: text/html, Size: 2209 bytes --]

[-- Attachment #2: 0xBF773B65.asc --]
[-- Type: application/pgp-keys, Size: 14855 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-23 18:25 QT install and search paths Hartmut Goebel
@ 2017-08-24 11:37 ` Thomas Danckaert
  2017-08-25  7:32   ` Hartmut Goebel
  2017-08-24 11:59 ` 宋文武
  1 sibling, 1 reply; 21+ messages in thread
From: Thomas Danckaert @ 2017-08-24 11:37 UTC (permalink / raw)
  To: h.goebel; +Cc: guix-devel, iyzsong

From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Subject: QT install and search paths
Date: Wed, 23 Aug 2017 20:25:10 +0200

> [...] I found this in qt.scm
> (qtbase):
>
>            (search-path-specification
>             (variable "QT_PLUGIN_PATH")
>             (files '("plugins")))
>
> This means that `lib/plugins` is *not* included in QT_PLUGIN_PATH
> and thus not searched. (Which I assume is the reason for many
> test-failures.)

(indeed, e.g. for kdevplatform, I set the QT_PLUGIN_PATH before 
running tests)

> Also in qt.scm (qtbase) there is:
>
>                (substitute* qt_config.prf
>                   …
>                  (("\\$\\$\\[QT_INSTALL_PLUGINS\\]")
>                   "$$replace(dir, mkspecs/modules, plugins)")
>
> I assume this should make the plugins to be in stalled in …/plugins,
> but KDE framework is installing into …/lib/plugins.

I'm not sure if this is an error, or if KDE chooses this directory on 
purpose.

Either way, I think qtbase's QT_PLUGIN_PATH setting only has an 
effect if a user installs qtbase directly in their profile (or do I 
misunderstand native-search-paths?  The manual doesn't explain the 
difference between "native-search-paths" and "search-paths"), so 
applications using these plugins will still need to set the correct 
environment variable themselves somehow?

A previous discussion is here

https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00776.html

For the kdevelop package, I wrapped the executable, setting a bunch 
of Qt-related environment variables.  This works as a stop-gap, but 
it will break down when a user uses multiple Qt/KDE applications with 
different plugin requirements (some KDE daemons, such as kdeinit, 
need to find all their plugins at the moment they are started).

Ludo suggested using a profile hook to set the required environment 
variables depending on the installed applications, but I never looked 
into it further because wrapping the executable was “good enough” 
for.  For a KDE desktop, I think you'll need a better solution.

Thomas

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-23 18:25 QT install and search paths Hartmut Goebel
  2017-08-24 11:37 ` Thomas Danckaert
@ 2017-08-24 11:59 ` 宋文武
  2017-08-25  7:06   ` Hartmut Goebel
  1 sibling, 1 reply; 21+ messages in thread
From: 宋文武 @ 2017-08-24 11:59 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Hi,
>
> I'm currently working on the build of KDE's plasma-desktop. When strac-ing the tets, I dicoverd that plaugins are searched in
>
>  /gnu/store/…-qtbase-5.9.1/plugins/…
>
> while most of the KDE program use
>
>  /gnu/store/…-plasma-workspace-5.10.4/lib/plugins/… (mind the additional `lib`)
>
> which is not searched. Wondering why, I found this in qt.scm (qtbase):
>
> (search-path-specification
> (variable "QT_PLUGIN_PATH")
> (files '("plugins")))
>
> This means that `lib/plugins` is *not* included in QT_PLUGIN_PATH and thus not searched. (Which I assume is the reason for many test-failures.)
>
> Also in qt.scm (qtbase) there is:
>
> (substitute* qt_config.prf
> …
> (("\$\$\[QT_INSTALL_PLUGINS\]")
> "$$replace(dir, mkspecs/modules, plugins)")
>
> I assume this should make the plugins to be in stalled in …/plugins,

Yes, 'dir' would be $out/mkspecs/modules, this will make a qmake based
package install its Qt plugins into $out/plugins.


> but KDE framework is installing into …/lib/plugins.
>
> So I assume this is wrong or there are other places which need to be adpoted to the changed directory layout.
>
> What do you think?

Currently, it doesn't follow a normal package layout, We should change
it to (like it in Debian and ArchLinux):

ARCHDATA:   lib/qt
DATA:       share/qt
DOCS:       share/doc/qt
HEADERS:    include/qt
LIBS:       lib
PLUGINS:    lib/qt/plugins
LIBEXECS:   lib/qt/libexec
BINS:       bin
IMPORTS:    lib/qt/imports
QML:        lib/qt/qml
EXAMPLES:   share/doc/qt/examples

Which need adjust the configure flags, search-patchs and the
qt_config.prf of our qtbase package (and maybe some kde ones, I don't
know).

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-24 11:59 ` 宋文武
@ 2017-08-25  7:06   ` Hartmut Goebel
  2017-08-25 12:40     ` 宋文武
  0 siblings, 1 reply; 21+ messages in thread
From: Hartmut Goebel @ 2017-08-25  7:06 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

Am 24.08.2017 um 13:59 schrieb 宋文武:
> Currently, it doesn't follow a normal package layout, We should change
> it to (like it in Debian and ArchLinux):

I'd support this.

What do you think about using "…/qt5" instead of just "…/qt", like
Fedora does. IMHO this is not a bad idea.

> Which need adjust the configure flags, search-patchs and the
> qt_config.prf of our qtbase package (and maybe some kde ones, I don't
> know).

Can you take care of this? I can take care of kde-frameworks.scm. Maybe
we can work on a different branch until we finished all packages.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-24 11:37 ` Thomas Danckaert
@ 2017-08-25  7:32   ` Hartmut Goebel
  0 siblings, 0 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-08-25  7:32 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel, iyzsong

Am 24.08.2017 um 13:37 schrieb Thomas Danckaert:
> Either way, I think qtbase's QT_PLUGIN_PATH setting only has an effect
> if a user installs qtbase directly in their profile […] so
> applications using these plugins will still need to set the correct
> environment variable themselves somehow?

Do my understanding, "search-paths" will make the the listed paths of
all installed packages to be added to the named variable. Thus in this
case the package would "just" need to ensure all it's dependencies are
installed. The rest is done automatically.

Which leads to another, different problem: For this to work AFAIU the
package needs to propagate all the plugins, etc. it is using. Which is
not nice, and which I assume is the resume from

> https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00776.html
>
> For the kdevelop package, I wrapped the executable, setting a bunch of
> Qt-related environment variables.  This works as a stop-gap, but it
> will break down when a user uses multiple Qt/KDE applications with
> different plugin requirements (some KDE daemons, such as kdeinit, need
> to find all their plugins at the moment they are started).

Nice idea! But unfortunately this is not a solution in the long term –
since it would require this to be done for each and every KDE and even
QT application.

> Ludo suggested using a profile hook to set the required environment
> variables depending on the installed applications, but I never looked
> into it further because wrapping the executable was “good enough”
> for.  For a KDE desktop, I think you'll need a better solution. 

I'd appreciate if you could have a look at this. I have some other todos
on my lit with higher priority, but this problems are a show-stopper for
my efforts on the plasma-desktop (which are much more time-consuming
than I thought).

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-25  7:06   ` Hartmut Goebel
@ 2017-08-25 12:40     ` 宋文武
  2017-08-25 16:04       ` 宋文武
  0 siblings, 1 reply; 21+ messages in thread
From: 宋文武 @ 2017-08-25 12:40 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 24.08.2017 um 13:59 schrieb 宋文武:
>> Currently, it doesn't follow a normal package layout, We should change
>> it to (like it in Debian and ArchLinux):
>
> I'd support this.
>
> What do you think about using "…/qt5" instead of just "…/qt", like
> Fedora does. IMHO this is not a bad idea.

Sure, 
>
>> Which need adjust the configure flags, search-patchs and the
>> qt_config.prf of our qtbase package (and maybe some kde ones, I don't
>> know).
>
> Can you take care of this? I can take care of kde-frameworks.scm. Maybe
> we can work on a different branch until we finished all packages.

Okay, I'll reply to this thread once I got qtbase adjusted.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-25 12:40     ` 宋文武
@ 2017-08-25 16:04       ` 宋文武
  2017-08-26  8:31         ` Hartmut Goebel
  2017-08-27 16:49         ` Hartmut Goebel
  0 siblings, 2 replies; 21+ messages in thread
From: 宋文武 @ 2017-08-25 16:04 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 59 bytes --]

Here is a patch to adjust the directory layout of qtbase:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-qtbase-Use-a-more-standard-directory-layout.patch --]
[-- Type: text/x-patch, Size: 4045 bytes --]

From b264ccfdec5c7334ef7e428c8b483bc673edc393 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Fri, 25 Aug 2017 22:52:41 +0800
Subject: [PATCH] gnu: qtbase: Use a more standard directory layout.

* gnu/packages/qt.scm (qtbase)[arguments]: Pass docdir, headerdir,
archdatadir, datadir and examplesdir to 'configure'.  Ajdust the
patch-qt_config.prf phase accordingly.
[native-search-paths]: Adjust accordingly.
---
 gnu/packages/qt.scm | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 3e3588a50..2d7c83ae5 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -459,6 +459,12 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                        "./configure"
                        "-verbose"
                        "-prefix" out
+                       "-docdir" (string-append out "/share/doc/qt5")
+                       "-headerdir" (string-append out "/include/qt5")
+                       "-archdatadir" (string-append out "/lib/qt5")
+                       "-datadir" (string-append out "/share/qt5")
+                       "-examplesdir" (string-append
+                                       out "/share/doc/qt5/examples")
                        "-opensource"
                        "-confirm-license"
                        ;; Do not build examples; if desired, these could go
@@ -488,38 +494,31 @@ developers using C++ or QML, a CSS & JavaScript like language.")
          (add-after 'install 'patch-qt_config.prf
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
+                    (mkspecs (string-append out "/lib/qt5/mkspecs"))
                     (qt_config.prf (string-append
-                                    out "/mkspecs/features/qt_config.prf")))
+                                    mkspecs "/features/qt_config.prf")))
                ;; For each Qt module, let `qmake' uses search paths in the
                ;; module directory instead of all in QT_INSTALL_PREFIX.
                (substitute* qt_config.prf
                  (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
-                  "$$replace(dir, mkspecs/modules, include)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
                  (("\\$\\$\\[QT_INSTALL_LIBS\\]")
-                  "$$replace(dir, mkspecs/modules, lib)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
                  (("\\$\\$\\[QT_HOST_LIBS\\]")
-                  "$$replace(dir, mkspecs/modules, lib)")
-                 (("\\$\\$\\[QT_INSTALL_PLUGINS\\]")
-                  "$$replace(dir, mkspecs/modules, plugins)")
-                 (("\\$\\$\\[QT_INSTALL_LIBEXECS\\]")
-                  "$$replace(dir, mkspecs/modules, libexec)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
                  (("\\$\\$\\[QT_INSTALL_BINS\\]")
-                  "$$replace(dir, mkspecs/modules, bin)")
-                 (("\\$\\$\\[QT_INSTALL_IMPORTS\\]")
-                  "$$replace(dir, mkspecs/modules, imports)")
-                 (("\\$\\$\\[QT_INSTALL_QML\\]")
-                  "$$replace(dir, mkspecs/modules, qml)"))
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
                #t))))))
     (native-search-paths
      (list (search-path-specification
             (variable "QMAKEPATH")
-            (files '("")))
+            (files '("lib/qt5")))
            (search-path-specification
             (variable "QML2_IMPORT_PATH")
-            (files '("qml")))
+            (files '("lib/qt5/qml")))
            (search-path-specification
             (variable "QT_PLUGIN_PATH")
-            (files '("plugins")))
+            (files '("lib/qt5/plugins")))
            (search-path-specification
             (variable "XDG_DATA_DIRS")
             (files '("share")))
-- 
2.13.3


[-- Attachment #3: Type: text/plain, Size: 58 bytes --]



I have built qtscript with it, which looks fine so far.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-25 16:04       ` 宋文武
@ 2017-08-26  8:31         ` Hartmut Goebel
  2017-08-27 16:49         ` Hartmut Goebel
  1 sibling, 0 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-08-26  8:31 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

Am 25.08.2017 um 18:04 schrieb 宋文武:
> Here is a patch to adjust the directory layout of qtbase:

Thanks a lot! I merged it in my kde-plama branch and just started a new
build for kde-frameworks and plasma-desktop. I'll report my insights.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-25 16:04       ` 宋文武
  2017-08-26  8:31         ` Hartmut Goebel
@ 2017-08-27 16:49         ` Hartmut Goebel
  2017-09-02 16:40           ` Hartmut Goebel
  1 sibling, 1 reply; 21+ messages in thread
From: Hartmut Goebel @ 2017-08-27 16:49 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3921 bytes --]

Am 25.08.2017 um 18:04 schrieb 宋文武:
> Here is a patch to adjust the directory layout of qtbase:

I tested this patch and building qtwayland failed:

cd
/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/tests/auto/client/client
./target_wrapper.sh  ./tst_client

The error message is (which is misleading, see below)

    This application failed to start because it could not find or load
    the Qt platform plugin "wayland"
    in "".

    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl,
    offscreen, vnc, xcb, wayland-egl, wayland, wayland-xcomposite-egl,
    wayland-xcomposite-glx.

I searched the internet for this without any useful result (I did not
search too long, though). But there was a hint pointing to some missing
library. And indeed the strace output (see below, shortened) shows: the
platform plugin is found, but it requires libQt5WaylandClient.so.5 which
is searched without success. The file exists in
/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/lib/,
so it is part of qtwayland but not yet installed.

It is searched in several sub-directories of
/tmp/guix-build-…/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../
(which is the /tmp/guix-build-qtwayland-5.9.1.drv-0 directory), but not
in …/lib. I did not find out how to

15562
open("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/libqwayland-generic.so",
O_RDONLY|O_CLOEXEC) = 8
15562 read(8,
"\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\24\0\0\0\0\0\0"...,
832) = 832
…
15562
open("/gnu/store/dnmbw43sl6yx82awzj8c0y4wcjz5z2kd-qtbase-5.9.1/lib/libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
15562
open("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../tls/x86_64/libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
15562
stat("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../tls/x86_64",
0x7ffc321fe710) = -1 ENOENT (No such file or directory)
15562
open("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../tls/libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
15562
stat("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../tls",
0x7ffc321fe710) = -1 ENOENT (No such file or directory)
15562
open("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../x86_64/libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
15562
stat("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../x86_64",
0x7ffc321fe710) = -1 ENOENT (No such file or directory)
15562
open("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
15562
stat("/tmp/guix-build-qtwayland-5.9.1.drv-0/qtwayland-opensource-src-5.9.1/plugins/platforms/../../..",
{st_mode=S_IFDIR|0755, st_size=100, ...}) = 0
15562
open("/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/libQt5WaylandClient.so.5",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)


Thinks I tried to solve this:
- setting |QT_QPA_PLATFORM_PLUGIN_PATH
- creating a file |qt.conf in the app folder

Things I did *not* try:
- reading http://www.tripleboot.org/?p=138 – to long :-)

Another insight:
- export QT_DEBUG_PLUGINS=1 makes qt report useful messages.
||

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #2: Type: text/html, Size: 4997 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-08-27 16:49         ` Hartmut Goebel
@ 2017-09-02 16:40           ` Hartmut Goebel
  2017-09-03  4:58             ` 宋文武
  2017-09-04  7:44             ` Thomas Danckaert
  0 siblings, 2 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-02 16:40 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

Am 27.08.2017 um 18:49 schrieb Hartmut Goebel:
> It is searched in several sub-directories of
> /tmp/guix-build-…/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../
> (which is the /tmp/guix-build-qtwayland-5.9.1.drv-0 directory), but
> not in …/lib. I did not find out how to

Uff, I tracked this down in a heavy thinking session.

  *

    This search-path stems from the libraries RUNPATH, which was
    $ORIGIN/../../lib and is now only $ORIGIN/../../../

  *

    The RUNPATH is set in
    /gnu/store/…-qtbase-5.9.1/lib/qt5/mkspecs/features/qt.prf line 272,
    using the relative path from $$qtRelativeRPathBase (which equals
    $target.path, which is
    /gnu/store/…-qtbase-5.9.1/lib/qt5/plugins/platforms) to
    $QT_INSTALL_LIBS (which is /gnu/store/…-qtbase-5.9.1/lib).  This
    relative path obviously is ../../../ .

  *

    Prior to this patch we installed the plugins into
    …-qtbase-5.9.1/plugins, which results in the aforementioned relative
    path to be ../../lib and the RUNPATH to be set to $ORIGIN/../../lib.

Conclusions:

1. It's been pure luck that the qtwayland tests passed prior to this change.

2. Do make the tests pass, we need to set LD_LIBRARY_PATH prior to
running the tests

3. tests of other packages may fail for the same reason.

I'll take care of the packages in kde-frameworks.scm, I assume/hope
Thomas will take care of the ones in kde.scm.

宋文武, how can we coordinate the required changes? Should they go into one
patch? Or into a series?

-- 

Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #2: Type: text/html, Size: 2667 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-02 16:40           ` Hartmut Goebel
@ 2017-09-03  4:58             ` 宋文武
  2017-09-03 11:46               ` 宋文武
  2017-09-04  7:44             ` Thomas Danckaert
  1 sibling, 1 reply; 21+ messages in thread
From: 宋文武 @ 2017-09-03  4:58 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 27.08.2017 um 18:49 schrieb Hartmut Goebel:
>
>  It is searched in several sub-directories of /tmp/guix-build-…/qtwayland-opensource-src-5.9.1/plugins/platforms/../../../ (which is the
>  /tmp/guix-build-qtwayland-5.9.1.drv-0 directory), but not in …/lib. I did not find out how to
>
> Uff, I tracked this down in a heavy thinking session.
>
> * This search-path stems from the libraries RUNPATH, which was $ORIGIN/../../lib and is now only $ORIGIN/../../../
>
> * The RUNPATH is set in /gnu/store/…-qtbase-5.9.1/lib/qt5/mkspecs/features/qt.prf line 272, using the relative path from $$qtRelativeRPathBase (which equals
>  $target.path, which is /gnu/store/…-qtbase-5.9.1/lib/qt5/plugins/platforms) to $QT_INSTALL_LIBS (which is /gnu/store/…-qtbase-5.9.1/lib). This relative path obviously is
>  ../../../ .
>
> * Prior to this patch we installed the plugins into …-qtbase-5.9.1/plugins, which results in the aforementioned relative path to be ../../lib and the RUNPATH to be set to
>  $ORIGIN/../../lib.

Oh, that's right, thanks!
>
> Conclusions:
>
> 1. It's been pure luck that the qtwayland tests passed prior to this change.
>
> 2. Do make the tests pass, we need to set LD_LIBRARY_PATH prior to running the tests
>

Yeah, patch updated with qtwayland fixed:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-qtbase-Use-a-more-standard-directory-layout.patch --]
[-- Type: text/x-patch, Size: 4999 bytes --]

From 18da38fbed889c482db6bab91749f63f7adbde5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Fri, 25 Aug 2017 22:52:41 +0800
Subject: [PATCH] gnu: qtbase: Use a more standard directory layout.

* gnu/packages/qt.scm (qtbase)[arguments]: Pass docdir, headerdir,
archdatadir, datadir and examplesdir to 'configure'.  Ajdust the
patch-qt_config.prf phase accordingly.
[native-search-paths]: Adjust accordingly.
(qtwayland)[arguments]: New field.

Co-authored-by: Hartmut Goebel <h.goebel@crazy-compilers.com>
---
 gnu/packages/qt.scm | 43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 3e3588a50..80508f058 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -459,6 +459,12 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                        "./configure"
                        "-verbose"
                        "-prefix" out
+                       "-docdir" (string-append out "/share/doc/qt5")
+                       "-headerdir" (string-append out "/include/qt5")
+                       "-archdatadir" (string-append out "/lib/qt5")
+                       "-datadir" (string-append out "/share/qt5")
+                       "-examplesdir" (string-append
+                                       out "/share/doc/qt5/examples")
                        "-opensource"
                        "-confirm-license"
                        ;; Do not build examples; if desired, these could go
@@ -488,38 +494,31 @@ developers using C++ or QML, a CSS & JavaScript like language.")
          (add-after 'install 'patch-qt_config.prf
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
+                    (mkspecs (string-append out "/lib/qt5/mkspecs"))
                     (qt_config.prf (string-append
-                                    out "/mkspecs/features/qt_config.prf")))
+                                    mkspecs "/features/qt_config.prf")))
                ;; For each Qt module, let `qmake' uses search paths in the
                ;; module directory instead of all in QT_INSTALL_PREFIX.
                (substitute* qt_config.prf
                  (("\\$\\$\\[QT_INSTALL_HEADERS\\]")
-                  "$$replace(dir, mkspecs/modules, include)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../include/qt5))")
                  (("\\$\\$\\[QT_INSTALL_LIBS\\]")
-                  "$$replace(dir, mkspecs/modules, lib)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
                  (("\\$\\$\\[QT_HOST_LIBS\\]")
-                  "$$replace(dir, mkspecs/modules, lib)")
-                 (("\\$\\$\\[QT_INSTALL_PLUGINS\\]")
-                  "$$replace(dir, mkspecs/modules, plugins)")
-                 (("\\$\\$\\[QT_INSTALL_LIBEXECS\\]")
-                  "$$replace(dir, mkspecs/modules, libexec)")
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
                  (("\\$\\$\\[QT_INSTALL_BINS\\]")
-                  "$$replace(dir, mkspecs/modules, bin)")
-                 (("\\$\\$\\[QT_INSTALL_IMPORTS\\]")
-                  "$$replace(dir, mkspecs/modules, imports)")
-                 (("\\$\\$\\[QT_INSTALL_QML\\]")
-                  "$$replace(dir, mkspecs/modules, qml)"))
+                  "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
                #t))))))
     (native-search-paths
      (list (search-path-specification
             (variable "QMAKEPATH")
-            (files '("")))
+            (files '("lib/qt5")))
            (search-path-specification
             (variable "QML2_IMPORT_PATH")
-            (files '("qml")))
+            (files '("lib/qt5/qml")))
            (search-path-specification
             (variable "QT_PLUGIN_PATH")
-            (files '("plugins")))
+            (files '("lib/qt5/plugins")))
            (search-path-specification
             (variable "XDG_DATA_DIRS")
             (files '("share")))
@@ -805,6 +804,18 @@ developers using C++ or QML, a CSS & JavaScript like language.")
              (snippet
                ;; The examples try to build and cause the build to fail
               '(delete-file-recursively "examples"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments qtsvg)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-before 'check 'set-ld-library-path
+             ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00019.html>
+             ;;
+             ;; Make the uninstalled libQt5WaylandClient.so.5 available to the
+             ;; wayland platform plugin.
+             (lambda _
+               (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/lib"))
+               #t))))))
     (native-inputs
      `(("glib" ,glib)
        ("perl" ,perl)
-- 
2.13.3


[-- Attachment #3: Type: text/plain, Size: 1481 bytes --]



> 3. tests of other packages may fail for the same reason.

Yes, I have got tiled running, and find that 'cool-retro-term' need to
be adjusted.

And vlc fails to build due to can't find headers of Qt5X11Extras.
Indeed, the pkg-config output of Qt5X11Extras seems wrong:
--8<---------------cut here---------------start------------->8---
$ pkg-config --cflags --libs Qt5X11Extras
-I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtGui -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtCore -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtX11Extras -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -L/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/lib -lQt5X11Extras -lQt5Gui -lQt5Core
--8<---------------cut here---------------end--------------->8---

I can try fix this pkg-config issue.

>
> I'll take care of the packages in kde-frameworks.scm, I assume/hope
> Thomas will take care of the ones in kde.scm.

Yeah, I build 'kiarchive', and find it puts 'mkspecs' under $out, which
needs change to $out/lib/qt5/mkspecs.

>
> 宋文武, how can we coordinate the required changes? Should they go into one patch? Or into a series?

I think we could make a series patches, and can squash them later if
suitable.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-03  4:58             ` 宋文武
@ 2017-09-03 11:46               ` 宋文武
  2017-09-03 12:39                 ` Hartmut Goebel
  2017-09-03 14:04                 ` Hartmut Goebel
  0 siblings, 2 replies; 21+ messages in thread
From: 宋文武 @ 2017-09-03 11:46 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 787 bytes --]


> [...]
> And vlc fails to build due to can't find headers of Qt5X11Extras.
> Indeed, the pkg-config output of Qt5X11Extras seems wrong:

> $ pkg-config --cflags --libs Qt5X11Extras
> -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtGui -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtCore -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5/QtX11Extras -I/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/include/qt5 -L/gnu/store/l8xp2i57plmdd3pprhznc8r03ha3sv2s-qtbase-5.9.1/lib -lQt5X11Extras -lQt5Gui -lQt5Core

> I can try fix this pkg-config issue.

Here is it:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-qt-Fix-install-paths-in-submodules.patch --]
[-- Type: text/x-patch, Size: 3428 bytes --]

From b2f4822b3a1c8f76d2c6dcf39590d3810d3510bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Sun, 3 Sep 2017 17:38:57 +0800
Subject: [PATCH 2/2] gnu: qt: Fix install paths in submodules.

Before this, the paths in pkg-config (.pc) and libtool (.la) files of
submodules are all pointing to qtbase.

* gnu/packages/qt.scm (qtsvg)[arguments]: Use a customized qt.conf to
override install paths to $out.
---
 gnu/packages/qt.scm | 57 +++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 40 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 80508f058..771a03bd5 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -554,25 +554,48 @@ developers using C++ or QML, a CSS & JavaScript like language.")
      `(#:phases
        (modify-phases %standard-phases
          (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (qtbase (assoc-ref inputs "qtbase"))
+                    (tmpdir (string-append (getenv "TMPDIR")))
+                    (qmake (string-append tmpdir "/qmake"))
+                    (qt.conf (string-append tmpdir "/qt.conf")))
+               ;; Use qmake with a customized qt.conf to override install
+               ;; paths to $out.
+               (symlink (which "qmake") qmake)
+               (with-output-to-file qt.conf
+                 (lambda ()
+                   ;; Thoese must be kept in sync with qtbase.
+                   (format #t "[Paths]
+Prefix=~a
+ArchData=lib/qt5
+Data=share/qt5
+Documentation=share/doc/qt5
+Headers=include/qt5
+Libraries=lib
+LibraryExecutables=lib/qt5/libexec
+Binaries=bin
+Tests=tests
+Plugins=lib/qt5/plugins
+Imports=lib/qt5/imports
+Qml2Imports=lib/qt5/qml
+Translations=share/qt5/translations
+Settings=etc/xdg
+Examples=share/doc/qt5/examples
+HostPrefix=~a
+HostData=lib/qt5
+HostBinaries=bin
+HostLibrariesPath=lib
+" out qtbase)))
+
                ;; Valid QT_BUILD_PARTS variables are:
                ;; libs tools tests examples demos docs translations
-               (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests"
-                               (string-append "PREFIX=" out))))))
-         (add-before 'install 'fix-Makefiles
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out    (assoc-ref outputs "out"))
-                   (qtbase (assoc-ref inputs "qtbase")))
-               (substitute* (find-files "." "Makefile")
-                            (((string-append "INSTALL_ROOT)" qtbase))
-                             (string-append "INSTALL_ROOT)" out)))
-               #t)))
-            (add-before 'check 'set-display
-              (lambda _
-                ;; make Qt render "offscreen", required for tests
-                (setenv "QT_QPA_PLATFORM" "offscreen")
-                #t)))))))
+               (zero? (system* qmake "QT_BUILD_PARTS = libs tools tests")))))
+         (add-before 'check 'set-display
+           (lambda _
+             ;; make Qt render "offscreen", required for tests
+             (setenv "QT_QPA_PLATFORM" "offscreen")
+             #t)))))))
 
 (define-public qtimageformats
   (package (inherit qtsvg)
-- 
2.13.3


[-- Attachment #3: Type: text/plain, Size: 178 bytes --]


This fixes the pkg-config files of various qt submodules, and gets vlc
built.


I think remaining non-KDE things to fix are qt-utils.scm, sddm,
greenisland and cool-retro-term.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-03 11:46               ` 宋文武
@ 2017-09-03 12:39                 ` Hartmut Goebel
  2017-09-03 14:04                 ` Hartmut Goebel
  1 sibling, 0 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-03 12:39 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

Hi,

enclosed the required patch for qscintilla to make python-qscintilla
build and qtwebkit.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #2: 0001-gnu-qtwebkit-Fix-rpath-for-the-qmlwebkit-plugins.patch --]
[-- Type: text/x-patch, Size: 1503 bytes --]

From 3e4a25c412632095b1415296f9d46a4b93fad212 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sat, 2 Sep 2017 23:20:15 +0200
Subject: [PATCH 1/2] gnu: qtwebkit: Fix rpath for the qmlwebkit plugins.

After the qtbase installation directories have been changed,
the relative RPATH in the libs no longer matched the sructure.

* gnu/packages/qt.scm(qtwebkit)[arguments]: New phase
  fix-qmlwebkit-plugins-rpath.
---
 gnu/packages/qt.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 3478fdaae..86b35bdc8 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1613,6 +1613,15 @@ different kinds of sliders, and much more.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         (add-before 'configure 'fix-qmlwebkit-plugins-rpath
+           (lambda _
+             (substitute* "Source/WebKit/qt/declarative/experimental/experimental.pri"
+               (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
+                "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../../lib"))
+             (substitute* "Source/WebKit/qt/declarative/public.pri"
+               (("RPATHDIR_RELATIVE_TO_DESTDIR = \\.\\./\\.\\./lib")
+                "RPATHDIR_RELATIVE_TO_DESTDIR = ../../../../lib"))
+             #t))
          (replace 'configure
                   (lambda* (#:key outputs #:allow-other-keys)
                     (let ((out (assoc-ref outputs "out")))
-- 
2.13.5


[-- Attachment #3: 0002-gnu-qscintilla-Adopt-paths-REWORD.patch --]
[-- Type: text/x-patch, Size: 1245 bytes --]

From c3fab9284454c90461dc601970e2a67942f84373 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sun, 3 Sep 2017 11:36:42 +0200
Subject: [PATCH 2/2] gnu: qscintilla: Adopt paths REWORD

* gnu/packages/qt.scm(qscintilla)[configure]: XXX
---
 gnu/packages/qt.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 86b35bdc8..f9e743348 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1412,8 +1412,10 @@ contain over 620 classes.")
                   (string-append out "/include"))
                  (("\\$\\$\\[QT_INSTALL_TRANSLATIONS\\]")
                   (string-append out "/translations"))
-                 (("\\$\\$\\[QT_INSTALL_DATA\\]") out)
-                 (("\\$\\$\\[QT_HOST_DATA\\]") out))
+                 (("\\$\\$\\[QT_INSTALL_DATA\\]")
+                  (string-append out "/lib/qt$${QT_MAJOR_VERSION}"))
+                 (("\\$\\$\\[QT_HOST_DATA\\]")
+                 (string-append out "/lib/qt$${QT_MAJOR_VERSION}")))
                (zero? (system* "qmake"))))))))
     (native-inputs `(("qtbase" ,qtbase)))
     (home-page "http://www.riverbankcomputing.co.uk/software/qscintilla/intro")
-- 
2.13.5


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-03 11:46               ` 宋文武
  2017-09-03 12:39                 ` Hartmut Goebel
@ 2017-09-03 14:04                 ` Hartmut Goebel
  2017-09-03 14:46                   ` 宋文武
  1 sibling, 1 reply; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-03 14:04 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

Am 03.09.2017 um 13:46 schrieb 宋文武:
> 0002-gnu-qt-Fix-install-paths-in-submodules.patch
>

I'm afraid this breaks some packages, e.g. qwt (qt.scm) and sonnet
(kde-frameworks.scm). Can you have a look at what is going wrong here?
Thanks

(Without this patch, but with my other two applied I can build all
packages in qt.scm and kde-framewords.scm.)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #2: Type: text/html, Size: 1214 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-03 14:04                 ` Hartmut Goebel
@ 2017-09-03 14:46                   ` 宋文武
  0 siblings, 0 replies; 21+ messages in thread
From: 宋文武 @ 2017-09-03 14:46 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel, Thomas Danckaert

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 03.09.2017 um 13:46 schrieb 宋文武:
>
>  0002-gnu-qt-Fix-install-paths-in-submodules.patch
>
> I'm afraid this breaks some packages, e.g. qwt (qt.scm) and sonnet
> (kde-frameworks.scm). Can you have a look at what is going wrong here?
> Thanks

Yeah, this patch need more works.  I also find that 'qttools' ends up
with broken 'imported_location' in Qt5LinguistToolsConfig.cmake and
Qt5HelpConfigExtras.cmake, will look into it later...

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-02 16:40           ` Hartmut Goebel
  2017-09-03  4:58             ` 宋文武
@ 2017-09-04  7:44             ` Thomas Danckaert
  2017-09-04  9:16               ` Hartmut Goebel
  1 sibling, 1 reply; 21+ messages in thread
From: Thomas Danckaert @ 2017-09-04  7:44 UTC (permalink / raw)
  To: h.goebel; +Cc: guix-devel

From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Subject: Re: QT install and search paths
Date: Sat, 2 Sep 2017 18:40:44 +0200

> I'll take care of the packages in kde-frameworks.scm, I assume/hope
> Thomas will take care of the ones in kde.scm.

Hi,

Just to make sure, the idea is to:

 1. apply 宋文武's qtbase patch adjusting the paths of various qt components

 2. apply your 2 patches for qtscintilla and qtwebkit

 3. adjust kde.scm so packages in there build correctly?

I'll have a look, but give me some time :)

Thomas

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-04  7:44             ` Thomas Danckaert
@ 2017-09-04  9:16               ` Hartmut Goebel
  2017-09-07 13:38                 ` 宋文武
  0 siblings, 1 reply; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-04  9:16 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Am 04.09.2017 um 09:44 schrieb Thomas Danckaert:
> Just to make sure, the idea is to:
>
>  1. apply 宋文武's qtbase patch adjusting the paths of various qt components
>
>  2. apply your 2 patches for qtscintilla and qtwebkit
>
>  3. adjust kde.scm so packages in there build correctly?

ACK from my side.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-04  9:16               ` Hartmut Goebel
@ 2017-09-07 13:38                 ` 宋文武
  2017-09-19 16:30                   ` Hartmut Goebel
  2017-10-06 12:22                   ` Hartmut Goebel
  0 siblings, 2 replies; 21+ messages in thread
From: 宋文武 @ 2017-09-07 13:38 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel, Thomas Danckaert

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> writes:

> Am 04.09.2017 um 09:44 schrieb Thomas Danckaert:
>> Just to make sure, the idea is to:
>>
>>  1. apply 宋文武's qtbase patch adjusting the paths of various qt components
>>
>>  2. apply your 2 patches for qtscintilla and qtwebkit
>>
>>  3. adjust kde.scm so packages in there build correctly?
>
> ACK from my side.

Yes, and here are my updates on the paths issue of pkg-config files and
qwt:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-qt-Fix-install-paths-in-submodules.patch --]
[-- Type: text/x-patch, Size: 6470 bytes --]

From e8a252f5037b77f44a1516c715bbd437a6e23cb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Sun, 3 Sep 2017 17:38:57 +0800
Subject: [PATCH 2/3] gnu: qt: Fix install paths in submodules.

Before this, the paths in pkg-config (.pc) and libtool (.la) files of
submodules are all pointing to qtbase.

* gnu/packages/qt.scm (qtbase)[native-inputs]: Move 'which' to
'propagated-inputs'.
[arguments]: Rename 'patch-mkspecs' phase to 'patch-mkspecs' and patch
more qmake spec files there.
(qtsvg)[arguments]: Add 'configure-qmake' phase.
---
 gnu/packages/qt.scm | 86 +++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 63 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 80508f058..a41aa4fbb 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -375,7 +375,8 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                 #t))))
     (build-system gnu-build-system)
     (propagated-inputs
-     `(("mesa" ,mesa)))
+     `(("mesa" ,mesa)
+       ("which" ,(@ (gnu packages base) which))))
     (inputs
      `(("alsa-lib" ,alsa-lib)
        ("cups" ,cups)
@@ -426,8 +427,7 @@ developers using C++ or QML, a CSS & JavaScript like language.")
        ("perl" ,perl)
        ("pkg-config" ,pkg-config)
        ("python" ,python-2)
-       ("ruby" ,ruby)
-       ("which" ,(@ (gnu packages base) which))))
+       ("ruby" ,ruby)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -491,10 +491,11 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                              '("-no-sse2"))
                        "-no-mips_dsp"
                        "-no-mips_dspr2")))))
-         (add-after 'install 'patch-qt_config.prf
+         (add-after 'install 'patch-mkspecs
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (mkspecs (string-append out "/lib/qt5/mkspecs"))
+                    (archdata (string-append out "/lib/qt5"))
+                    (mkspecs (string-append archdata "/mkspecs"))
                     (qt_config.prf (string-append
                                     mkspecs "/features/qt_config.prf")))
                ;; For each Qt module, let `qmake' uses search paths in the
@@ -508,6 +509,20 @@ developers using C++ or QML, a CSS & JavaScript like language.")
                   "$$clean_path($$replace(dir, mkspecs/modules, ../../lib))")
                  (("\\$\\$\\[QT_INSTALL_BINS\\]")
                   "$$clean_path($$replace(dir, mkspecs/modules, ../../bin))"))
+
+               ;; Searches Qt tools in the current PATH instead of QT_HOST_BINS.
+               (substitute* (string-append mkspecs "/features/qt_functions.prf")
+                 (("cmd = \\$\\$\\[QT_HOST_BINS\\]/\\$\\$2")
+                  "cmd = $$system(which $${2}.pl 2>/dev/null || which $${2})"))
+
+               ;; Resolve qmake spec files within qtbase by absolute paths.
+               (substitute*
+                   (map (lambda (file)
+                          (string-append mkspecs "/features/" file))
+                        '("device_config.prf" "moc.prf" "qt_build_config.prf"
+                          "qt_config.prf" "winrt/package_manifest.prf"))
+                 (("\\$\\$\\[QT_HOST_DATA/get\\]") archdata)
+                 (("\\$\\$\\[QT_HOST_DATA/src\\]") archdata))
                #t))))))
     (native-search-paths
      (list (search-path-specification
@@ -553,26 +568,51 @@ developers using C++ or QML, a CSS & JavaScript like language.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (replace 'configure
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               ;; Valid QT_BUILD_PARTS variables are:
-               ;; libs tools tests examples demos docs translations
-               (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests"
-                               (string-append "PREFIX=" out))))))
-         (add-before 'install 'fix-Makefiles
+         (add-before 'configure 'configure-qmake
            (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out    (assoc-ref outputs "out"))
-                   (qtbase (assoc-ref inputs "qtbase")))
-               (substitute* (find-files "." "Makefile")
-                            (((string-append "INSTALL_ROOT)" qtbase))
-                             (string-append "INSTALL_ROOT)" out)))
+             (let* ((out (assoc-ref outputs "out"))
+                    (qtbase (assoc-ref inputs "qtbase"))
+                    (tmpdir (string-append (getenv "TMPDIR")))
+                    (qmake (string-append tmpdir "/qmake"))
+                    (qt.conf (string-append tmpdir "/qt.conf")))
+               ;; Use qmake with a customized qt.conf to override install
+               ;; paths to $out.
+               (symlink (which "qmake") qmake)
+               (setenv "PATH" (string-append tmpdir ":" (getenv "PATH")))
+               (with-output-to-file qt.conf
+                 (lambda ()
+                   (format #t "[Paths]
+Prefix=~a
+ArchData=lib/qt5
+Data=share/qt5
+Documentation=share/doc/qt5
+Headers=include/qt5
+Libraries=lib
+LibraryExecutables=lib/qt5/libexec
+Binaries=bin
+Tests=tests
+Plugins=lib/qt5/plugins
+Imports=lib/qt5/imports
+Qml2Imports=lib/qt5/qml
+Translations=share/qt5/translations
+Settings=etc/xdg
+Examples=share/doc/qt5/examples
+HostPrefix=~a
+HostData=lib/qt5
+HostBinaries=bin
+HostLibraries=lib
+" out out)))
                #t)))
-            (add-before 'check 'set-display
-              (lambda _
-                ;; make Qt render "offscreen", required for tests
-                (setenv "QT_QPA_PLATFORM" "offscreen")
-                #t)))))))
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Valid QT_BUILD_PARTS variables are:
+             ;; libs tools tests examples demos docs translations
+             (zero? (system* "qmake" "QT_BUILD_PARTS = libs tools tests"))))
+         (add-before 'check 'set-display
+           (lambda _
+             ;; make Qt render "offscreen", required for tests
+             (setenv "QT_QPA_PLATFORM" "offscreen")
+             #t)))))))
 
 (define-public qtimageformats
   (package (inherit qtsvg)
-- 
2.13.3


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0003-gnu-qwt-Adjust-installation-directory-layout.patch --]
[-- Type: text/x-patch, Size: 2492 bytes --]

From b290321dc6e4c2db731cae31f78988958700c018 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Thu, 7 Sep 2017 21:19:54 +0800
Subject: [PATCH 3/3] gnu: qwt: Adjust installation directory layout.

* gnu/packages/qt.scm (qwt)[arguments]<#:phases>: Modify 'qwtconfig.pri' to
use a directory layout that matching qtbase.  Modify 'doc/doc.pro' to remove
the misplaced installation of man pages.  Rename phase 'install-documentation'
to 'install-man-pages'.
---
 gnu/packages/qt.scm | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a41aa4fbb..8070e279f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -1588,11 +1588,27 @@ securely.  It will not store any data unencrypted unless explicitly requested.")
      (modify-phases %standard-phases
        (replace 'configure
          (lambda* (#:key outputs #:allow-other-keys)
-           (let ((out (assoc-ref outputs "out")))
+           (let* ((out (assoc-ref outputs "out"))
+                  (docdir (string-append out "/share/doc/qwt"))
+                  (incdir (string-append out "/include/qwt"))
+                  (pluginsdir (string-append out "/lib/qt5/plugins/designer"))
+                  (featuresdir (string-append out "/lib/qt5/mkspecs/features")))
              (substitute* '("qwtconfig.pri")
-               (("/usr/local/qwt-\\$\\$QWT\\_VERSION") out))
+               (("^(\\s*QWT_INSTALL_PREFIX)\\s*=.*" _ x)
+                (format #f "~a = ~a\n" x out))
+               (("^(QWT_INSTALL_DOCS)\\s*=.*" _ x)
+                (format #f "~a = ~a\n" x docdir))
+               (("^(QWT_INSTALL_HEADERS)\\s*=.*" _ x)
+                (format #f "~a = ~a\n" x incdir))
+               (("^(QWT_INSTALL_PLUGINS)\\s*=.*" _ x)
+                (format #f "~a = ~a\n" x pluginsdir))
+               (("^(QWT_INSTALL_FEATURES)\\s*=.*" _ x)
+                (format #f "~a = ~a\n" x featuresdir)))
+             (substitute* '("doc/doc.pro")
+               ;; We'll install them in the 'install-man-pages' phase.
+               (("^unix:doc\\.files.*") ""))
              (zero? (system* "qmake")))))
-       (add-after 'install 'install-documentation
+       (add-after 'install 'install-man-pages
          (lambda* (#:key outputs #:allow-other-keys)
            (let* ((out (assoc-ref outputs "out"))
                   (man (string-append out "/share/man")))
-- 
2.13.3


[-- Attachment #4: Type: text/plain, Size: 78 bytes --]


The 0001-gnu-qtbase-Use-a-more-standard-directory-layout.patch is
unchanged.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-07 13:38                 ` 宋文武
@ 2017-09-19 16:30                   ` Hartmut Goebel
  2017-09-22 12:59                     ` Hartmut Goebel
  2017-10-06 12:22                   ` Hartmut Goebel
  1 sibling, 1 reply; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-19 16:30 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

Hi,

Am 07.09.2017 um 15:38 schrieb 宋文武:
> Yes, and here are my updates on the paths issue of pkg-config files and
> qwt:

I did put your patches and mine in a new branch "wip-qt-paths". Building
these (based on master from 2017-09-17 12:08:48 86805c1ba39) passed.

I found some things missing in may packages, so I suggest implementing
this first on the wip-qt-paths branch to avoid unnecessary rebuilds:

- QCH

- PythonModuleGeneration

I will look at this and push further changes to the "wip-qt-paths" branch.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-19 16:30                   ` Hartmut Goebel
@ 2017-09-22 12:59                     ` Hartmut Goebel
  0 siblings, 0 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-09-22 12:59 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

Am 19.09.2017 um 18:30 schrieb Hartmut Goebel:
> I found some things missing in may packages, so I suggest implementing
> this first on the wip-qt-paths branch to avoid unnecessary rebuilds:
>
> - QCH
>
> - PythonModuleGeneration
>
> I will look at this and push further changes to the "wip-qt-paths" branch.

I now pushed this branch. Feel free to fix whatever you mean ins necessary.

I retired from building QCH for all packages, since for
"extra-cmake-modules" there is he comment: to save space, we do not add
these inputs.

I also retired from activating PythonModuleGeneration, since the first
package I treid ended up requiring python, python-sip, python2, and
clang. THen I stopped :-)

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: QT install and search paths
  2017-09-07 13:38                 ` 宋文武
  2017-09-19 16:30                   ` Hartmut Goebel
@ 2017-10-06 12:22                   ` Hartmut Goebel
  1 sibling, 0 replies; 21+ messages in thread
From: Hartmut Goebel @ 2017-10-06 12:22 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel, Thomas Danckaert

Hallo,

I just posted to patch-series for this.

- 28719 is your (unchanged) and my patches for changing the directory layout
- 28720 are enhancements to KDE framework

Please review these patches. Thanks!

Both series are available on the "wip-qt-paths" branch.

I suggest to push both series to master in one rush to avoid unnecessary
rebuilds.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28719
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28720

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-10-06 12:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 18:25 QT install and search paths Hartmut Goebel
2017-08-24 11:37 ` Thomas Danckaert
2017-08-25  7:32   ` Hartmut Goebel
2017-08-24 11:59 ` 宋文武
2017-08-25  7:06   ` Hartmut Goebel
2017-08-25 12:40     ` 宋文武
2017-08-25 16:04       ` 宋文武
2017-08-26  8:31         ` Hartmut Goebel
2017-08-27 16:49         ` Hartmut Goebel
2017-09-02 16:40           ` Hartmut Goebel
2017-09-03  4:58             ` 宋文武
2017-09-03 11:46               ` 宋文武
2017-09-03 12:39                 ` Hartmut Goebel
2017-09-03 14:04                 ` Hartmut Goebel
2017-09-03 14:46                   ` 宋文武
2017-09-04  7:44             ` Thomas Danckaert
2017-09-04  9:16               ` Hartmut Goebel
2017-09-07 13:38                 ` 宋文武
2017-09-19 16:30                   ` Hartmut Goebel
2017-09-22 12:59                     ` Hartmut Goebel
2017-10-06 12:22                   ` Hartmut Goebel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).