From 44b2d8c6946dc538b7a9dab9c7fca26036196f8a Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Tue, 5 Aug 2014 00:13:41 +0200 Subject: [PATCH 1/8] cairo: Make patch useful in static and shared builds. --- src/cairo-2-static-init.patch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cairo-2-static-init.patch b/src/cairo-2-static-init.patch index 16d74c3a..515a5243 100644 --- a/src/cairo-2-static-init.patch +++ b/src/cairo-2-static-init.patch @@ -4,23 +4,27 @@ See index.html for further information. When DllMain is not being run, we need to initialize the font face mutex before using it. diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c -index a65d81b..31d854d 100644 +index a65d81b..d6950a1 100644 --- a/src/win32/cairo-win32-font.c +++ b/src/win32/cairo-win32-font.c -@@ -1912,6 +1912,8 @@ _cairo_win32_font_face_hash_table_destroy (void) +@@ -1912,6 +1912,10 @@ _cairo_win32_font_face_hash_table_destroy (void) { cairo_hash_table_t *hash_table; ++#ifdef CAIRO_WIN32_STATIC_BUILD + CAIRO_MUTEX_INITIALIZE (); ++#endif + /* We manually acquire the lock rather than calling * _cairo_win32_font_face_hash_table_lock simply to avoid creating * the table only to destroy it again. */ -@@ -1927,6 +1929,8 @@ _cairo_win32_font_face_hash_table_destroy (void) +@@ -1927,6 +1931,10 @@ _cairo_win32_font_face_hash_table_destroy (void) static cairo_hash_table_t * _cairo_win32_font_face_hash_table_lock (void) { ++#ifdef CAIRO_WIN32_STATIC_BUILD + CAIRO_MUTEX_INITIALIZE (); ++#endif + CAIRO_MUTEX_LOCK (_cairo_win32_font_face_mutex); From c81ba63efe052698c46b8b92932a4a5a007c6bf1 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 18:19:30 +0200 Subject: [PATCH 2/8] libsigc++: Update. --- src/libsigc++.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsigc++.mk b/src/libsigc++.mk index 6775c285..a70e918f 100644 --- a/src/libsigc++.mk +++ b/src/libsigc++.mk @@ -3,8 +3,8 @@ PKG := libsigc++ $(PKG)_IGNORE := -$(PKG)_VERSION := 2.3.1 -$(PKG)_CHECKSUM := 6d23b44ab37b4f908c850c3d9898e42da54a0d8d +$(PKG)_VERSION := 2.4.0 +$(PKG)_CHECKSUM := 74f992ce5714e9f9d63ab698b48d79a65c0cd5be $(PKG)_SUBDIR := libsigc++-$($(PKG)_VERSION) $(PKG)_FILE := libsigc++-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnome.org/pub/gnome/sources/libsigc++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) @@ -23,5 +23,5 @@ define $(PKG)_BUILD CXX='$(TARGET)-g++' \ PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \ MAKE=$(MAKE) - $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + $(MAKE) -C '$(1)' -j '$(JOBS)' install $(MXE_DISABLE_CRUFT) endef From 83c5ba324bdd1aebcb918bb246c4db94f11c5528 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 18:30:44 +0200 Subject: [PATCH 3/8] cairomm: Update & enable shared. --- src/cairomm.mk | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/cairomm.mk b/src/cairomm.mk index 88b9a8f2..81b0fe23 100644 --- a/src/cairomm.mk +++ b/src/cairomm.mk @@ -3,8 +3,8 @@ PKG := cairomm $(PKG)_IGNORE := -$(PKG)_VERSION := 1.10.0 -$(PKG)_CHECKSUM := f08bf8a331067f0d1e876523f07238fba6b26b99 +$(PKG)_VERSION := 1.11.2 +$(PKG)_CHECKSUM := 35e190a03f760924bece5dc1204cc36b3583c806 $(PKG)_SUBDIR := cairomm-$($(PKG)_VERSION) $(PKG)_FILE := cairomm-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://cairographics.org/releases/$($(PKG)_FILE) @@ -19,11 +19,8 @@ endef define $(PKG)_BUILD cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ + $(MXE_CONFIGURE_OPTS) \ MAKE=$(MAKE) - $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + $(MAKE) -C '$(1)' -j '$(JOBS)' install $(MXE_DISABLE_CRUFT) endef -$(PKG)_BUILD_SHARED = From 3c2562b8d294c549ae5110b00de463a9898e5be1 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 19:00:22 +0200 Subject: [PATCH 4/8] gdb: Use "system" readline, enable shared. --- src/gdb.mk | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gdb.mk b/src/gdb.mk index a9d6d227..6d57a46a 100644 --- a/src/gdb.mk +++ b/src/gdb.mk @@ -8,7 +8,7 @@ $(PKG)_SUBDIR := gdb-$($(PKG)_VERSION) $(PKG)_FILE := gdb-$($(PKG)_VERSION).tar.xz $(PKG)_URL := http://ftp.gnu.org/pub/gnu/$(PKG)/$($(PKG)_FILE) $(PKG)_URL_2 := ftp://ftp.cs.tu-berlin.de/pub/gnu/$(PKG)/$($(PKG)_FILE) -$(PKG)_DEPS := gcc expat libiconv pdcurses zlib +$(PKG)_DEPS := gcc expat libiconv readline zlib define $(PKG)_UPDATE $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gdb/?C=M;O=D' | \ @@ -19,13 +19,10 @@ endef define $(PKG)_BUILD cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --build="`config.guess`" \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ + $(MXE_CONFIGURE_OPTS) \ + --with-system-readline \ CONFIG_SHELL=$(SHELL) $(MAKE) -C '$(1)' -j '$(JOBS)' $(MAKE) -C '$(1)' -j 1 install endef -$(PKG)_BUILD_SHARED = From 847683cd5cc43f0aa6852882df631f2d42962e7c Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 20:11:10 +0200 Subject: [PATCH 5/8] json-c: Update, enable shared & refresh patch. This fixes CVE-2013-6371 and CVE-2013-6370. --- src/json-c-1-patch-remove-rpl.patch | 12 ++++++------ src/json-c-2-fix-wincrypt-include.patch | 21 +++++++++++++++++++++ src/json-c.mk | 14 +++++--------- 3 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 src/json-c-2-fix-wincrypt-include.patch diff --git a/src/json-c-1-patch-remove-rpl.patch b/src/json-c-1-patch-remove-rpl.patch index 2217b2ac..153ce114 100644 --- a/src/json-c-1-patch-remove-rpl.patch +++ b/src/json-c-1-patch-remove-rpl.patch @@ -3,14 +3,14 @@ See index.html for further information. see http://lists.fedoraproject.org/pipermail/mingw/2009-May/001567.html ---- a/configure.in 2012-07-12 01:57:09.000000000 +0200 -+++ b/configure.in 2012-07-12 01:59:06.000000000 +0200 -@@ -25,8 +25,6 @@ +--- a/configure.ac 2014-04-11 03:47:07.000000000 +0200 ++++ b/configure.ac 2014-10-12 19:44:52.809838565 +0200 +@@ -40,8 +40,6 @@ # Checks for library functions. AC_FUNC_VPRINTF AC_FUNC_MEMCMP -AC_FUNC_MALLOC -AC_FUNC_REALLOC - AC_CHECK_FUNCS(strcasecmp strdup strndup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) - - #check if .section.gnu.warning accepts long strings (for __warn_references) + AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale) + AC_CHECK_DECLS([INFINITY], [], [], [[#include ]]) + AC_CHECK_DECLS([nan], [], [], [[#include ]]) diff --git a/src/json-c-2-fix-wincrypt-include.patch b/src/json-c-2-fix-wincrypt-include.patch new file mode 100644 index 00000000..83c5553b --- /dev/null +++ b/src/json-c-2-fix-wincrypt-include.patch @@ -0,0 +1,21 @@ +This file is part of MXE. +See index.html for further information. + +mingw32 doesn't include wincrypt.h in windows.h, so the build fails. + +This is basically +https://github.com/ams-cs/json-c/commit/ca0ebe0f71b806f73a20d5d5e0da78aba5de42be + +--- a/random_seed.c 2014-04-11 02:41:08.000000000 +0200 ++++ b/random_seed.c 2014-10-12 20:07:32.419043270 +0200 +@@ -181,7 +181,10 @@ + #define HAVE_CRYPTGENRANDOM 1 + + #include ++#include ++#ifndef __GNUC__ + #pragma comment(lib, "advapi32.lib") ++#endif + + static int get_cryptgenrandom_seed() + { diff --git a/src/json-c.mk b/src/json-c.mk index ac51c1e8..62ea1434 100644 --- a/src/json-c.mk +++ b/src/json-c.mk @@ -3,8 +3,8 @@ PKG := json-c $(PKG)_IGNORE := -$(PKG)_VERSION := 0.11 -$(PKG)_CHECKSUM := 4bae2468bfd73a2b2eec7419c75c262b5833f567 +$(PKG)_VERSION := 0.12 +$(PKG)_CHECKSUM := c6d8019c706af146006aa6cd91839c7d3c581e94 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION)-nodoc.tar.gz $(PKG)_URL := https://s3.amazonaws.com/$(PKG)_releases/releases/$($(PKG)_FILE) @@ -21,17 +21,13 @@ endef define $(PKG)_BUILD cd '$(1)' && ./autogen.sh cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --prefix='$(PREFIX)/$(TARGET)' \ - --build="`config.guess`"\ - --disable-shared + $(MXE_CONFIGURE_OPTS) \ CFLAGS=-Wno-error - $(MAKE) -C '$(1)' -j '$(JOBS)' install + $(MAKE) -C '$(1)' -j '$(JOBS)' install $(MXE_REMOVE_CRUFT) '$(TARGET)-gcc' \ -W -Wall -Werror -ansi -pedantic \ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-json-c.exe' \ - `'$(TARGET)-pkg-config' json --cflags --libs` + `'$(TARGET)-pkg-config' json-c --cflags --libs` endef -$(PKG)_BUILD_SHARED = From c13477914812a43099b3fbf3165938e3058855f6 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 20:57:49 +0200 Subject: [PATCH 6/8] glfw2: Enable shared build --- src/glfw2.mk | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/glfw2.mk b/src/glfw2.mk index dfbf760f..95d95e0e 100644 --- a/src/glfw2.mk +++ b/src/glfw2.mk @@ -22,7 +22,23 @@ define $(PKG)_BUILD cd '$(1)/lib/win32' && $(MAKE) -f Makefile.win32.cross-mgw \ TARGET=$(TARGET)- \ PREFIX='$(PREFIX)/$(TARGET)' \ - install -j '$(JOBS)' + $(if $(BUILD_STATIC),libglfw.a,glfw.dll) libglfw.pc -j '$(JOBS)' + + # Install manually to split static and shared + $(INSTALL) -d '$(PREFIX)/$(TARGET)/bin' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig' + $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib' + $(if $(BUILD_STATIC), \ + $(INSTALL) -c -m 644 '$(1)/lib/win32/libglfw.pc' '$(PREFIX)/$(TARGET)/lib/pkgconfig/libglfw.pc' + $(INSTALL) -c -m 644 '$(1)/lib/win32/libglfw.a' '$(PREFIX)/$(TARGET)/lib/libglfw.a', \ + $(SED) -e "s|Cflags:|Cflags: -DGLFW_DLL|g" '$(1)/lib/win32/libglfw.pc' > \ + '$(PREFIX)/$(TARGET)/lib/pkgconfig/libglfw.pc'; \ + $(INSTALL) -c '$(1)/lib/win32/glfw.dll' '$(PREFIX)/$(TARGET)/bin/glfw.dll'; \ + $(INSTALL) -c '$(1)/lib/win32/libglfwdll.a' '$(PREFIX)/$(TARGET)/lib/libglfw.dll.a') + $(INSTALL) -d '$(PREFIX)/$(TARGET)/include/GL' + $(INSTALL) -c -m 644 $(1)/include/GL/glfw.h '$(PREFIX)/$(TARGET)/include/GL/glfw.h' + + #Test '$(TARGET)-gcc' \ @@ -31,4 +47,3 @@ define $(PKG)_BUILD `'$(TARGET)-pkg-config' libglfw --cflags --libs` endef -$(PKG)_BUILD_SHARED = From 05c7f490a9aa15e2ced65901222d7bbb2bbe8cad Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 21:52:30 +0200 Subject: [PATCH 7/8] glfw3: Update, enable shared & refresh patch. --- src/glfw3-1-fixes.patch | 88 ++++------------------------------------- src/glfw3.mk | 12 ++++-- 2 files changed, 16 insertions(+), 84 deletions(-) diff --git a/src/glfw3-1-fixes.patch b/src/glfw3-1-fixes.patch index 969adb76..3112cdff 100644 --- a/src/glfw3-1-fixes.patch +++ b/src/glfw3-1-fixes.patch @@ -1,81 +1,19 @@ This file is part of MXE. See index.html for further information. -Contains ad hoc patches for cross building. +Add option to install pkg-config file -From 7106d77856268c39b08de8cbe6f526fda8506389 Mon Sep 17 00:00:00 2001 -From: MXE -Date: Sun, 10 Nov 2013 16:23:03 +1100 -Subject: [PATCH] add option to install pkg-config file - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7c9b2c2..cd0112c 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -14,6 +14,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF) - option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) +--- a/CMakeLists.txt 2013-12-31 20:06:18.000000000 +0100 ++++ b/CMakeLists.txt 2014-10-12 21:02:16.415982168 +0200 +@@ -15,6 +15,7 @@ option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) + option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON) option(GLFW_INSTALL "Generate installation target" ON) +option(GLFW_INSTALL_PKG_CONFIG "Install pkg-config file" OFF) option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) if (WIN32) -@@ -117,7 +118,7 @@ endif() - #-------------------------------------------------------------------- - if (WIN32) - set(_GLFW_WIN32 1) -- message(STATUS "Using Win32 for window creation") -+ message(STATUS "Using Win32 for window creation") - - if (GLFW_USE_EGL) - set(_GLFW_EGL 1) -@@ -133,7 +134,7 @@ elseif (APPLE) - message(STATUS "Using NSGL for context creation") - elseif (UNIX) - set(_GLFW_X11 1) -- message(STATUS "Using X11 for window creation") -+ message(STATUS "Using X11 for window creation") - - if (GLFW_USE_EGL) - set(_GLFW_EGL 1) -@@ -238,7 +239,7 @@ if (_GLFW_X11) - # Check for Xkb (X keyboard extension) - if (NOT X11_Xkb_FOUND) - message(FATAL_ERROR "The X keyboard extension headers were not found") -- endif() -+ endif() - - list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH}) - -@@ -336,7 +337,7 @@ endif() - # Use Cocoa for window creation and NSOpenGL for context creation - #-------------------------------------------------------------------- - if (_GLFW_COCOA AND _GLFW_NSGL) -- -+ - if (GLFW_USE_MENUBAR) - set(_GLFW_USE_MENUBAR 1) - endif() -@@ -351,7 +352,7 @@ if (_GLFW_COCOA AND _GLFW_NSGL) - else() - message(STATUS "Building GLFW only for the native architecture") - endif() -- -+ - # Set up library and include paths - find_library(COCOA_FRAMEWORK Cocoa) - find_library(IOKIT_FRAMEWORK IOKit) -@@ -386,7 +387,7 @@ endif() - configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in - ${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY) - --configure_file(${GLFW_SOURCE_DIR}/src/config.h.in -+configure_file(${GLFW_SOURCE_DIR}/src/config.h.in - ${GLFW_BINARY_DIR}/src/config.h @ONLY) - - configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in -@@ -395,7 +396,7 @@ configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in +@@ -392,7 +393,7 @@ configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY) @@ -84,16 +22,7 @@ index 7c9b2c2..cd0112c 100644 configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) endif() -@@ -422,7 +423,7 @@ endif() - # The library is installed by src/CMakeLists.txt - #-------------------------------------------------------------------- - if (GLFW_INSTALL) -- install(DIRECTORY include/GLFW DESTINATION include -+ install(DIRECTORY include/GLFW DESTINATION include - FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) - - install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake -@@ -431,6 +432,9 @@ if (GLFW_INSTALL) +@@ -428,6 +429,9 @@ if (UNIX) install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) @@ -103,6 +32,3 @@ index 7c9b2c2..cd0112c 100644 install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) endif() --- -1.8.4 - diff --git a/src/glfw3.mk b/src/glfw3.mk index d6a35d4f..36816fa2 100644 --- a/src/glfw3.mk +++ b/src/glfw3.mk @@ -3,8 +3,8 @@ PKG := glfw3 $(PKG)_IGNORE := -$(PKG)_VERSION := 3.0.3 -$(PKG)_CHECKSUM := 95d0d2a250dc4e9d612cdd1a7433de464db16d89 +$(PKG)_VERSION := 3.0.4 +$(PKG)_CHECKSUM := 9b04309418ccbc74b2115d11198b7912669814ee $(PKG)_SUBDIR := glfw-$($(PKG)_VERSION) $(PKG)_FILE := glfw-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/glfw/glfw/$($(PKG)_VERSION)/$($(PKG)_FILE) @@ -22,16 +22,22 @@ define $(PKG)_BUILD mkdir '$(1).build' cd '$(1).build' && cmake '$(1)' \ -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ + -DBUILD_SHARED_LIBS=$(if $(BUILD_STATIC),FALSE,TRUE) \ -DGLFW_BUILD_EXAMPLES=FALSE \ -DGLFW_BUILD_TESTS=FALSE \ + -DGLFW_BUILD_DOCS=FALSE \ -DGLFW_INSTALL_PKG_CONFIG=TRUE \ -DGLFW_PKG_LIBS='-lopengl32 -lgdi32' $(MAKE) -C '$(1).build' -j '$(JOBS)' install + # Windows convention: DLLs in bin/, not in lib/, import library is called "libglfw3.dll.a" + $(if $(BUILD_SHARED), + mv -fv $(PREFIX)/$(TARGET)/lib/glfw3.dll '$(PREFIX)/$(TARGET)/bin/'; \ + mv -fv $(PREFIX)/$(TARGET)/lib/glfw3dll.a '$(PREFIX)/$(TARGET)/lib/libglfw3.dll.a') + '$(TARGET)-gcc' \ -W -Wall -Werror -ansi -pedantic \ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-glfw3.exe' \ `'$(TARGET)-pkg-config' glfw3 --cflags --libs` endef -$(PKG)_BUILD_SHARED = From 08e6e0f3ae12cb154e5ce0d2ba605ff00cb772e1 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 12 Oct 2014 22:34:12 +0200 Subject: [PATCH 8/8] gta: Enable shared build. --- src/gta.mk | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gta.mk b/src/gta.mk index 05a05e42..3537e3ed 100644 --- a/src/gta.mk +++ b/src/gta.mk @@ -19,11 +19,8 @@ endef define $(PKG)_BUILD cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --build="`config.guess`" \ - --disable-shared \ - --disable-reference \ - --prefix='$(PREFIX)/$(TARGET)' + $(MXE_CONFIGURE_OPTS) \ + --disable-reference $(MAKE) -C '$(1)' -j '$(JOBS)' $(MAKE) -C '$(1)' -j 1 install dist_doc_DATA= @@ -33,4 +30,3 @@ define $(PKG)_BUILD `'$(TARGET)-pkg-config' gta --cflags --libs` endef -$(PKG)_BUILD_SHARED =