Try to update wkhtmltopdf

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Try to update wkhtmltopdf

Sascha Manns-3
Hello list,

currently i'm trying to upgrade wkhtmltopdf. The build breaks with:

[   68s] g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT
-DVERSION=0.12.4 -DFULL_VERSION=0.12.4 -DBUILDING_DLL -DQT_NO_DEBUG
-DQT_WEBKIT_LIB -DQT_SVG_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB
-DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore
-I/usr/include/QtNetwork -I/usr/include/QtGui
-I/usr/include/QtXmlPatterns -I/usr/include/QtSvg
-I/usr/include/QtWebKit -I/usr/include -I../../include -I. -o outline.o
../lib/outline.cc
[   68s] ../lib/pdfsettings.cc: In function 'QString
wkhtmltopdf::settings::unitRealToStr(const UnitReal&, bool*)':
[   68s] ../lib/pdfsettings.cc:308:3: warning: this 'if' clause does
not guard... [-Wmisleading-indentation]
[   68s]    if (ok) *ok=false; break;
[   68s]    ^~
[   68s] ../lib/pdfsettings.cc:308:22: note: ...this statement, but the
latter is misleadingly indented as if it is guarded by the 'if'
[   68s]    if (ok) *ok=false; break;
[   68s]                       ^~~~~
[   68s] ../lib/multipageloader.cc: In constructor
'wkhtmltopdf::ResourceObject::ResourceObject(wkhtmltopdf::MultiPageLoad
erPrivate&, const QUrl&, const wkhtmltopdf::settings::LoadPage&)':
[   68s] ../lib/multipageloader.cc:219:10: error: 'class
wkhtmltopdf::MyQWebPage' has no member named 'setDevicePixelRatio'
[   68s]   webPage.setDevicePixelRatio(devicePixelRatio); // Fix CSS
media queries (does not affect anything else).
[   68s]           ^~~~~~~~~~~~~~~~~~~
[   68s] g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT
-DVERSION=0.12.4 -DFULL_VERSION=0.12.4 -DBUILDING_DLL -DQT_NO_DEBUG
-DQT_WEBKIT_LIB -DQT_SVG_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB
-DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore
-I/usr/include/QtNetwork -I/usr/include/QtGui
-I/usr/include/QtXmlPatterns -I/usr/include/QtSvg
-I/usr/include/QtWebKit -I/usr/include -I../../include -I. -o
tocstylesheet.o ../lib/tocstylesheet.cc
[   68s] g++ -c -pipe -O2 -Wall -W -D_REENTRANT -fPIC -DQT_WEBKIT
-DVERSION=0.12.4 -DFULL_VERSION=0.12.4 -DBUILDING_DLL -DQT_NO_DEBUG
-DQT_WEBKIT_LIB -DQT_SVG_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB
-DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore
-I/usr/include/QtNetwork -I/usr/include/QtGui
-I/usr/include/QtXmlPatterns -I/usr/include/QtSvg
-I/usr/include/QtWebKit -I/usr/include -I../../include -I. -o
imagesettings.o ../lib/imagesettings.cc
[   68s] make[1]: *** [Makefile:382: multipageloader.o] Error 1
[   68s] make[1]: *** Waiting for unfinished jobs....
[   70s] make[1]: Leaving directory
'/home/abuild/rpmbuild/BUILD/wkhtmltox-0.12.4/src/lib'
[   70s] make: *** [Makefile:41: sub-src-lib-make_default-ordered]
Error 2
[   70s] error: Bad exit status from /var/tmp/rpm-tmp.zo01c0 (%build)

The full Log is on https://build.opensuse.org/build/Documentation:Publi
can/openSUSE_Tumbleweed/i586/wkhtmltopdf/_log

Maybe anyone knows what the error is there?

Greetings
Sascha

--
Sascha Manns | openSUSE Member
Email: [hidden email] | Blog: http://saigkill.tuxfamily.org
GPG: 0x62ECD463
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Philipp Thomas
* Sascha Manns ([hidden email]) [20170322 22:42]:

> [   68s] ../lib/multipageloader.cc:219:10: error: 'class
> wkhtmltopdf::MyQWebPage' has no member named 'setDevicePixelRatio'

This is the actual error. This needs someone experienced in C++ to fix the
sourcers.

Philipp

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Philipp Thomas
* Philipp Thomas ([hidden email]) [20170323 07:21]:

> This is the actual error. This needs someone experienced in C++ to fix the
> sourcers.
  s/sourcers/sources/

