Bug 36826 - [Qt] QtWebkit.pc is broken
: [Qt] QtWebkit.pc is broken
Status: CLOSED FIXED
: WebKit
Tools / Tests
: 528+ (Nightly build)
: PC Linux
: P2 Critical
Assigned To:
:
: Qt, QtTriaged
:
: 35784
  Show dependency treegraph
 
Reported: 2010-03-30 08:00 PST by
Modified: 2010-06-01 07:35 PST (History)


Attachments
broken pkgconfig file (704 bytes, text/plain)
2010-03-30 08:01 PST, Fathi Boudra
no flags Details
Patch that might help (1.60 KB, patch)
2010-03-30 11:02 PST, Jocelyn Turcotte
no flags Review Patch | Details | Formatted Diff | Diff
correct QtWebKit.pc generated from Qt source (1.04 KB, text/plain)
2010-04-05 00:30 PST, Fathi Boudra
no flags Details
Patch (1.08 KB, patch)
2010-06-01 05:43 PST, Jocelyn Turcotte
hausmann: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-03-30 08:00:32 PST
QtWebKit.pc is broken.

See libdir and Libs.private values:
libdir=${prefi/usr/lib
Libs.private: -L../JavaScriptCore -L/usr/X11/usr/lib -L/u/usr/lib -ljscore -lXrender -lsqlite3 -lphonon -lQtXmlPatterns -lQtGui -lQtNetwork -lQtCore -lpthread -lXext -lX11 -lm

Same code is used to generate the pkgconfig file on Qt 4.6.2 but is not reproducible with QtWebKit from Qt 4.6.2 source code.
------- Comment #1 From 2010-03-30 08:01:49 PST -------
Created an attachment (id=52039) [details]
broken pkgconfig file
------- Comment #2 From 2010-03-30 11:02:25 PST -------
Created an attachment (id=52055) [details]
Patch that might help

Can you try with this patch in trunk?
------- Comment #3 From 2010-03-31 08:22:35 PST -------
(In reply to comment #2)
> Created an attachment (id=52055) [details] [details]
> Patch that might help
> 
> Can you try with this patch in trunk?

Sorry it won't work, against what I thought, LIBS_PRIVATE is only available for static library targets.

By looking at pkg-config's documentation, Libs.private is used when the application would link QtWebKit statically, which we want to drop support to be able to build JavaScriptCore as a static library to use aggressive optimization exclusively for it.

What exactly is the problem at the end?
Do you need static linking against QtWebKit?
Can you omit the Libs.private line when generating the .pc file?
------- Comment #4 From 2010-04-05 00:26:49 PST -------
some values are truncated.

see libdir value: "${prefi/usr/lib"
it should be "${prefix}/lib" instead of "${prefi/usr/lib".

same for Libs.private, see "-L/usr/X11/usr/lib" and "-L/u/usr/lib" strings.
it should be "-L/usr/lib/X11" and "-L/usr/lib".

That's the problem.
------- Comment #5 From 2010-04-05 00:30:04 PST -------
Created an attachment (id=52519) [details]
correct QtWebKit.pc generated from Qt source

correct QtWebKit.pc generated from Qt 4.6.2 source
------- Comment #6 From 2010-05-30 04:30:01 PST -------
*** Bug 39573 has been marked as a duplicate of this bug. ***
------- Comment #7 From 2010-05-30 04:33:26 PST -------
From my duplicate bug report:

The following commands in WebCore/WebCore.pro can corrupt QtWebKit.pc:
lib_replace.match = $$DESTDIR
lib_replace.replace = $$[QT_INSTALL_LIBS]
QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace

The problem is that .match/.replace doesn't replace plain strings but regular expressions.

If $$DESTDIR == "../lib", the resulting command is:
sed -e "s,../lib,/usr/lib,g" "../lib/pkgconfig/QtWebKit.pc" >"/build/buildd/qtwebkit-4.7~beta1/debian/tmp/usr/lib/pkgconfig/QtWebKit.pc"

"." matches any character so "libdir=${prefix}/lib" is being replaced by "libdir=${prefi/usr/lib".

I'm not sure why this path replacement is needed at all.
------- Comment #8 From 2010-06-01 05:43:32 PST -------
Created an attachment (id=57532) [details]
Patch

Thanks for the investigation, this patch should fix the problem.
------- Comment #9 From 2010-06-01 06:26:15 PST -------
(From update of attachment 57532 [details])
Landing by hand
------- Comment #10 From 2010-06-01 06:26:59 PST -------
Committed r60475: <http://trac.webkit.org/changeset/60475>
------- Comment #11 From 2010-06-01 06:28:26 PST -------
Revision r60475 cherry-picked into qtwebkit-2.0 with commit 9a83f22bc41a2016b6bbf495bfd32b3a659038c8
------- Comment #12 From 2010-06-01 07:35:34 PST -------
(In reply to comment #11)
> Revision r60475 cherry-picked into qtwebkit-2.0 with commit 9a83f22bc41a2016b6bbf495bfd32b3a659038c8

Sorry, the correct sha1 in 19f3a076250e739dde943683f5b3abd44ff916be