Skip to contentSkip to conversation

package/qt5webkit: needs host-python

PATCH New Yann E. MORIN 2 participants 5 messages Jul 25, 2016 – Jul 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/qt5webkit: needs host-python

The Qt5Webkit build system hard-codes calls to 'python', but only really supports python2.

We fix that similarly as we did in nodejs, by adding a python->python2 symlink early in the PATH when configuring/building Qt5Webkit, and adding host-python in the dependency list.

Fixes:

    http://autobuild.buildroot.org/results/ea4/ea4dd00ee585f9f9ea1927b8b5fd9035e6733420/
    http://autobuild.buildroot.org/results/323/323ba220fae70d94c81bab9a348be844e90ace91/
    http://autobuild.buildroot.org/results/6c2/6c20c9e222f94e6b70b97b87e1393dd16da2718c/

Also slightly reorganise the dependency list, now that it no longer fits on a single line.

---
 package/qt5/qt5webkit/qt5webkit.mk | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
package/qt5/qt5webkit/qt5webkit.mk +16 -4
index e6e8fe3..a47a235 100644
@@ -8,7 +8,9 @@ QT5WEBKIT_VERSION = b889f460280ad98c89ede179bd3b9ce9cb02002b
 # Using GitHub since it supports downloading tarballs from random commits.
 # The http://code.qt.io/cgit/qt/qtwebkit.git/ repo doesn't allow to do so.
 QT5WEBKIT_SITE = $(call github,qtproject,qtwebkit,$(QT5WEBKIT_VERSION))
-QT5WEBKIT_DEPENDENCIES = qt5base sqlite host-ruby host-gperf host-bison host-flex
+QT5WEBKIT_DEPENDENCIES = \
+	host-bison host-flex host-gperf host-python host-ruby \
+	qt5base sqlite
 QT5WEBKIT_INSTALL_STAGING = YES
 
 QT5WEBKIT_LICENSE_FILES = Source/WebCore/LICENSE-LGPL-2 Source/WebCore/LICENSE-LGPL-2.1
@@ -31,6 +33,16 @@ ifeq ($(BR2_PACKAGE_QT5DECLARATIVE),y)
 QT5WEBKIT_DEPENDENCIES += qt5declarative
 endif
 
+# QtWebkit's build system uses python, but only supports python2. We work
+# around this by forcing python2 early in the PATH, via a python->python2
+# symlink.
+QT5WEBKIT_ENV = PATH=$(@D)/bin:$(BR_PATH)
+define QT5WEBKIT_PYTHON2_SYMLINK
+	mkdir -p $(@D)/bin
+	ln -sf $(HOST_DIR)/usr/bin/python2 $(@D)/bin/python
+endef
+QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK
+
 # Since we get the source from git, generated header files are not included.
 # qmake detects that header file generation (using the syncqt tool) must be
 # done based on the existence of a .git directory (cfr. the git_build config
@@ -39,15 +51,15 @@ endif
 # create an empty .git directory.
 define QT5WEBKIT_CONFIGURE_CMDS
 	mkdir -p $(@D)/.git
