summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-5.0.2/0009-qt_module-Fix-pkgconfig-replacement.patch
blob: a9f66b7cb77555ea82047319fbace8eb5bf434c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From 0bd37923dec93270066fc4362db7e443475a4b06 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sat, 27 Apr 2013 23:15:37 +0200
Subject: [PATCH 09/11] qt_module: Fix pkgconfig replacement

* in situation like this:
  QT_SYSROOT:/OE/oe-core/tmp-eglibc/sysroots/qemuarm
  QT_INSTALL_LIBS:/OE/oe-core/tmp-eglibc/sysroots/qemuarm/usr/lib
  QT_INSTALL_LIBS/raw:/usr/lib
  QT_INSTALL_LIBS/get:/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.0-r0.0/build/lib

  I don't want the replacement like this:
  sed
    -e "s,/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.0-r0.0/build/include,/usr/include/qt5,g"
    -e "s,/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.0-r0.0/build/lib,/usr/lib,g"
    "../../lib/pkgconfig/Qt5Core.pc"
    >"/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.0-r0.0/image/OE/oe-core/tmp-eglibc/sysroots/qemuarm/usr/lib/pkgconfig/Qt5Core.pc"
  because that way I'll end with -L/usr/lib in .pc file which is
  cross-compile unfriendly, keeping ${libdir}/${includedir} works better
  in my case

Change-Id: Id0f9143c012b7fe7bb7bab0055687f4e0517f653
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 mkspecs/features/qt_module.prf | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 1132943..7fbfd8d 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -128,18 +128,30 @@ unix|win32-g++* {
       rplbase = $$dirname(_QMAKE_SUPER_CACHE_)/[^/][^/]*
    else: \
       rplbase = $$MODULE_BASE_OUTDIR
+   pkgconfig_include_replace.match = $$rplbase/include
+   pkgconfig_include_replace.replace = "\$$\\{includedir}"
+   pkgconfig_lib_replace.match = $$rplbase/lib
+   pkgconfig_lib_replace.replace = "\$$\\{libdir}"
    include_replace.match = $$rplbase/include
    include_replace.replace = $$[QT_INSTALL_HEADERS/raw]
    lib_replace.match = $$rplbase/lib
    lib_replace.replace = $$[QT_INSTALL_LIBS/raw]
-   QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace
+   lafile_replace.match = $$rplbase
+   lafile_replace.replace = "=$$[QT_INSTALL_PREFIX/raw]"
+
+   !isEmpty(SYSROOT): \
+      rplbase = $$[SYSROOT] \
+      lafile_replace.match = $$rplbase \
+      lafile_replace.replace = "=" \
+
+   QMAKE_PKGCONFIG_INSTALL_REPLACE += pkgconfig_include_replace pkgconfig_lib_replace
    QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace
 }
 
 unix {
    CONFIG += create_libtool explicitlib
    QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS/raw]
-   QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace
+   QMAKE_LIBTOOL_INSTALL_REPLACE += lafile_replace
 }
 
 unix|win32-g++* {
-- 
1.8.2.1