Skip to contentSkip to conversation

freeglut: Add packageconfigs for x11/wayland/gles

PATCH In review Khem Raj 2 participants 3 messages Jan 10, 2023 – Apr 1, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 freeglut: Add packageconfigs for x11/wayland/gles

helps it compiling on on different openGL implementations which may not implement fulll openGL specs

---
 .../freeglut/freeglut_3.4.0.bb                 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +14 -4
index 627ce23544..86b94149bc 100644
@@ -6,14 +6,24 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=89c0b58a3e01ce3d8254c9f59e78adfb"
 SRC_URI = "https://sourceforge.net/projects/${BPN}/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
 SRC_URI[sha256sum] = "3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec"
 
-inherit cmake features_check
+inherit cmake features_check pkgconfig
 
-# depends on virtual/libx11, virtual/libgl
-REQUIRED_DISTRO_FEATURES = "x11 opengl"
+# depends on virtual/libgl
+REQUIRED_DISTRO_FEATURES = "opengl"
 
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+PACKAGECONFIG[gles] = "-DFREEGLUT_GLES=ON,-DFREEGLUT_GLES=OFF,"
+PACKAGECONFIG[wayland] = "-DFREEGLUT_WAYLAND=ON,-DFREEGLUT_WAYLAND=OFF,libxkbcommon"
+PACKAGECONFIG[demos] = "-DFREEGLUT_BUILD_DEMOS=ON,-DFREEGLUT_BUILD_DEMOS=OFF,"
+PACKAGECONFIG[x11] = ",,virtual/libx11 libice libxmu libglu libxrandr libxext"
 # Do not use -fno-common, check back when upgrading to new version it might not be needed
 CFLAGS += "-fcommon"
 
 PROVIDES += "mesa-glut"
 
-DEPENDS = "virtual/libx11 libxmu libxi virtual/libgl libglu libxrandr"
+DEPENDS = "virtual/libgl libxi"
+
+do_install:append() {
+    # Remove buildpaths
+    sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/FreeGLUT/FreeGLUTTargets.cmake
+}
Signature · 1 line
2.39.0
#1 lore raw
Quoted 22 lines · Khem Raj

helps it compiling on on different openGL implementations which may not implement fulll openGL specs

---
 .../freeglut/freeglut_3.4.0.bb                 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +0 -0
index 627ce23544..86b94149bc 100644
@@ -6,14 +6,24 @@ LIC_FILES_CHKSUM =

"file://COPYING;md5=89c0b58a3e01ce3d8254c9f59e78adfb"
SRC_URI = "
https://sourceforge.net/projects/${BPN}/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz
"
SRC_URI[sha256sum] =
"3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec"

meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb LIC_FILES_CHKSUM = "file://COPYING;md5=89c0b58a3e01ce3d8254c9f59e78adfb" · line 12

Quoted 7 lines
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +3 -3
-inherit cmake features_check
+inherit cmake features_check pkgconfig
 
-# depends on virtual/libx11, virtual/libgl
-REQUIRED_DISTRO_FEATURES = "x11 opengl"
+# depends on virtual/libgl
+REQUIRED_DISTRO_FEATURES = "opengl"

This doesn't seem correct as there is still libxi dependency which requires x11 in DISTRO_FEATURES.

Are you building freeglut without x11 (and want to support this) or should I just return x11 to REQUIRED_DISTRO_FEATURES ?

+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"

Quoted 36 lines
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +2 -0
+PACKAGECONFIG[gles] = "-DFREEGLUT_GLES=ON,-DFREEGLUT_GLES=OFF,"
+PACKAGECONFIG[wayland] =

"-DFREEGLUT_WAYLAND=ON,-DFREEGLUT_WAYLAND=OFF,libxkbcommon" +PACKAGECONFIG[demos] = "-DFREEGLUT_BUILD_DEMOS=ON,-DFREEGLUT_BUILD_DEMOS=OFF," +PACKAGECONFIG[x11] = ",,virtual/libx11 libice libxmu libglu libxrandr libxext"
# Do not use -fno-common, check back when upgrading to new version it
might not be needed
CFLAGS += "-fcommon"

PROVIDES += "mesa-glut"

meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +5 -1
-DEPENDS = "virtual/libx11 libxmu libxi virtual/libgl libglu libxrandr"
+DEPENDS = "virtual/libgl libxi"
+
+do_install:append() {
+    # Remove buildpaths
+    sed -i "s#${RECIPE_SYSROOT}##g"

${D}${libdir}/cmake/FreeGLUT/FreeGLUTTargets.cmake +}
--
2.39.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#100516):
https://lists.openembedded.org/g/openembedded-devel/message/100516
Mute This Topic: https://lists.openembedded.org/mt/96174302/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw
Quoted 30 lines · Martin Jansa
Quoted 14 lines · Khem Raj

helps it compiling on on different openGL implementations which may not implement fulll openGL specs

---
 .../freeglut/freeglut_3.4.0.bb                 | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +0 -0
index 627ce23544..86b94149bc 100644

meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb LIC_FILES_CHKSUM = "file://COPYING;md5=89c0b58a3e01ce3d8254c9f59e78adfb" · line 12

Quoted 10 lines
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +3 -3
@@ -6,14 +6,24 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=89c0b58a3e01ce3d8254c9f59e78adfb"
 SRC_URI = "https://sourceforge.net/projects/${BPN}/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz"
 SRC_URI[sha256sum] = "3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec"
 
-inherit cmake features_check
+inherit cmake features_check pkgconfig
 
-# depends on virtual/libx11, virtual/libgl
-REQUIRED_DISTRO_FEATURES = "x11 opengl"
+# depends on virtual/libgl
+REQUIRED_DISTRO_FEATURES = "opengl"

This doesn't seem correct as there is still libxi dependency which requires x11 in DISTRO_FEATURES.

Quoted 2 lines

Are you building freeglut without x11 (and want to support this) or should I just return x11 to REQUIRED_DISTRO_FEATURES ?

yes for some meta-ti machines ( e.g. beaglebone ), I build without x11, I wonder if libxi depenendency can be made optional.

Quoted 29 lines
Quoted 29 lines
meta-oe/recipes-graphics/freeglut/freeglut_3.4.0.bb +11 -2
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}"
+PACKAGECONFIG[gles] = "-DFREEGLUT_GLES=ON,-DFREEGLUT_GLES=OFF,"
+PACKAGECONFIG[wayland] = "-DFREEGLUT_WAYLAND=ON,-DFREEGLUT_WAYLAND=OFF,libxkbcommon"
+PACKAGECONFIG[demos] = "-DFREEGLUT_BUILD_DEMOS=ON,-DFREEGLUT_BUILD_DEMOS=OFF,"
+PACKAGECONFIG[x11] = ",,virtual/libx11 libice libxmu libglu libxrandr libxext"
 # Do not use -fno-common, check back when upgrading to new version it might not be needed
 CFLAGS += "-fcommon"
 
 PROVIDES += "mesa-glut"
 
-DEPENDS = "virtual/libx11 libxmu libxi virtual/libgl libglu libxrandr"
+DEPENDS = "virtual/libgl libxi"
+
+do_install:append() {
+    # Remove buildpaths
+    sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/FreeGLUT/FreeGLUTTargets.cmake
+}
--

2.39.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#100516): https://lists.openembedded.org/g/openembedded-devel/message/100516
Mute This Topic: https://lists.openembedded.org/mt/96174302/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-