Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake
@ 2020-05-05 18:43 Romain Naour
  2020-05-05 18:43 ` [Buildroot] [PATCH v2 2/2] package/orgre: bump to version 1.12.6 Romain Naour
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Romain Naour @ 2020-05-05 18:43 UTC (permalink / raw)
  To: buildroot

We are using autotools build system for sdl2, so the sdl2-config.cmake
include path are not resolved like for sdl2-config script [1].
Remove sdl2-config.cmake file and avoid unsafe include path if this
file is used by a cmake based package.

This trigger an issue with ogre 1.12.6 package that replaced
FindSDL2.cmake by sdl2-config.cmake [2].

Thanks to Pavel Rojtberg for the help [3].

[1] https://bugzilla.libsdl.org/show_bug.cgi?id=4597
[2] https://github.com/OGRECave/ogre/commit/6de6f9b4081a07c911932441700c54b72ec1ee1f
[3] https://github.com/OGRECave/ogre/issues/1568

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
v2: new patch
---
 package/sdl2/sdl2.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk
index 501bb4699d..8d76bd9f0c 100644
--- a/package/sdl2/sdl2.mk
+++ b/package/sdl2/sdl2.mk
@@ -20,6 +20,16 @@ SDL2_CONF_OPTS += \
 	--disable-pulseaudio \
 	--disable-video-wayland
 
+# 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.
+# https://bugzilla.libsdl.org/show_bug.cgi?id=4597
+define SDL2_REMOVE_SDL2_CONFIG_CMAKE
+	rm -rf $(STAGING_DIR)/usr/lib/cmake/SDL2
+endef
+SDL2_POST_INSTALL_STAGING_HOOKS += SDL2_REMOVE_SDL2_CONFIG_CMAKE
+
 # We must enable static build to get compilation successful.
 SDL2_CONF_OPTS += --enable-static
 
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 2/2] package/orgre: bump to version 1.12.6
  2020-05-05 18:43 [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Romain Naour
@ 2020-05-05 18:43 ` Romain Naour
  2020-06-24 21:51 ` [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Thomas Petazzoni
  2020-07-16 16:20 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Romain Naour @ 2020-05-05 18:43 UTC (permalink / raw)
  To: buildroot

Remove upstream patch [1].

tinyxml has been replaced by pugixml [2].

Switch to git download method since github release without
the complete source code in the tarball [3].

Update indentation of hash file (two spaces).

The sdl2-config.cmake generated by sdl2 package is broken for
cross-compilation since it add /usr/include/SDL2 in CFLAGS.

Such flags are unsafe for cross-compilation since it mixes
headers for the host and target.

sdl2-config.cmake must be removed from staging since
we are using autotools build system to build sdl2 package
[4][5].

[1] https://github.com/OGRECave/ogre/commit/de4d5c920e23e1e2b21dc5c8192ef74ba6210cca
[2] https://github.com/OGRECave/ogre/commit/338103324096b78ae4718f97ac2150c4bb98c2d1
[3] https://github.com/OGRECave/ogre/issues/1332#issuecomment-563189058
[4] https://bugzilla.libsdl.org/show_bug.cgi?id=4597
[5] https://github.com/OGRECave/ogre/issues/1568

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
v2: remove patch
---
 ...ompiledHeader.cmake-Add-c-argument-t.patch | 57 -------------------
 package/ogre/Config.in                        |  1 +
 package/ogre/ogre.hash                        |  4 +-
 package/ogre/ogre.mk                          | 12 ++--
 4 files changed, 11 insertions(+), 63 deletions(-)
 delete mode 100644 package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch

diff --git a/package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch b/package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch
deleted file mode 100644
index 97f4e24890..0000000000
--- a/package/ogre/0001-CMake-Utils-PrecompiledHeader.cmake-Add-c-argument-t.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From f480ac538eb69086d4b7db855c2a457d5d6420d4 Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Mon, 10 Feb 2020 14:05:12 +0100
-Subject: [PATCH] CMake/Utils/PrecompiledHeader.cmake: Add -c argument to build
- precompiled headers
-
-Add "-c" argument when building precompiled headers to fix build with
-RELRO.
-
-More information on a similar issue with domoticz can be found here:
-https://patchwork.ozlabs.org/patch/1187328:
-
-"The problem AFAICS is that if no -c or similar option is given, GCC
-decides what needs to be done based on the rest of the arguments. If the
-rest of the arguments include a -Wl,... option, it decides that linking
-needs to be done. If the rest of the arguments are just header files, it
-decides to create a precompiled header."
-
-Fixes:
- - http://autobuild.buildroot.org/results/8fabf8d270b9257c3a9db6a2f17f1c08ec9428d3
-
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Upstream: https://github.com/OGRECave/ogre/commit/de4d5c920e23e1e2b21dc5c8192ef74ba6210cca]
----
- CMake/Utils/PrecompiledHeader.cmake | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/CMake/Utils/PrecompiledHeader.cmake b/CMake/Utils/PrecompiledHeader.cmake
-index a02d99acd..bfb0059db 100644
---- a/CMake/Utils/PrecompiledHeader.cmake
-+++ b/CMake/Utils/PrecompiledHeader.cmake
-@@ -133,11 +133,11 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _output)
-             STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
- 
-             SET(${out_command}
--              ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
-+              ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input}
-               )
-         ELSE(CMAKE_CXX_COMPILER_ARG1)
-             SET(${out_command}
--              ${CMAKE_CXX_COMPILER}  ${_compile_FLAGS} -x c++-header -o ${_output} ${_input}
-+              ${CMAKE_CXX_COMPILER}  ${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input}
-               )
-         ENDIF(CMAKE_CXX_COMPILER_ARG1)
-     ELSE(CMAKE_COMPILER_IS_GNUCXX)
-@@ -291,7 +291,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
-     set_target_properties(${_targetName}_pch_dephelp PROPERTIES INCLUDE_DIRECTORIES "${DIRINC}")
- 
-     #MESSAGE("_compile_FLAGS: ${_compile_FLAGS}")
--    #message("COMMAND ${CMAKE_CXX_COMPILER}	${_compile_FLAGS} -x c++-header -o ${_output} ${_input}")
-+    #message("COMMAND ${CMAKE_CXX_COMPILER}	${_compile_FLAGS} -x c++-header -c -o ${_output} ${_input}")
- 
-     ADD_CUSTOM_COMMAND(
-       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
--- 
-2.24.1
-
diff --git a/package/ogre/Config.in b/package/ogre/Config.in
index 1d7784714d..7d57d3f82a 100644
--- a/package/ogre/Config.in
+++ b/package/ogre/Config.in
@@ -10,6 +10,7 @@ config BR2_PACKAGE_OGRE
 	depends on BR2_USE_WCHAR # use wchar_t
 	select BR2_PACKAGE_FREETYPE
 	select BR2_PACKAGE_LIBFREEIMAGE
+	select BR2_PACKAGE_PUGIXML
 	select BR2_PACKAGE_SDL2
 	select BR2_PACKAGE_SDL2_OPENGL
 	select BR2_PACKAGE_SDL2_X11 # use wmInfo.info.x11
diff --git a/package/ogre/ogre.hash b/package/ogre/ogre.hash
index 8bb4ae96a1..3887299915 100644
--- a/package/ogre/ogre.hash
+++ b/package/ogre/ogre.hash
@@ -1,3 +1,3 @@
 # sha256 locally computed
-sha256 163e7700e319532d4389ecba91e3ab88551f78610886fa36f8f262f9a5080988  ogre-1.12.0.tar.gz
-sha256 82758e8d1d72139904b9b7472ef0f6544413d2871b58540307fdcc20e473e5f8  LICENSE
+sha256  4d2cd1c2fbfe17d6291ef8e3424f2e8614900241cf8b3d34bfee3cb08e57b205  ogre-v1.12.6.tar.gz
+sha256  82758e8d1d72139904b9b7472ef0f6544413d2871b58540307fdcc20e473e5f8  LICENSE
diff --git a/package/ogre/ogre.mk b/package/ogre/ogre.mk
index 2df685a23a..76ae9bb1e6 100644
--- a/package/ogre/ogre.mk
+++ b/package/ogre/ogre.mk
@@ -4,17 +4,21 @@
 #
 ################################################################################
 
-OGRE_VERSION = 1.12.0
-OGRE_SITE = $(call github,OGRECave,ogre,v$(OGRE_VERSION))
-OGRE_LICENSE = MIT (main library, DeferredShadingMedia samples), Public Domain (samples and plugins), Zlib (tinyxml)
+OGRE_VERSION = v1.12.6
+OGRE_SITE = https://github.com/OGRECave/ogre
+OGRE_SITE_METHOD = git
+OGRE_LICENSE = MIT (main library, DeferredShadingMedia samples), Public Domain (samples and plugins)
 OGRE_LICENSE_FILES = LICENSE
 OGRE_INSTALL_STAGING = YES
 
-# Ogre use a bundled version of tinyxml
+# Download with imgui submodule (https://github.com/ocornut/imgui
+OGRE_GIT_SUBMODULES = YES
+
 OGRE_DEPENDENCIES = host-pkgconf \
 	freetype \
 	libfreeimage \
 	libgl \
+	pugixml \
 	sdl2 \
 	xlib_libX11 \
 	xlib_libXaw \
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake
  2020-05-05 18:43 [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Romain Naour
  2020-05-05 18:43 ` [Buildroot] [PATCH v2 2/2] package/orgre: bump to version 1.12.6 Romain Naour
