* [Buildroot] [PATCH 1/1] package/sdl2: Fix sdl2-config.cmake
@ 2021-07-01 6:24 Gleb Mazovetskiy
2021-07-29 10:17 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Gleb Mazovetskiy @ 2021-07-01 6:24 UTC (permalink / raw)
To: buildroot
SDL2 autotools-provided sdl2-config.cmake uses the absolute /usr prefix.
For this reason, we previously removed it (as of d59261836a).
This commit fixes sdl2-config.cmake to use relative paths instead.
Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
---
package/sdl2/sdl2.mk | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk
index a2e426e578..68a6e1abca 100644
--- a/package/sdl2/sdl2.mk
+++ b/package/sdl2/sdl2.mk
@@ -24,13 +24,13 @@ SDL2_CONF_OPTS += \
# We are using autotools build system for sdl2, so the sdl2-config.cmake
# include path are not resolved like for sdl2-config script.
-# Remove sdl2-config.cmake file and avoid unsafe include path if this
-# file is used by a cmake based package.
+# Change the absolute /usr path to resolve relatively to the sdl2-config.cmake location.
# https://bugzilla.libsdl.org/show_bug.cgi?id=4597
-define SDL2_REMOVE_SDL2_CONFIG_CMAKE
- rm -rf $(STAGING_DIR)/usr/lib/cmake/SDL2
+define SDL2_FIX_SDL2_CONFIG_CMAKE
+ $(SED) '2s|^|get_filename_component(PACKAGE_PREFIX_DIR "$${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)\n|; s|"/usr"|$${PACKAGE_PREFIX_DIR}|' \
+ $(STAGING_DIR)/usr/lib/cmake/SDL2/sdl2-config.cmake
endef
-SDL2_POST_INSTALL_STAGING_HOOKS += SDL2_REMOVE_SDL2_CONFIG_CMAKE
+SDL2_POST_INSTALL_STAGING_HOOKS += SDL2_FIX_SDL2_CONFIG_CMAKE
# We must enable static build to get compilation successful.
SDL2_CONF_OPTS += --enable-static
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [Buildroot] [PATCH 1/1] package/sdl2: Fix sdl2-config.cmake
2021-07-01 6:24 [Buildroot] [PATCH 1/1] package/sdl2: Fix sdl2-config.cmake Gleb Mazovetskiy
@ 2021-07-29 10:17 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-07-29 10:17 UTC (permalink / raw)
To: Gleb Mazovetskiy; +Cc: Michael Fischer, buildroot
On Thu, 1 Jul 2021 07:24:32 +0100
Gleb Mazovetskiy <glex.spb@gmail.com> wrote:
> SDL2 autotools-provided sdl2-config.cmake uses the absolute /usr prefix.
> For this reason, we previously removed it (as of d59261836a).
>
> This commit fixes sdl2-config.cmake to use relative paths instead.
>
> Signed-off-by: Gleb Mazovetskiy <glex.spb@gmail.com>
> ---
> package/sdl2/sdl2.mk | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
I have applied, after slightly reworking how the SED replacement is
done. I'm using the "i" sed command to insert the line, and then do the
"s" replacement separately.
Yes, it requires two sed invocations, but I found it to be a bit
clearer.
Thanks for your contribution!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-29 10:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-01 6:24 [Buildroot] [PATCH 1/1] package/sdl2: Fix sdl2-config.cmake Gleb Mazovetskiy
2021-07-29 10:17 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox