From 9faa9f663fd62bf5d94f00f7fecd63d20f4ae043 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 23 Nov 2012 08:55:28 +0100 Subject: update package qjson --- index.html | 2 +- src/qjson-1-static.patch | 96 ++++++++++++++++++++++++++++++++---------------- src/qjson.mk | 4 +- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/index.html b/index.html index 31c43f7..9f906a7 100644 --- a/index.html +++ b/index.html @@ -1805,7 +1805,7 @@ USE_OSGPLUGIN(<plugin2>) qjson - 0.7.1 + 0.8.0 QJson diff --git a/src/qjson-1-static.patch b/src/qjson-1-static.patch index 0474cf0..77f54e5 100644 --- a/src/qjson-1-static.patch +++ b/src/qjson-1-static.patch @@ -1,20 +1,25 @@ This file is part of MXE. See index.html for further information. -This patch taken from: +From 5c1a9928d925dacebb56f191fec349077c750dbf Mon Sep 17 00:00:00 2001 +From: Mark Brand +Date: Fri, 23 Nov 2012 08:41:43 +0100 +Subject: [PATCH 1/2] build as static lib + +taken from: http://sourceforge.net/mailarchive/forum.php?thread_name=4E1DBC0D.10000%40jrit.at&forum_name=qjson-devel diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4ed5478..9a378a1 100644 +index 07d84c6..3aee52d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -30,6 +30,13 @@ IF(QJSON_VERBOSE_DEBUG_OUTPUT) - ADD_DEFINITIONS("-DQJSON_VERBOSE_DEBUG_OUTPUT") - endif(QJSON_VERBOSE_DEBUG_OUTPUT) +@@ -31,6 +31,13 @@ SET(FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/Library/Frameworks" + # (This will have no effect with CMake < 2.8) + SET(QT_USE_IMPORTED_TARGETS TRUE) +# For Static builds +IF(LIBTYPE STREQUAL "STATIC") -+ ADD_DEFINITIONS("-DQJSON_STATIC") ++ ADD_DEFINITIONS("-DQJSON_STATIC") + ADD_DEFINITIONS("-DQT_NODLL") + SET(PKG_CONFIG_CFLAGS -DQJSON_STATIC ${PKG_CONFIG_CFLAGS}) +endif() @@ -22,22 +27,6 @@ index 4ed5478..9a378a1 100644 # Find Qt4 FIND_PACKAGE( Qt4 REQUIRED ) -@@ -51,13 +58,13 @@ set(QJSON_LIB_VERSION_STRING "${QJSON_LIB_MAJOR_VERSION}.${QJSON_LIB_MINOR_VERSI - set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}" ) - - # pkg-config --IF (NOT WIN32) -+if (NOT WIN32 OR MINGW) - CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/QJson.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/QJson.pc - @ONLY) - INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/QJson.pc - DESTINATION lib${LIB_SUFFIX}/pkgconfig) --ENDIF (NOT WIN32) -+endif() - - # Include the cmake file needed to use qt4 - INCLUDE( ${QT_USE_FILE} ) diff --git a/QJson.pc.in b/QJson.pc.in index e4704bd..bf5fd01 100644 --- a/QJson.pc.in @@ -50,25 +39,25 @@ index e4704bd..bf5fd01 100644 \ No newline at end of file +Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index ced213d..d0d9c68 100644 +index e2e8a13..c164b04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -26,7 +26,12 @@ qt4_wrap_cpp(qjson_MOC_SRCS ${qjson_MOC_HDRS}) - +@@ -15,7 +15,12 @@ qt4_wrap_cpp(qjson_MOC_SRCS ${qjson_MOC_HDRS}) set (qjson_SRCS parser.cpp qobjecthelper.cpp json_scanner.cpp json_parser.cc parserrunnable.cpp serializer.cpp serializerrunnable.cpp) + set (qjson_HEADERS parser.h parserrunnable.h qobjecthelper.h serializer.h serializerrunnable.h qjson_export.h) --add_library (qjson SHARED ${qjson_SRCS} ${qjson_MOC_SRCS}) +-add_library (qjson SHARED ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS}) +IF(LIBTYPE STREQUAL "STATIC") -+ add_library (qjson STATIC ${qjson_SRCS} ${qjson_MOC_SRCS}) ++ add_library (qjson STATIC ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS}) +else() -+ add_library (qjson SHARED ${qjson_SRCS} ${qjson_MOC_SRCS}) -+endif() ++ add_library (qjson SHARED ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS}) ++endif() + target_link_libraries( qjson ${QT_LIBRARIES}) - set_target_properties(qjson PROPERTIES + if(NOT android) diff --git a/src/qjson_export.h b/src/qjson_export.h -index c7f5325..d5871e2 100644 +index 9a807b9..7e6646a 100644 --- a/src/qjson_export.h +++ b/src/qjson_export.h @@ -23,7 +23,9 @@ @@ -82,3 +71,48 @@ index c7f5325..d5871e2 100644 /* We are building this library */ # define QJSON_EXPORT Q_DECL_EXPORT # else +-- +1.7.10.4 + + +From dbe71952b8b91359172f7f253a7cc07c1e746443 Mon Sep 17 00:00:00 2001 +From: Flavio Castelli +Date: Thu, 22 Nov 2012 21:19:15 +0100 +Subject: [PATCH 2/2] Fix unsafe pointer usage in Serializer::serialize(). + +This fixes issue #3. +(cherry picked from commit 56701d72da8a57a64522ff455d7aa460033398a9) + +diff --git a/ChangeLog b/ChangeLog +index fa16030..6ae4d9d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++Thu Nov 22 21:20:11 CET 2012 Flavio Castelli ++ ++ * Fix unsafe pointer usage in Serializer::serialize() ++ + ---------------------------------------------------------------------- + Wed Nov 21 22:01:51 CET 2012 Flavio Castelli + +diff --git a/src/serializer.cpp b/src/serializer.cpp +index 4ff3d54..b88827d 100644 +--- a/src/serializer.cpp ++++ b/src/serializer.cpp +@@ -368,12 +368,12 @@ void Serializer::serialize( const QVariant& v, QIODevice* io, bool* ok) + + QByteArray Serializer::serialize( const QVariant &v, bool *ok) + { ++ bool _ok = true; + d->errorMessage.clear(); + + if (ok) { + *ok = true; + } else { +- bool _ok = true; + ok = &_ok; + } + +-- +1.7.10.4 + diff --git a/src/qjson.mk b/src/qjson.mk index 08a3c45..363241d 100644 --- a/src/qjson.mk +++ b/src/qjson.mk @@ -3,8 +3,8 @@ PKG := qjson $(PKG)_IGNORE := -$(PKG)_CHECKSUM := 19bbef24132b238e99744bb35194c6dadece98f9 -$(PKG)_SUBDIR := $(PKG) +$(PKG)_CHECKSUM := 6a571194d24aed23f36642f5d24d97f6b1080d4a +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) $(PKG)_DEPS := gcc qt -- cgit v0.12