Skip to contentSkip to conversation

sdl2: fix sdl2.pc include paths

PATCH Superseded Samuli Piippo 3 participants 4 messages Jan 12, 2019 – Jan 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdl2: fix sdl2.pc include paths

SDL2 dumps all cflags to the sdl2.pc, which might then contain paths to the recipe sysroot include dirs.

---
 meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb +4 -0
index 812a9abf3c..a9c5d8a443 100644
@@ -64,6 +64,10 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
+do_install_append() {
+    sed -i -e "s|${STAGING_INCDIR}|$\{includedir}|g" ${D}${libdir}/pkgconfig/sdl2.pc
+}
+
 FILES_${PN}-dev += "${libdir}/cmake"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1
#1 lore raw

Would it be easier to just remove @SDL_CFLAGS@ from sdl.pc.in? Does that contain other values that are needed, or are they all spurious?

Ross

Quoted 34 lines · Samuli Piippo

SDL2 dumps all cflags to the sdl2.pc, which might then contain paths to the recipe sysroot include dirs.

---
 meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb +2 -0
index 812a9abf3c..a9c5d8a443 100644
@@ -64,6 +64,10 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
+do_install_append() {
+    sed -i -e "s|${STAGING_INCDIR}|$\{includedir}|g"

${D}${libdir}/pkgconfig/sdl2.pc

meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb +2 -1
+}
+
 FILES_${PN}-dev += "${libdir}/cmake"
 
 BBCLASSEXTEND = "native nativesdk"
--

2.17.1

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

#2 lore raw

My two comments:

1. There is already an upgrade libsdl2 -> 2.09 pending so this patch needs rebase [1]
2. Removing CFLAGS is easier but potentially a risk of unwanted effects. My sdl2.pc contains -D_REENTRANT. This should be obsolete but who guarantees that there isn't some old application still requiring it (because it is set in other build environments).

[1] http://lists.openembedded.org/pipermail/openembedded-core/2019-January/277739.html

Andreas

Quoted 44 lines · Ross

Would it be easier to just remove @SDL_CFLAGS@ from sdl.pc.in? Does that contain other values that are needed, or are they all spurious?

Ross

Quoted 27 lines · Samuli Piippo

SDL2 dumps all cflags to the sdl2.pc, which might then contain paths to the recipe sysroot include dirs.

---
 meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb +4 -1
index 812a9abf3c..a9c5d8a443 100644
@@ -64,6 +64,10 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
+do_install_append() {
+    sed -i -e "s|${STAGING_INCDIR}|$\{includedir}|g" ${D}${libdir}/pkgconfig/sdl2.pc
+}
+
 FILES_${PN}-dev += "${libdir}/cmake"
 
 BBCLASSEXTEND = "native nativesdk"
--

2.17.1

Quoted 5 lines

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

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

#3 lore raw

PATCH v2 1/1 sdl2: fix sdl2.pc include paths

In reply to Samuli Piippo

SDL2 dumps all cflags to the sdl2.pc, which might then contain paths to the recipe sysroot include dirs.

---
 meta/recipes-graphics/libsdl2/libsdl2_2.0.9.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-graphics/libsdl2/libsdl2_2.0.9.bb +4 -0
index a5ec77728a..8941f05958 100644
@@ -63,6 +63,10 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
+do_install_append() {
+    sed -i -e "s|${STAGING_INCDIR}|$\{includedir}|g" ${D}${libdir}/pkgconfig/sdl2.pc
+}
+
 FILES_${PN}-dev += "${libdir}/cmake"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1