Found the real reason: upstream decided to use their modified version of Qt4
(part of the wkhtmltopdf sources) and one of the changes they made was
adding setDevicePixelRatio to QWebPage (see
https://bitbucket.org/wkhtmltopdf/qt/commits/c0cfa03).

Judging from this change I'd guess they did other changes to their version of
Qt4 so building with the system supplied qt4 is prone to break at other places
too.

I'm neither a Qt nor a good enough C++ programmer so I can't judge whether
the wkhtmltopdf sources could be changed in a way that it would compile with
vanilla Qt4.  So that is a task for either upstream or someone else versed
in C++ and Qt.

hth
Philipp
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Sascha Manns-3
Hi Philipp,

Am Donnerstag, den 23.03.2017, 10:28 +0100 schrieb Philipp Thomas:

> * Philipp Thomas ([hidden email]) [20170323 07:21]:
>
> > This is the actual error. This needs someone experienced in C++ to
> > fix the
> > sourcers.
>
>   s/sourcers/sources/
>
> Found the real reason: upstream decided to use their modified version
> of Qt4
> (part of the wkhtmltopdf sources) and one of the changes they made
> was
> adding setDevicePixelRatio to QWebPage (see
> https://bitbucket.org/wkhtmltopdf/qt/commits/c0cfa03).
>
> Judging from this change I'd guess they did other changes to their
> version of
> Qt4 so building with the system supplied qt4 is prone to break at
> other places
> too.
>
> I'm neither a Qt nor a good enough C++ programmer so I can't judge
> whether
> the wkhtmltopdf sources could be changed in a way that it would
> compile with
> vanilla Qt4.  So that is a task for either upstream or someone else
> versed
> in C++ and Qt.
Thanks for helping out. I'll check this out.
Greetings
Sascha
--
Sascha Manns | openSUSE Member
Email: [hidden email] | Blog: http://saigkill.tuxfamily.org
GPG: 0x62ECD463
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Luigi Baldoni
In reply to this post by Philipp Thomas
Philipp Thomas wrote
* Philipp Thomas ([hidden email]) [20170323 07:21]:

> This is the actual error. This needs someone experienced in C++ to fix the
> sourcers.
  s/sourcers/sources/

Found the real reason: upstream decided to use their modified version of Qt4
(part of the wkhtmltopdf sources) and one of the changes they made was
adding setDevicePixelRatio to QWebPage (see
https://bitbucket.org/wkhtmltopdf/qt/commits/c0cfa03).

Judging from this change I'd guess they did other changes to their version of
Qt4 so building with the system supplied qt4 is prone to break at other places
too.

I'm neither a Qt nor a good enough C++ programmer so I can't judge whether
the wkhtmltopdf sources could be changed in a way that it would compile with
vanilla Qt4.  So that is a task for either upstream or someone else versed
in C++ and Qt.
Since setDevicePixelRatio is a method backported from Qt5, wouldn't it
make more sense to try and build the whole package against the latter?

Regards
Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Klaas Freitag
Hi,

Am 23.03.2017 um 15:14 schrieb Luigi Baldoni:
>> I'm neither a Qt nor a good enough C++ programmer so I can't judge whether
>> the wkhtmltopdf sources could be changed in a way that it would compile
>> with
>> vanilla Qt4.  So that is a task for either upstream or someone else versed
>> in C++ and Qt.
>
> Since setDevicePixelRatio is a method backported from Qt5, wouldn't it
> make more sense to try and build the whole package against the latter?
>

It would, since Qt4 is not going to be maintained for long any more. But
that will require significant code changes, and you should check with
upstream. Maybe they have a qt5 base branch.

regards

Klaas
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Sascha Manns-3
Hi Klaas,

Am Donnerstag, den 23.03.2017, 16:06 +0100 schrieb Klaas Freitag:

> Hi,
>
> Am 23.03.2017 um 15:14 schrieb Luigi Baldoni:
> > > I'm neither a Qt nor a good enough C++ programmer so I can't
> > > judge whether
> > > the wkhtmltopdf sources could be changed in a way that it would
> > > compile
> > > with
> > > vanilla Qt4.  So that is a task for either upstream or someone
> > > else versed
> > > in C++ and Qt.
> >
> > Since setDevicePixelRatio is a method backported from Qt5, wouldn't
> > it
> > make more sense to try and build the whole package against the
> > latter?
> >
>
> It would, since Qt4 is not going to be maintained for long any more.
> But 
> that will require significant code changes, and you should check
> with 
> upstream. Maybe they have a qt5 base branch.
I asked upstream about that. Also i'm experimenting locally with QT5
dependencies.
Thanks for the infos so far :-)

Greetings
Sascha
--
Sascha Manns | openSUSE Member
Email: [hidden email] | Blog: http://saigkill.tuxfamily.org
GPG: 0x62ECD463
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Sascha Manns-3
Hello List,

Am Donnerstag, den 23.03.2017, 17:12 +0100 schrieb Sascha Manns:

> Hi Klaas,
>
> Am Donnerstag, den 23.03.2017, 16:06 +0100 schrieb Klaas Freitag:
> > Hi,
> >
> > Am 23.03.2017 um 15:14 schrieb Luigi Baldoni:
> > > > I'm neither a Qt nor a good enough C++ programmer so I can't
> > > > judge whether
> > > > the wkhtmltopdf sources could be changed in a way that it would
> > > > compile
> > > > with
> > > > vanilla Qt4.  So that is a task for either upstream or someone
> > > > else versed
> > > > in C++ and Qt.
> > >
> > > Since setDevicePixelRatio is a method backported from Qt5,
> > > wouldn't
> > > it
> > > make more sense to try and build the whole package against the
> > > latter?
> > >
> >
> > It would, since Qt4 is not going to be maintained for long any
> > more.
> > But 
> > that will require significant code changes, and you should check
> > with 
> > upstream. Maybe they have a qt5 base branch.
>
> I asked upstream about that. Also i'm experimenting locally with QT5
> dependencies.
> Thanks for the infos so far :-)
Upstream already answered. I added the proposed patch 
https://github.com/wkhtmltopdf/wkhtmltopdf/commit/af95531eabb212ae16a9f
b689bb25a767eb580bc to the OBS 
https://build.opensuse.org/package/view_file/Documentation:Publican/wkh
tmltopdf/wkhtmltox-0.12.4-unpatched-qt.patch?expand=1

I added the patch to the spec and tried to build.

But i can use -p0  and -p1 but in any case i'm getting:

+ echo 'Patch #1 (wkhtmltox-0.12.4-unpatched-qt.patch):'
[   66s] Patch #1 (wkhtmltox-0.12.4-unpatched-qt.patch):
[   66s] + /usr/bin/patch --no-backup-if-mismatch -p0 --fuzz=0
[   66s] can't find file to patch at input line 3
[   66s] Perhaps you used the wrong -p or --strip option?

Maybe the patch isn't correct set?

Greetings
Sascha
--
Sascha Manns | openSUSE Member
Email: [hidden email] | Blog: http://saigkill.tuxfamily.org
GPG: 0x62ECD463
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Karl Cheng
On 24 March 2017 at 03:53, Sascha Manns <[hidden email]> wrote:
> Maybe the patch isn't correct set?

The patch has the wrong directory name I think.

When patch is run, it is already in the "wkhtmltox-0.12.4" directory,
so the first two directory names should be ignored. Instead of:

```
--- a/wkhtmltox-0.12.4/src/lib/multipageloader.cc
+++ b/wkhtmltox-0.12.4/src/lib/multipageloader.cc
```

Use the following with -p1:

```
--- a/src/lib/multipageloader.cc
+++ b/src/lib/multipageloader.cc
```

--
- Karl Cheng (Qantas94Heavy)
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Philipp Thomas
* Karl Cheng ([hidden email]) [20170324 02:04]:

> Use the following with -p1:
>
> ```
> --- a/src/lib/multipageloader.cc
> +++ b/src/lib/multipageloader.cc

You can even use

 --- src/lib/multipageloader.cc
 +++ src/lib/multipageloader.cc

and just pass no option to %patch. Patch itself doesn't care for the '---'
line and onlyu looks at the '+++' one to determine the file to patch.

Philipp
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Ferdinand Thiessen
In reply to this post by Karl Cheng
Or use patch -p2

So it will strip the first two path parts from the path.

Am 24. März 2017 02:04:11 MEZ schrieb Karl Cheng <[hidden email]>:

>On 24 March 2017 at 03:53, Sascha Manns <[hidden email]> wrote:
>> Maybe the patch isn't correct set?
>
>The patch has the wrong directory name I think.
>
>When patch is run, it is already in the "wkhtmltox-0.12.4" directory,
>so the first two directory names should be ignored. Instead of:
>
>```
>--- a/wkhtmltox-0.12.4/src/lib/multipageloader.cc
>+++ b/wkhtmltox-0.12.4/src/lib/multipageloader.cc
>```
>
>Use the following with -p1:
>
>```
>--- a/src/lib/multipageloader.cc
>+++ b/src/lib/multipageloader.cc
>```
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Try to update wkhtmltopdf

Sascha Manns-3
In reply to this post by Karl Cheng
Hello Karl,

Am Freitag, den 24.03.2017, 12:04 +1100 schrieb Karl Cheng:
> On 24 March 2017 at 03:53, Sascha Manns <[hidden email]>
> wrote:
> > Maybe the patch isn't correct set?
>
> The patch has the wrong directory name I think.
> [...]
Thank you very much. That works perfectly.

Greetings
Sascha
--
Sascha Manns | openSUSE Member
Email: [hidden email] | Blog: http://saigkill.tuxfamily.org
GPG: 0x62ECD463
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]