[opensuse-packaging] Try to update wkhtmltopdf

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: saigkill@opensuse.org | Blog: http://saigkill.tuxfamily.org GPG: 0x62ECD463 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

* Sascha Manns (saigkill@opensuse.org) [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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

* Philipp Thomas (pth@suse.de) [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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

Hi Philipp, Am Donnerstag, den 23.03.2017, 10:28 +0100 schrieb Philipp Thomas:
* Philipp Thomas (pth@suse.de) [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: saigkill@opensuse.org | Blog: http://saigkill.tuxfamily.org GPG: 0x62ECD463 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

Philipp Thomas wrote
* Philipp Thomas (
pth@
) [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 -- View this message in context: http://opensuse.14.x6.nabble.com/Try-to-update-wkhtmltopdf-tp5083557p5083631... Sent from the opensuse-packaging mailing list archive at Nabble.com. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

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: saigkill@opensuse.org | Blog: http://saigkill.tuxfamily.org GPG: 0x62ECD463 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

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: saigkill@opensuse.org | Blog: http://saigkill.tuxfamily.org GPG: 0x62ECD463 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

On 24 March 2017 at 03:53, Sascha Manns <saigkill@opensuse.org> 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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

* Karl Cheng (qantas94heavy@gmail.com) [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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

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 <qantas94heavy@gmail.com>:
On 24 March 2017 at 03:53, Sascha Manns <saigkill@opensuse.org> 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: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org

Hello Karl, Am Freitag, den 24.03.2017, 12:04 +1100 schrieb Karl Cheng:
On 24 March 2017 at 03:53, Sascha Manns <saigkill@opensuse.org> 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: saigkill@opensuse.org | Blog: http://saigkill.tuxfamily.org GPG: 0x62ECD463 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (6)
-
Ferdinand Thiessen
-
Karl Cheng
-
Klaas Freitag
-
Luigi Baldoni
-
Philipp Thomas
-
Sascha Manns