@ 2020-06-24 21:51 ` Thomas Petazzoni
  2020-07-16 16:20 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2020-06-24 21:51 UTC (permalink / raw)
  To: buildroot

On Tue,  5 May 2020 20:43:02 +0200
Romain Naour <romain.naour@gmail.com> wrote:

> We are using autotools build system for sdl2, so the sdl2-config.cmake
> include path are not resolved like for sdl2-config script [1].
> Remove sdl2-config.cmake file and avoid unsafe include path if this
> file is used by a cmake based package.
> 
> This trigger an issue with ogre 1.12.6 package that replaced
> FindSDL2.cmake by sdl2-config.cmake [2].
> 
> Thanks to Pavel Rojtberg for the help [3].
> 
> [1] https://bugzilla.libsdl.org/show_bug.cgi?id=4597
> [2] https://github.com/OGRECave/ogre/commit/6de6f9b4081a07c911932441700c54b72ec1ee1f
> [3] https://github.com/OGRECave/ogre/issues/1568
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
> v2: new patch
> ---
>  package/sdl2/sdl2.mk | 10 ++++++++++
>  1 file changed, 10 insertions(+)

I've applied to master. However, this would really need to be fixed
upstream: if the sdl2-config.cmake is not "prepared" properly when the
autotools build system is used, then why is it installed by the
autotools build system ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake
  2020-05-05 18:43 [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Romain Naour
  2020-05-05 18:43 ` [Buildroot] [PATCH v2 2/2] package/orgre: bump to version 1.12.6 Romain Naour
  2020-06-24 21:51 ` [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Thomas Petazzoni
@ 2020-07-16 16:20 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2020-07-16 16:20 UTC (permalink / raw)
  To: buildroot

>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:

 > We are using autotools build system for sdl2, so the sdl2-config.cmake
 > include path are not resolved like for sdl2-config script [1].
 > Remove sdl2-config.cmake file and avoid unsafe include path if this
 > file is used by a cmake based package.

 > This trigger an issue with ogre 1.12.6 package that replaced
 > FindSDL2.cmake by sdl2-config.cmake [2].

 > Thanks to Pavel Rojtberg for the help [3].

 > [1] https://bugzilla.libsdl.org/show_bug.cgi?id=4597
 > [2] https://github.com/OGRECave/ogre/commit/6de6f9b4081a07c911932441700c54b72ec1ee1f
 > [3] https://github.com/OGRECave/ogre/issues/1568

 > Signed-off-by: Romain Naour <romain.naour@gmail.com>

Committed to 2020.02.x and 2020.05.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-16 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05 18:43 [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Romain Naour
2020-05-05 18:43 ` [Buildroot] [PATCH v2 2/2] package/orgre: bump to version 1.12.6 Romain Naour
2020-06-24 21:51 ` [Buildroot] [PATCH v2 1/2] package/sdl2: remove sdl2-config.cmake Thomas Petazzoni
2020-07-16 16:20 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox