Bug 36826 - [Qt] QtWebkit.pc is broken
Summary: [Qt] QtWebkit.pc is broken
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Critical
Assignee: Jocelyn Turcotte
Keywords: Qt, QtTriaged
: 39573 (view as bug list)
Depends on:
Blocks: 35784
  Show dependency treegraph
Reported: 2010-03-30 08:00 PDT by Fathi Boudra
Modified: 2010-06-01 07:35 PDT (History)
5 users (show)

See Also:

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

Note You need to log in before you can comment on or make changes to this bug.
Description Fathi Boudra 2010-03-30 08:00:32 PDT
QtWebKit.pc is broken.

See libdir and Libs.private values:
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 Fathi Boudra 2010-03-30 08:01:49 PDT
Created attachment 52039 [details]
broken pkgconfig file
Comment 2 Jocelyn Turcotte 2010-03-30 11:02:25 PDT
Created attachment 52055 [details]
Patch that might help

Can you try with this patch in trunk?
Comment 3 Jocelyn Turcotte 2010-03-31 08:22:35 PDT
(In reply to comment #2)
> Created an attachment (id=52055) [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 Fathi Boudra 2010-04-05 00:26:49 PDT
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 Fathi Boudra 2010-04-05 00:30:04 PDT
Created attachment 52519 [details]
correct QtWebKit.pc generated from Qt source

correct QtWebKit.pc generated from Qt 4.6.2 source
Comment 6 Felix Geyer 2010-05-30 04:30:01 PDT
*** Bug 39573 has been marked as a duplicate of this bug. ***
Comment 7 Felix Geyer 2010-05-30 04:33:26 PDT
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]

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 Jocelyn Turcotte 2010-06-01 05:43:32 PDT
Created attachment 57532 [details]

Thanks for the investigation, this patch should fix the problem.
Comment 9 Simon Hausmann 2010-06-01 06:26:15 PDT
Comment on attachment 57532 [details]

Landing by hand
Comment 10 Simon Hausmann 2010-06-01 06:26:59 PDT
Committed r60475: <http://trac.webkit.org/changeset/60475>
Comment 11 Simon Hausmann 2010-06-01 06:28:26 PDT
Revision r60475 cherry-picked into qtwebkit-2.0 with commit 9a83f22bc41a2016b6bbf495bfd32b3a659038c8
Comment 12 Simon Hausmann 2010-06-01 07:35:34 PDT
(In reply to comment #11)
> Revision r60475 cherry-picked into qtwebkit-2.0 with commit 9a83f22bc41a2016b6bbf495bfd32b3a659038c8

Sorry, the correct sha1 in 19f3a076250e739dde943683f5b3abd44ff916be