-	(cd $(@D); $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/qmake)
+	(cd $(@D); $(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(HOST_DIR)/usr/bin/qmake)
 endef
 
 define QT5WEBKIT_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+	$(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(MAKE) -C $(@D)
 endef
 
 define QT5WEBKIT_INSTALL_STAGING_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install
+	$(TARGET_MAKE_ENV) $(QT5WEBKIT_ENV) $(MAKE) -C $(@D) install
 	$(QT5_LA_PRL_FILES_FIXUP)
 endef
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 package/qt5webkit: needs host-python

Hello,

Cc'ing Qt5 folks: Peter Seiderer and Julien Corjon.

Quoted 8 lines · Yann E. MORIN

The Qt5Webkit build system hard-codes calls to 'python', but only really supports python2.

We fix that similarly as we did in nodejs, by adding a python->python2 symlink early in the PATH when configuring/building Qt5Webkit, and adding host-python in the dependency list.

Fixes:

Quoted 8 lines
    http://autobuild.buildroot.org/results/ea4/ea4dd00ee585f9f9ea1927b8b5fd9035e6733420/
    http://autobuild.buildroot.org/results/323/323ba220fae70d94c81bab9a348be844e90ace91/
    http://autobuild.buildroot.org/results/6c2/6c20c9e222f94e6b70b97b87e1393dd16da2718c/

Also slightly reorganise the dependency list, now that it no longer fits on a single line.

I know the hack of creating a dummy "bin" directory, with a python->python2 symlink is a trick already used by nodejs, but I don't like it very much.

Is "python" hardcoded is so many places in Qt5Webkit ? If not, what about patching it instead, and submitting the patch upstream (though I'm not sure qtwebkit is still maintained, since they moved to qtwebengine I believe).

Peter, Julien?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package/qt5webkit: needs host-python

Thomas, All,

On 2016-07-26 09:58 +0200, Thomas Petazzoni spake thusly:

Quoted 13 lines · Yann E. MORIN
Quoted 12 lines

The Qt5Webkit build system hard-codes calls to 'python', but only really supports python2.

We fix that similarly as we did in nodejs, by adding a python->python2 symlink early in the PATH when configuring/building Qt5Webkit, and adding host-python in the dependency list.

Fixes:

    http://autobuild.buildroot.org/results/ea4/ea4dd00ee585f9f9ea1927b8b5fd9035e6733420/
    http://autobuild.buildroot.org/results/323/323ba220fae70d94c81bab9a348be844e90ace91/
    http://autobuild.buildroot.org/results/6c2/6c20c9e222f94e6b70b97b87e1393dd16da2718c/
Quoted 8 lines
Quoted 4 lines

Also slightly reorganise the dependency list, now that it no longer fits on a single line.

I know the hack of creating a dummy "bin" directory, with a python->python2 symlink is a trick already used by nodejs, but I don't like it very much.

Neither do I, but see below...

Quoted 1 line

Is "python" hardcoded is so many places in Qt5Webkit ?

    $ grep -r -E '(^|[[:space:]])python([[:space:]]|$)' |grep -v ChangeLog |wc -l
    153

A lot of them are just doc or such, but there are still a lot of places that are indeed calls to the python interpreter:

    Tools/gtk/jhbuildrc:#!/usr/bin/env python
    Tools/gtk/common.py:#!/usr/bin/env python
    Tools/gtk/generate-gtkdoc:#!/usr/bin/env python
    Tools/gtk/generate-feature-defines-files:#!/usr/bin/env python
    Tools/CygwinDownloader/cygwin-downloader.py:#!/usr/bin/env python
    Tools/efl/jhbuildrc:#!/usr/bin/env python
    Tools/efl/common.py:#!/usr/bin/env python
    Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth_unittest.py:#!/usr/bin/env python
    Tools/BuildSlaveSupport/wait-for-SVN-server.py:#!/usr/bin/env python
    Tools/jhbuild/jhbuild-wrapper:#!/usr/bin/env python
    Tools/QueueStatusServer/app.yaml:runtime: python
    Tools/Scripts/new-run-webkit-tests:#!/usr/bin/env python
    Tools/Scripts/validate-committer-lists:#!/usr/bin/env python
    Tools/Scripts/run-qtwebkit-tests:#!/usr/bin/env python
    Tools/Scripts/lint-webkitpy:#!/usr/bin/env python
    Tools/Scripts/generate-win32-export-forwards:#!/usr/bin/env python
    Tools/Scripts/import-w3c-tests:#!/usr/bin/env python
    Tools/Scripts/webkitpy/layout_tests/views/buildbot_results.py:#!/usr/bin/env python
    Tools/Scripts/webkitpy/layout_tests/views/buildbot_results_unittest.py:#!/usr/bin/env python
    [...]
    Source/WebCore/DerivedSources.make:     python $(WebCore)/html/parser/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in
    Source/WebCore/DerivedSources.make:     python $(WebCore)/inspector/generate-inspector-protocol-version -o InspectorProtocolVersion.h $(WebCore)/inspector/Inspector.json
    Source/WebCore/DerivedSources.make:     python $(WebCore)/inspector/CodeGeneratorInspector.py $(WebCore)/inspector/Inspector.json --output_h_dir . --output_cpp_dir .
    Source/WebCore/html/parser/create-html-entity-table:#!/usr/bin/env python
    Source/JavaScriptCore/DerivedSources.pri:retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT}
    Source/JavaScriptCore/DerivedSources.pri:klgen.commands = python $$klgen.script ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
    Source/JavaScriptCore/DerivedSources.pri:    disassembler.commands = python $$disassembler.script ${QMAKE_FILE_NAME} --outputDir ${QMAKE_FUNC_FILE_OUT_PATH}
    Source/JavaScriptCore/DerivedSources.make:      python $^ > $@
    Source/JavaScriptCore/DerivedSources.make:      python $^ > $@
    Source/JavaScriptCore/DerivedSources.make:      (PYTHONPATH=$(JavaScriptCore)/disassembler/udis86 python $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml || exit 1)
    [...]

So, I'm not gonna patch it either...

Quoted 4 lines

If not, what
about patching it instead, and submitting the patch upstream (though I'm not sure qtwebkit is still maintained, since they moved to qtwebengine I believe).

Yes, upstream is not maintaining it anymore, but it's still being maintained by "the community", and they are now even compatible with Qt-5.7.

See also the commit log of e8dbdbd (qt5webkit: restore package). ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 package/qt5webkit: needs host-python

Hello,

Quoted 42 lines · Yann E. MORIN

Neither do I, but see below...

Quoted 1 line

Is "python" hardcoded is so many places in Qt5Webkit ?

    $ grep -r -E '(^|[[:space:]])python([[:space:]]|$)' |grep -v ChangeLog |wc -l
    153

A lot of them are just doc or such, but there are still a lot of places that are indeed calls to the python interpreter:

    Tools/gtk/jhbuildrc:#!/usr/bin/env python
    Tools/gtk/common.py:#!/usr/bin/env python
    Tools/gtk/generate-gtkdoc:#!/usr/bin/env python
    Tools/gtk/generate-feature-defines-files:#!/usr/bin/env python
    Tools/CygwinDownloader/cygwin-downloader.py:#!/usr/bin/env python
    Tools/efl/jhbuildrc:#!/usr/bin/env python
    Tools/efl/common.py:#!/usr/bin/env python
    Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth_unittest.py:#!/usr/bin/env python
    Tools/BuildSlaveSupport/wait-for-SVN-server.py:#!/usr/bin/env python
    Tools/jhbuild/jhbuild-wrapper:#!/usr/bin/env python
    Tools/QueueStatusServer/app.yaml:runtime: python
    Tools/Scripts/new-run-webkit-tests:#!/usr/bin/env python
    Tools/Scripts/validate-committer-lists:#!/usr/bin/env python
    Tools/Scripts/run-qtwebkit-tests:#!/usr/bin/env python
    Tools/Scripts/lint-webkitpy:#!/usr/bin/env python
    Tools/Scripts/generate-win32-export-forwards:#!/usr/bin/env python
    Tools/Scripts/import-w3c-tests:#!/usr/bin/env python
    Tools/Scripts/webkitpy/layout_tests/views/buildbot_results.py:#!/usr/bin/env python
    Tools/Scripts/webkitpy/layout_tests/views/buildbot_results_unittest.py:#!/usr/bin/env python
    [...]
    Source/WebCore/DerivedSources.make:     python $(WebCore)/html/parser/create-html-entity-table -o HTMLEntityTable.cpp $(WebCore)/html/parser/HTMLEntityNames.in
    Source/WebCore/DerivedSources.make:     python $(WebCore)/inspector/generate-inspector-protocol-version -o InspectorProtocolVersion.h $(WebCore)/inspector/Inspector.json
    Source/WebCore/DerivedSources.make:     python $(WebCore)/inspector/CodeGeneratorInspector.py $(WebCore)/inspector/Inspector.json --output_h_dir . --output_cpp_dir .
    Source/WebCore/html/parser/create-html-entity-table:#!/usr/bin/env python
    Source/JavaScriptCore/DerivedSources.pri:retgen.commands = python $$retgen.script > ${QMAKE_FILE_OUT}
    Source/JavaScriptCore/DerivedSources.pri:klgen.commands = python $$klgen.script ${QMAKE_FILE_NAME} > ${QMAKE_FILE_OUT}
    Source/JavaScriptCore/DerivedSources.pri:    disassembler.commands = python $$disassembler.script ${QMAKE_FILE_NAME} --outputDir ${QMAKE_FUNC_FILE_OUT_PATH}
    Source/JavaScriptCore/DerivedSources.make:      python $^ > $@
    Source/JavaScriptCore/DerivedSources.make:      python $^ > $@
    Source/JavaScriptCore/DerivedSources.make:      (PYTHONPATH=$(JavaScriptCore)/disassembler/udis86 python $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml || exit 1)
    [...]
Quoted 1 line

So, I'm not gonna patch it either...

OK, makes sense!

Quoted 5 lines

Yes, upstream is not maintaining it anymore, but it's still being maintained by "the community", and they are now even compatible with Qt-5.7.

See also the commit log of e8dbdbd (qt5webkit: restore package). ;-)

In this case, could you submit a bug report upstream to ask them to provide a way to configure the Python to use?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 package/qt5webkit: needs host-python

In reply to Yann E. MORIN

Hello,

Quoted 12 lines · Yann E. MORIN

The Qt5Webkit build system hard-codes calls to 'python', but only really supports python2.

We fix that similarly as we did in nodejs, by adding a python->python2 symlink early in the PATH when configuring/building Qt5Webkit, and adding host-python in the dependency list.

Fixes:

    http://autobuild.buildroot.org/results/ea4/ea4dd00ee585f9f9ea1927b8b5fd9035e6733420/
    http://autobuild.buildroot.org/results/323/323ba220fae70d94c81bab9a348be844e90ace91/
    http://autobuild.buildroot.org/results/6c2/6c20c9e222f94e6b70b97b87e1393dd16da2718c/
Quoted 7 lines

Also slightly reorganise the dependency list, now that it no longer fits on a single line.

---
 package/qt5/qt5webkit/qt5webkit.mk | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com