diff mbox

[3/3] qt: tune .pc files after installation in staging directory

Message ID 1343167832-14198-3-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni July 24, 2012, 10:10 p.m. UTC
The Qt configuration and installation process is a bit strange, and it
leads the .pc files to contain absolute paths to the staging
directory, while it should only contains paths relative to the staging
directory, because pkg-config already adds the path of the sysroot
automatically to the headers and libraries locations.

This allows the 'pkg-config --cflags' results for Qt libraries to be
correct.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/qt/qt.mk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Simon Dawson July 25, 2012, 7:26 a.m. UTC | #1
On 24 July 2012 23:10, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> This allows the 'pkg-config --cflags' results for Qt libraries to be
> correct.

Acked-by: Simon Dawson <spdawson@gmail.com>
Thomas Petazzoni July 25, 2012, 7:43 a.m. UTC | #2
Le Wed, 25 Jul 2012 08:26:43 +0100,
Simon Dawson <spdawson@gmail.com> a écrit :

> On 24 July 2012 23:10, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > This allows the 'pkg-config --cflags' results for Qt libraries to be
> > correct.
> 
> Acked-by: Simon Dawson <spdawson@gmail.com>

Is this an Acked-by solely for PATCH 3/3, or for all patches?

Thanks for looking at them!

Thomas
Simon Dawson July 25, 2012, 7:57 a.m. UTC | #3
Hi Thomas,

On 25 July 2012 08:43, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Is this an Acked-by solely for PATCH 3/3, or for all patches?

Just for PATCH 3/3. I'm still testing PATCH 1/3 and PATCH 2/3.

Simon.
diff mbox

Patch

diff --git a/package/qt/qt.mk b/package/qt/qt.mk
index feb0d6f..3b40ea4 100644
--- a/package/qt/qt.mk
+++ b/package/qt/qt.mk
@@ -577,13 +577,20 @@  endef
 # everything in the STAGING_DIR), we move host programs such as qmake,
 # rcc or uic to the HOST_DIR so that they are available at the usual
 # location. A qt.conf file is generated to make sure that all host
-# programs still find all files they need.
+# programs still find all files they need. The .pc files are tuned to
+# remove the sysroot path from them, since pkg-config already adds it
+# automatically.
 define QT_INSTALL_STAGING_CMDS
 	$(MAKE) -C $(@D) install
 	mkdir -p $(HOST_DIR)/usr/bin
 	mv $(addprefix $(STAGING_DIR)/usr/bin/,$(QT_HOST_PROGRAMS)) $(HOST_DIR)/usr/bin
 	ln -sf $(STAGING_DIR)/usr/mkspecs $(HOST_DIR)/usr/mkspecs
 	$(QT_INSTALL_QT_CONF)
+	for i in moc uic rcc lupdate lrelease ; do \
+		$(SED) "s,^$${i}_location=.*,$${i}_location=$(HOST_DIR)/usr/bin/$${i}," \
+			$(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc ; \
+	done
+	$(SED) "s,$(STAGING_DIR)/,,g" $(STAGING_DIR)/usr/lib/pkgconfig/Qt*.pc
 endef
 
 # Library installation