From dafb826dbbe5962dda98deddb3e31a160dd60aa7 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sat, 30 Jul 2016 00:54:28 +1000 Subject: cegui: unify patches --- src/cegui-1-fixes.patch | 52 +++++++++++++++++++++++++++++++++++ src/cegui-build-pkgconfig-files.patch | 13 --------- src/cegui-fix-linking-order.patch | 19 ------------- src/cegui.mk | 2 -- 4 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 src/cegui-1-fixes.patch delete mode 100644 src/cegui-build-pkgconfig-files.patch delete mode 100644 src/cegui-fix-linking-order.patch diff --git a/src/cegui-1-fixes.patch b/src/cegui-1-fixes.patch new file mode 100644 index 0000000..61f2c3c --- /dev/null +++ b/src/cegui-1-fixes.patch @@ -0,0 +1,52 @@ +This file is part of MXE. +See index.html for further information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Quintus +Date: Fri, 29 Jul 2016 23:11:19 +1000 +Subject: [PATCH] Fix linking order. + +Fixed upstream since commit bf699651740a1206c9ce214b91426db1e709ddc4, +which was after version 0.8.7, so remove this patch when upgrading to +version 0.8.8 or newer. +See: https://bitbucket.org/cegui/cegui/issues/1131/opengl-renderers-fail-to-crosscompile-due + +diff --git a/cegui/src/RendererModules/OpenGL/CMakeLists.txt b/cegui/src/RendererModules/OpenGL/CMakeLists.txt +index 1111111..2222222 100644 +--- a/cegui/src/RendererModules/OpenGL/CMakeLists.txt ++++ b/cegui/src/RendererModules/OpenGL/CMakeLists.txt +@@ -52,9 +52,9 @@ if (${CEGUI_USE_EPOXY}) + cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) + cegui_add_dependency(${CEGUI_TARGET_NAME} EPOXY) + elseif (${CEGUI_USE_GLEW}) +- cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) + cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) + cegui_add_dependency(${CEGUI_TARGET_NAME} GLEW PUBLIC) ++ cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) + endif () + + cegui_target_link_libraries(${CEGUI_TARGET_NAME} ${CEGUI_BASE_LIBNAME}) + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Quintus +Date: Fri, 29 Jul 2016 23:12:27 +1000 +Subject: [PATCH] Build .pc files on Windows + +CEGUI does not build the .pc files when targetting Windows. +See upstream ticket: https://bitbucket.org/cegui/cegui/issues/1135 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1111111..2222222 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -599,7 +599,7 @@ configure_file( cegui/include/CEGUI/ModuleConfig.h.in cegui/include/CEGUI/Module + configure_file( samples/common/include/CEGUISamplesConfig.h.in samples/common/include/CEGUISamplesConfig.h ) + configure_file( doc/doxygen/doxyfile.in doc/doxygen/doxyfile ) + +-if (UNIX AND NOT APPLE) ++if (NOT(APPLE)) + configure_file( cegui/CEGUI.pc.in cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc @ONLY ) + install(FILES ${PROJECT_BINARY_DIR}/cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc DESTINATION ${CEGUI_PKGCONFIG_INSTALL_DIR}) + diff --git a/src/cegui-build-pkgconfig-files.patch b/src/cegui-build-pkgconfig-files.patch deleted file mode 100644 index 55d7562..0000000 --- a/src/cegui-build-pkgconfig-files.patch +++ /dev/null @@ -1,13 +0,0 @@ -# CEGUI does not build the .pc files when targetting Windows. -# See upstream ticket: https://bitbucket.org/cegui/cegui/issues/1135 ---- old/CMakeLists.txt 2016-04-28 21:12:57.000000000 +0200 -+++ new/CMakeLists.txt 2016-07-29 13:07:15.095432616 +0200 -@@ -599,7 +599,7 @@ - configure_file( samples/common/include/CEGUISamplesConfig.h.in samples/common/include/CEGUISamplesConfig.h ) - configure_file( doc/doxygen/doxyfile.in doc/doxygen/doxyfile ) - --if (UNIX AND NOT APPLE) -+if (NOT(APPLE)) - configure_file( cegui/CEGUI.pc.in cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc @ONLY ) - install(FILES ${PROJECT_BINARY_DIR}/cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc DESTINATION ${CEGUI_PKGCONFIG_INSTALL_DIR}) - diff --git a/src/cegui-fix-linking-order.patch b/src/cegui-fix-linking-order.patch deleted file mode 100644 index 2f43ff1..0000000 --- a/src/cegui-fix-linking-order.patch +++ /dev/null @@ -1,19 +0,0 @@ -# Fix linking order. -# -# Fixed upstream since commit bf699651740a1206c9ce214b91426db1e709ddc4, -# which was after version 0.8.7, so remove this patch when upgrading to -# version 0.8.8 or newer. -# See: https://bitbucket.org/cegui/cegui/issues/1131/opengl-renderers-fail-to-crosscompile-due ---- old/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-04-23 20:19:40.000000000 +0200 -+++ new/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-07-29 11:58:25.062131930 +0200 -@@ -52,9 +52,9 @@ - cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) - cegui_add_dependency(${CEGUI_TARGET_NAME} EPOXY) - elseif (${CEGUI_USE_GLEW}) -- cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) - cegui_add_dependency(${CEGUI_TARGET_NAME} GLM) - cegui_add_dependency(${CEGUI_TARGET_NAME} GLEW PUBLIC) -+ cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL) - endif () - - cegui_target_link_libraries(${CEGUI_TARGET_NAME} ${CEGUI_BASE_LIBNAME}) diff --git a/src/cegui.mk b/src/cegui.mk index 913c747..eb4781a 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -30,8 +30,6 @@ endef # -DCMAKE_CXX_FLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" define $(PKG)_BUILD mkdir '$(1)/build' - $(PATCH) -d '$(1)' -p1 < '$(TOP_DIR)/src/cegui-fix-linking-order.patch' - $(PATCH) -d '$(1)' -p1 < '$(TOP_DIR)/src/cegui-build-pkgconfig-files.patch' cd '$(1)/build' && export CXXFLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" \ && cmake .. \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ -- cgit v0.12 From d55222f3131ddb459b238e8ca8f7f93f5ab938dc Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sat, 30 Jul 2016 00:55:39 +1000 Subject: cegui: fix test and miminise invocation --- src/cegui-test.cpp | 6 +++--- src/cegui.mk | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cegui-test.cpp b/src/cegui-test.cpp index 36b5bf3..1249f81 100644 --- a/src/cegui-test.cpp +++ b/src/cegui-test.cpp @@ -8,9 +8,9 @@ * and makes CEGUI draw an "in-game" window into it. ************************************************/ -#include #include #include +#include // We’re lazy using namespace CEGUI; @@ -65,11 +65,11 @@ int main(int argc, char* argv[]) // Create the hypothetical CEGUI root window Window* p_root_window = WindowManager::getSingleton().createWindow("DefaultWindow", "root"); - gui_context.setRootWindow(p_rootwindow); + gui_context.setRootWindow(p_root_window); // Create an actual framed window we can look onto FrameWindow* p_frame_window = static_cast(WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow", "testWindow")); - p_root_window->addChildWindow(p_frame_window); + p_root_window->addChild(p_frame_window); p_frame_window->setPosition(UVector2(UDim(0.25f, 0), UDim(0.25f, 0))); p_frame_window->setSize(USize(UDim(0.5f, 0), UDim(0.5f, 0))); p_frame_window->setText("Hello World!"); diff --git a/src/cegui.mk b/src/cegui.mk index eb4781a..9bc23da 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -68,9 +68,7 @@ define $(PKG)_BUILD '$(TARGET)-g++' \ -W -Wall -ansi -pedantic \ '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe' \ - `$(TARGET)-pkg-config --cflags --libs CEGUI-0-OPENGL glut freetype2 libpcre` \ - -lCEGUIFreeImageImageCodec -lCEGUIXercesParser -lCEGUICoreWindowRendererSet \ - `$(TARGET)-pkg-config --libs --cflags freeimage xerces-c` + `$(TARGET)-pkg-config --cflags --libs CEGUI-0-OPENGL glut gl` endef $(PKG)_BUILD_x86_64-w64-mingw32 = -- cgit v0.12 From b76e4b734ba5a80d241b7b5e080cd530e16eeb3c Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sat, 30 Jul 2016 00:58:33 +1000 Subject: cegui: reformat and remove freetype2 workaround --- src/cegui.mk | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/cegui.mk b/src/cegui.mk index 9bc23da..36b647c 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -10,9 +10,6 @@ $(PKG)_FILE := cegui-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/crayzedsgui/CEGUI%20Mk-2/0.8/$($(PKG)_FILE)?download $(PKG)_DEPS := gcc expat freeglut freeimage freetype libxml2 pcre xerces devil glm glew -# Does not detect the freetype header directory otherwise -#$(PKG)_CXXFLAGS := -I/home/quintus/repos/privat/projekte/misc/mxe/usr/i686-w64-mingw32.static/include/freetype2 -I/home/quintus/repos/privat/projekte/misc/mxe/usr/i686-w64-mingw32.static/include - define $(PKG)_UPDATE $(WGET) -q -O- 'https://bitbucket.org/cegui/cegui/downloads' | \ $(SED) -n 's,.*href=.*get/v\([0-9]*-[0-9]*-[0-9]*\)\.tar.*,\1,p' | \ @@ -21,19 +18,10 @@ define $(PKG)_UPDATE tail -1 endef -# The shell escape is required to make CEGUI find the freetype2 header -# directory, and to define the FREEIMAGE_LIB macro that prevents "_imp__" -# errors when linking to freeimage. The glew one is required to -# define GLEW_STATIC, but this is not completed yet (still gives "_imp__" -# errors on glew). -# cd '$(1)' && $(PATCH) < $(TOP_DIR)/src/cegui-find-glew32.patch -# -DCMAKE_CXX_FLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" +# Use pkg-config to set FREEIMAGE_LIB and GLEW_STATIC to prevent "_imp__" errors define $(PKG)_BUILD - mkdir '$(1)/build' - cd '$(1)/build' && export CXXFLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" \ - && cmake .. \ - -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ - -DCEGUI_BUILD_STATIC_CONFIGURATION=$(if $(BUILD_STATIC),true,false) \ + cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ + -DCEGUI_BUILD_STATIC_CONFIGURATION=$(CMAKE_STATIC_BOOL) \ -DCEGUI_SAMPLES_ENABLED=OFF \ -DCEGUI_BUILD_TESTS=OFF \ -DCEGUI_BUILD_APPLICATION_TEMPLATES=OFF \ @@ -61,9 +49,12 @@ define $(PKG)_BUILD -DCEGUI_BUILD_RENDERER_OGRE=OFF \ -DCEGUI_BUILD_RENDERER_OPENGL=ON \ -DCEGUI_BUILD_RENDERER_OPENGL3=OFF \ - -DCEGUI_BUILD_RENDERER_OPENGLES=OFF + -DCEGUI_BUILD_RENDERER_OPENGLES=OFF \ + -DCMAKE_CXX_FLAGS="`$(TARGET)-pkg-config --cflags glew freeimage`" \ + $(SOURCE_DIR) - $(MAKE) -C '$(1)/build' -j '$(JOBS)' install VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1 + $(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1 '$(TARGET)-g++' \ -W -Wall -ansi -pedantic \ -- cgit v0.12 From 1e003176155bf05ba843bb4a93842154f842ef79 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Sat, 30 Jul 2016 00:59:31 +1000 Subject: cegui: enable shared and x86_64 builds --- src/cegui.mk | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cegui.mk b/src/cegui.mk index 36b647c..7493063 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -19,6 +19,7 @@ define $(PKG)_UPDATE endef # Use pkg-config to set FREEIMAGE_LIB and GLEW_STATIC to prevent "_imp__" errors +# freeimage and xerces don't have shared builds - disable with $(CMAKE_STATIC_BOOL) define $(PKG)_BUILD cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \ -DCEGUI_BUILD_STATIC_CONFIGURATION=$(CMAKE_STATIC_BOOL) \ @@ -27,14 +28,14 @@ define $(PKG)_BUILD -DCEGUI_BUILD_APPLICATION_TEMPLATES=OFF \ -DCEGUI_BUILD_LUA_MODULE=OFF \ -DCEGUI_BUILD_PYTHON_MODULES=OFF \ - -DCEGUI_BUILD_XMLPARSER_XERCES=ON \ + -DCEGUI_BUILD_XMLPARSER_XERCES=$(CMAKE_STATIC_BOOL) \ -DCEGUI_BUILD_XMLPARSER_LIBXML2=OFF \ -DCEGUI_BUILD_XMLPARSER_EXPAT=ON \ -DCEGUI_BUILD_XMLPARSER_TINYXML=OFF \ -DCEGUI_BUILD_XMLPARSER_RAPIDXML=OFF \ -DCEGUI_BUILD_IMAGECODEC_CORONA=OFF \ -DCEGUI_BUILD_IMAGECODEC_DEVIL=OFF \ - -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=ON \ + -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=$(CMAKE_STATIC_BOOL) \ -DCEGUI_BUILD_IMAGECODEC_PVR=OFF \ -DCEGUI_BUILD_IMAGECODEC_SDL2=OFF \ -DCEGUI_BUILD_IMAGECODEC_SILLY=OFF \ @@ -61,7 +62,3 @@ define $(PKG)_BUILD '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe' \ `$(TARGET)-pkg-config --cflags --libs CEGUI-0-OPENGL glut gl` endef - -$(PKG)_BUILD_x86_64-w64-mingw32 = - -$(PKG)_BUILD_SHARED = -- cgit v0.12