Skip to contentSkip to conversation

Fix to build webkitgtk without opengl

PATCH In review Chen Qi 2 participants 6 messages Sep 29, 2018 – Oct 9, 2018

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover Fix to build webkitgtk without opengl

The following changes since commit 3bbbe25ae74e120f7d3452685f0cae2245d7b14d:

glibc-package.inc: correct intention for deleting /usr/lib as needed (2018-09-27 23:41:41 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/webkitgtk-opengl
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/webkitgtk-opengl

Chen Qi (2):
libepoxy: fix PACKAGECONFIG to get rid of required opengl distro
feature
webkitgtk: fix to build without opengl

 meta/recipes-graphics/libepoxy/libepoxy_1.5.2.bb   |  9 +++---
 .../0001-fix-to-build-with-libepoxy.patch          | 35 ++++++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.20.5.bb       |  4 ++-
 3 files changed, 42 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 2/2 webkitgtk: fix to build without opengl

Currently, webkitgtk cannot be built if 'opengl' is not in distro feature. The error message is like below:

OpenGLShims.h:23:10: fatal error: GL/gl.h: No such file or directory

The required distro feature for webkitgtk is only 'x11'.

From its source codes, libepoxy is an alternative option to build webkitgtk. So fix to use it. In this way, we can successfully build out webkitgtk if 'opengl' is not in distro features.

---
 .../0001-fix-to-build-with-libepoxy.patch          | 35 ++++++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.20.5.bb       |  4 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch
meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch new file +35 -0
new file mode 100644
index 0000000..72ccef4
@@ -0,0 +1,35 @@
+From 59c04daa31f8083bf4eff8304b13f34dd79d00a3 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Sat, 29 Sep 2018 16:32:57 +0800
+Subject: [PATCH] fix to build with libepoxy
+
+In source codes, there are places checking USE(LIBEPOXY), but
+in cmake files, there's nowhere to handle it.
+
+Fix to define USE_LIBEPOXY to 1 if ENABLE_LIBEPOXY is turned on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ Source/cmake/OptionsGTK.cmake | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
+index 386fa1d..6e86257 100644
+--- a/Source/cmake/OptionsGTK.cmake
++++ b/Source/cmake/OptionsGTK.cmake
+@@ -240,6 +240,10 @@ endif ()
+ 
+ SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
+ 
++if (ENABLE_LIBEPOXY)
++    SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
++endif ()
++
+ if (ENABLE_OPENGL)
+     # ENABLE_OPENGL is true if either USE_OPENGL or ENABLE_GLES2 is true.
+     # But USE_OPENGL is the opposite of ENABLE_GLES2.
+-- 
+2.7.4
+
meta/recipes-sato/webkit/webkitgtk_2.20.5.bb +3 -1
index c8d4f94..24d10a2 100644
@@ -23,6 +23,7 @@ SRC_URI = "http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
            file://0012-soup-Forward-declare-URL-class.patch \
            file://0001-Fix-PaintingData-has-no-member-named-lightVector-on-.patch \
            file://0001-webkitgtk-fix-CVE-2017-17821.patch \
+           file://0001-fix-to-build-with-libepoxy.patch \
            "
 
 SRC_URI[md5sum] = "72a05f6a4dc1c78b079590a8fd280401"
@@ -42,7 +43,7 @@ DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn libgcrypt \
           "
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', 'libepoxy' ,d)} \
                    enchant \
                    libsecret \
                   "
@@ -52,6 +53,7 @@ PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/lib
 PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
 PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
 PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
+PACKAGECONFIG[libepoxy] = "-DENABLE_LIBEPOXY=ON,-DENABLE_LIBEPOXY=OFF,libepoxy"
 PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
 PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
 PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 libepoxy: fix PACKAGECONFIG to get rid of required opengl distro feature

In reply to Chen Qi

The 'virtual/libgl' dependency was introduced by the following commit without saying why.

"libepoxy: update to version 1.5.0"

And it's added if 'x11' is enabled. That does not seem right. Restore its previous dependency to only depend on virtual/libx11.

Also, do not unconditionally enable egl PACKAGECONFIG, enable it if opengl is in DISTRO_FEATURES. Remove the required distro feature setting accordingly.

---
 meta/recipes-graphics/libepoxy/libepoxy_1.5.2.bb | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
meta/recipes-graphics/libepoxy/libepoxy_1.5.2.bb +4 -5
index 1067212..be1b86a 100644
@@ -11,12 +11,11 @@ SRC_URI[md5sum] = "4a6b9e581da229dee74c2263c84b1eca"
 SRC_URI[sha256sum] = "a9562386519eb3fd7f03209f279f697a8cba520d3c155d6e253c3e138beca7d8"
 UPSTREAM_CHECK_URI = "https://github.com/anholt/libepoxy/releases"
 
-inherit meson pkgconfig distro_features_check
-
-REQUIRED_DISTRO_FEATURES = "opengl"
+inherit meson pkgconfig
 
 PACKAGECONFIG[egl] = "-Degl=yes, -Degl=no, virtual/egl"
-PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11 virtual/libgl"
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} egl"
+PACKAGECONFIG[x11] = "-Dglx=yes, -Dglx=no, virtual/libx11"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl', '', d)}"
 
 EXTRA_OEMESON += "-Dtests=false"
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH 2/2] webkitgtk: fix to build without opengl

In reply to Chen Qi

From the libepoxy web site:

"Epoxy is a library for handling OpenGL function pointer management for you"

libepoxy is essentially a glorified wrapper around dlopen()/dlsym(). Are you simply moving the failure from build time to run time? libepoxy should be pulling in a GL implementation because that's what it does.

Ross

Quoted 97 lines · Chen Qi

Currently, webkitgtk cannot be built if 'opengl' is not in distro feature. The error message is like below:

OpenGLShims.h:23:10: fatal error: GL/gl.h: No such file or directory

The required distro feature for webkitgtk is only 'x11'.

From its source codes, libepoxy is an alternative option to build webkitgtk. So fix to use it. In this way, we can successfully build out webkitgtk if 'opengl' is not in distro features.

---
 .../0001-fix-to-build-with-libepoxy.patch          | 35 ++++++++++++++++++++++
 meta/recipes-sato/webkit/webkitgtk_2.20.5.bb       |  4 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch
meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch new file +35 -0
new file mode 100644
index 0000000..72ccef4
@@ -0,0 +1,35 @@
+From 59c04daa31f8083bf4eff8304b13f34dd79d00a3 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Sat, 29 Sep 2018 16:32:57 +0800
+Subject: [PATCH] fix to build with libepoxy
+
+In source codes, there are places checking USE(LIBEPOXY), but
+in cmake files, there's nowhere to handle it.
+
+Fix to define USE_LIBEPOXY to 1 if ENABLE_LIBEPOXY is turned on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ Source/cmake/OptionsGTK.cmake | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
+index 386fa1d..6e86257 100644
+--- a/Source/cmake/OptionsGTK.cmake
++++ b/Source/cmake/OptionsGTK.cmake
+@@ -240,6 +240,10 @@ endif ()
+
+ SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
+
++if (ENABLE_LIBEPOXY)
++    SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
++endif ()
++
+ if (ENABLE_OPENGL)
+     # ENABLE_OPENGL is true if either USE_OPENGL or ENABLE_GLES2 is true.
+     # But USE_OPENGL is the opposite of ENABLE_GLES2.
+--
+2.7.4
+
meta/recipes-sato/webkit/webkitgtk_2.20.5.bb +3 -2
index c8d4f94..24d10a2 100644
@@ -23,6 +23,7 @@ SRC_URI = "http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
            file://0012-soup-Forward-declare-URL-class.patch \
            file://0001-Fix-PaintingData-has-no-member-named-lightVector-on-.patch \
            file://0001-webkitgtk-fix-CVE-2017-17821.patch \
+           file://0001-fix-to-build-with-libepoxy.patch \
            "
 
 SRC_URI[md5sum] = "72a05f6a4dc1c78b079590a8fd280401"
@@ -42,7 +43,7 @@ DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn libgcrypt \
           "
 
 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', 'libepoxy' ,d)} \
                    enchant \
                    libsecret \
                   "
@@ -52,6 +53,7 @@ PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/lib
 PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
 PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
 PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
+PACKAGECONFIG[libepoxy] = "-DENABLE_LIBEPOXY=ON,-DENABLE_LIBEPOXY=OFF,libepoxy"
 PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
 PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
 PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw

Re: [PATCH 1/2] libepoxy: fix PACKAGECONFIG to get rid of required opengl distro feature

In reply to Chen Qi
Quoted 1 line · Chen Qi

-REQUIRED_DISTRO_FEATURES = "opengl"

But libepoxy is a GL wrapper, so what is this *actually* achieving? The opengl DISTRO_FEATURE is deliberately vague and just means that some form of OpenGL is available.

Ross

author
#5 lore raw

Re: [PATCH 2/2] webkitgtk: fix to build without opengl

In reply to Burton, Ross
Quoted 10 lines · Ross
Quoted 1 line

From the libepoxy web site:

"Epoxy is a library for handling OpenGL function pointer management for you"

libepoxy is essentially a glorified wrapper around dlopen()/dlsym(). Are you simply moving the failure from build time to run time? libepoxy should be pulling in a GL implementation because that's what it does.

Ross

Thanks for pointing out the problem.
I think we can now conclude that 'opengl' is necessary for webkitgtk? I've pinged a patch which Hongxu sent some time ago.

Best Regards,
Chen Qi

Quoted 97 lines · Chen Qi
Quoted 96 lines

Currently, webkitgtk cannot be built if 'opengl' is not in distro feature. The error message is like below:

OpenGLShims.h:23:10: fatal error: GL/gl.h: No such file or directory

The required distro feature for webkitgtk is only 'x11'.

From its source codes, libepoxy is an alternative option to build webkitgtk.
So fix to use it. In this way, we can successfully build out webkitgtk if 'opengl' is not in distro features.

---
  .../0001-fix-to-build-with-libepoxy.patch          | 35 ++++++++++++++++++++++
  meta/recipes-sato/webkit/webkitgtk_2.20.5.bb       |  4 ++-
  2 files changed, 38 insertions(+), 1 deletion(-)

create mode 100644 meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch

meta/recipes-sato/webkit/webkitgtk/0001-fix-to-build-with-libepoxy.patch new file +35 -0
new file mode 100644
index 0000000..72ccef4
@@ -0,0 +1,35 @@
+From 59c04daa31f8083bf4eff8304b13f34dd79d00a3 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Sat, 29 Sep 2018 16:32:57 +0800
+Subject: [PATCH] fix to build with libepoxy
+
+In source codes, there are places checking USE(LIBEPOXY), but
+in cmake files, there's nowhere to handle it.
+
+Fix to define USE_LIBEPOXY to 1 if ENABLE_LIBEPOXY is turned on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ Source/cmake/OptionsGTK.cmake | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
+index 386fa1d..6e86257 100644
+--- a/Source/cmake/OptionsGTK.cmake
++++ b/Source/cmake/OptionsGTK.cmake
+@@ -240,6 +240,10 @@ endif ()
+
+ SET_AND_EXPOSE_TO_BUILD(USE_TEXTURE_MAPPER TRUE)
+
++if (ENABLE_LIBEPOXY)
++    SET_AND_EXPOSE_TO_BUILD(USE_LIBEPOXY TRUE)
++endif ()
++
+ if (ENABLE_OPENGL)
+     # ENABLE_OPENGL is true if either USE_OPENGL or ENABLE_GLES2 is true.
+     # But USE_OPENGL is the opposite of ENABLE_GLES2.
+--
+2.7.4
+
meta/recipes-sato/webkit/webkitgtk_2.20.5.bb +3 -2
index c8d4f94..24d10a2 100644
@@ -23,6 +23,7 @@ SRC_URI = "http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
             file://0012-soup-Forward-declare-URL-class.patch \
             file://0001-Fix-PaintingData-has-no-member-named-lightVector-on-.patch \
             file://0001-webkitgtk-fix-CVE-2017-17821.patch \
+           file://0001-fix-to-build-with-libepoxy.patch \
             "
 
  SRC_URI[md5sum] = "72a05f6a4dc1c78b079590a8fd280401"
@@ -42,7 +43,7 @@ DEPENDS = "zlib libsoup-2.4 curl libxml2 cairo libxslt libxt libidn libgcrypt \
            "
 
  PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', 'wayland' ,d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', '' ,d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'webgl opengl', 'libepoxy' ,d)} \
                     enchant \
                     libsecret \
                    "
@@ -52,6 +53,7 @@ PACKAGECONFIG[x11] = "-DENABLE_X11_TARGET=ON,-DENABLE_X11_TARGET=OFF,virtual/lib
  PACKAGECONFIG[geoclue] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue"
  PACKAGECONFIG[enchant] = "-DENABLE_SPELLCHECK=ON,-DENABLE_SPELLCHECK=OFF,enchant"
  PACKAGECONFIG[gtk2] = "-DENABLE_PLUGIN_PROCESS_GTK2=ON,-DENABLE_PLUGIN_PROCESS_GTK2=OFF,gtk+"
+PACKAGECONFIG[libepoxy] = "-DENABLE_LIBEPOXY=ON,-DENABLE_LIBEPOXY=OFF,libepoxy"
  PACKAGECONFIG[gles2] = "-DENABLE_GLES2=ON,-DENABLE_GLES2=OFF,virtual/libgles2"
  PACKAGECONFIG[webgl] = "-DENABLE_WEBGL=ON,-DENABLE_WEBGL=OFF,virtual/libgl"
  PACKAGECONFIG[opengl] = "-DENABLE_OPENGL=ON,-DENABLE_OPENGL=OFF,virtual/libgl"
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core