From a52215833280fd2c76d6df491a199f1ffab3e040 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 18 Oct 2013 18:55:45 +0200 Subject: fdo#70393: move libcmis to a subdir of external Change-Id: I602ae9b173e42d668cd9383fa0d2517576db12bf Reviewed-on: https://gerrit.libreoffice.org/6326 Reviewed-by: David Tardon Tested-by: David Tardon --- external/libcmis/Makefile | 7 ++ external/libcmis/Module_libcmis.mk | 17 +++++ external/libcmis/README | 8 +++ external/libcmis/StaticLibrary_cmis.mk | 75 +++++++++++++++++++ external/libcmis/UnpackedTarball_cmis.mk | 24 +++++++ external/libcmis/boost-win.patch | 84 ++++++++++++++++++++++ external/libcmis/libcmis-0.4.1-empty-path.patch | 13 ++++ external/libcmis/libcmis-0.4.1.patch | 95 +++++++++++++++++++++++++ 8 files changed, 323 insertions(+) create mode 100644 external/libcmis/Makefile create mode 100644 external/libcmis/Module_libcmis.mk create mode 100644 external/libcmis/README create mode 100644 external/libcmis/StaticLibrary_cmis.mk create mode 100644 external/libcmis/UnpackedTarball_cmis.mk create mode 100644 external/libcmis/boost-win.patch create mode 100644 external/libcmis/libcmis-0.4.1-empty-path.patch create mode 100644 external/libcmis/libcmis-0.4.1.patch (limited to 'external/libcmis') diff --git a/external/libcmis/Makefile b/external/libcmis/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/libcmis/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/libcmis/Module_libcmis.mk b/external/libcmis/Module_libcmis.mk new file mode 100644 index 000000000000..b45f1ed8b0f8 --- /dev/null +++ b/external/libcmis/Module_libcmis.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,libcmis)) + +$(eval $(call gb_Module_add_targets,libcmis,\ + StaticLibrary_cmis \ + UnpackedTarball_cmis \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libcmis/README b/external/libcmis/README new file mode 100644 index 000000000000..c39861a7614f --- /dev/null +++ b/external/libcmis/README @@ -0,0 +1,8 @@ +A C++ client library for the CMIS interface. + +From: +[http://sourceforge.net/projects/libcmis/] + +Wikipedia (CMIS): +Content Management Interoperability Services (CMIS) is an open standard that defines an +abstraction layer for controlling diverse document management systems and repositories using web protocols. diff --git a/external/libcmis/StaticLibrary_cmis.mk b/external/libcmis/StaticLibrary_cmis.mk new file mode 100644 index 000000000000..f87df26dea9f --- /dev/null +++ b/external/libcmis/StaticLibrary_cmis.mk @@ -0,0 +1,75 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_StaticLibrary_StaticLibrary,cmislib)) + +$(eval $(call gb_StaticLibrary_set_warnings_not_errors,cmislib)) + +ifeq ($(COM_GCC_IS_CLANG),TRUE) +# Avoid narrowing conversion error (even though the option is technically a warning) +# caused by boost. +$(eval $(call gb_StaticLibrary_add_cxxflags,cmislib,\ + -Wno-error=c++11-narrowing \ +)) +endif + +$(eval $(call gb_StaticLibrary_use_unpacked,cmislib,cmis)) + +$(eval $(call gb_StaticLibrary_use_externals,cmislib,\ + boost_headers \ + curl \ + libxml2 \ +)) + +$(eval $(call gb_StaticLibrary_add_generated_exception_objects,cmislib,\ + UnpackedTarball/cmis/src/libcmis/allowable-actions \ + UnpackedTarball/cmis/src/libcmis/atom-document \ + UnpackedTarball/cmis/src/libcmis/atom-folder \ + UnpackedTarball/cmis/src/libcmis/atom-object-type \ + UnpackedTarball/cmis/src/libcmis/atom-object \ + UnpackedTarball/cmis/src/libcmis/atom-session \ + UnpackedTarball/cmis/src/libcmis/atom-workspace \ + UnpackedTarball/cmis/src/libcmis/base-session \ + UnpackedTarball/cmis/src/libcmis/document \ + UnpackedTarball/cmis/src/libcmis/folder \ + UnpackedTarball/cmis/src/libcmis/gdrive-document \ + UnpackedTarball/cmis/src/libcmis/gdrive-folder \ + UnpackedTarball/cmis/src/libcmis/gdrive-object \ + UnpackedTarball/cmis/src/libcmis/gdrive-object-type \ + UnpackedTarball/cmis/src/libcmis/gdrive-property \ + UnpackedTarball/cmis/src/libcmis/gdrive-repository \ + UnpackedTarball/cmis/src/libcmis/gdrive-session \ + UnpackedTarball/cmis/src/libcmis/gdrive-utils \ + UnpackedTarball/cmis/src/libcmis/json-utils \ + UnpackedTarball/cmis/src/libcmis/oauth2-data \ + UnpackedTarball/cmis/src/libcmis/oauth2-handler \ + UnpackedTarball/cmis/src/libcmis/oauth2-providers \ + UnpackedTarball/cmis/src/libcmis/object \ + UnpackedTarball/cmis/src/libcmis/object-type \ + UnpackedTarball/cmis/src/libcmis/property-type \ + UnpackedTarball/cmis/src/libcmis/property \ + UnpackedTarball/cmis/src/libcmis/rendition \ + UnpackedTarball/cmis/src/libcmis/repository \ + UnpackedTarball/cmis/src/libcmis/session-factory \ + UnpackedTarball/cmis/src/libcmis/ws-document \ + UnpackedTarball/cmis/src/libcmis/ws-folder \ + UnpackedTarball/cmis/src/libcmis/ws-navigationservice \ + UnpackedTarball/cmis/src/libcmis/ws-object \ + UnpackedTarball/cmis/src/libcmis/ws-object-type \ + UnpackedTarball/cmis/src/libcmis/ws-objectservice \ + UnpackedTarball/cmis/src/libcmis/ws-relatedmultipart \ + UnpackedTarball/cmis/src/libcmis/ws-repositoryservice \ + UnpackedTarball/cmis/src/libcmis/ws-requests \ + UnpackedTarball/cmis/src/libcmis/ws-session \ + UnpackedTarball/cmis/src/libcmis/ws-soap \ + UnpackedTarball/cmis/src/libcmis/ws-versioningservice \ + UnpackedTarball/cmis/src/libcmis/xml-utils \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/libcmis/UnpackedTarball_cmis.mk b/external/libcmis/UnpackedTarball_cmis.mk new file mode 100644 index 000000000000..75f5753a21f8 --- /dev/null +++ b/external/libcmis/UnpackedTarball_cmis.mk @@ -0,0 +1,24 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,cmis)) + +$(eval $(call gb_UnpackedTarball_set_tarball,cmis,$(CMIS_TARBALL))) + +$(eval $(call gb_UnpackedTarball_set_patchlevel,cmis,0)) + +$(eval $(call gb_UnpackedTarball_add_patches,cmis, \ + external/libcmis/libcmis-0.4.1.patch \ + external/libcmis/libcmis-0.4.1-empty-path.patch)) + +ifeq ($(OS)$(COM),WNTMSC) +$(eval $(call gb_UnpackedTarball_add_patches,cmis,external/libcmis/boost-win.patch)) +endif + +# vim: set noet sw=4 ts=4: diff --git a/external/libcmis/boost-win.patch b/external/libcmis/boost-win.patch new file mode 100644 index 000000000000..7d9508bea071 --- /dev/null +++ b/external/libcmis/boost-win.patch @@ -0,0 +1,84 @@ +diff --git src/libcmis/atom-object.cxx src/libcmis/atom-object.cxx +index ce21384..eef8102 100644 +--- src/libcmis/atom-object.cxx ++++ src/libcmis/atom-object.cxx +@@ -30,6 +30,9 @@ + #include + #include + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + + #include "atom-document.hxx" +diff --git src/libcmis/object.hxx src/libcmis/object.hxx +index 449bb22..c320f06 100644 +--- src/libcmis/object.hxx ++++ src/libcmis/object.hxx +@@ -36,6 +36,9 @@ + #include + #endif + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + #include + #include +diff --git src/libcmis/property-type.hxx src/libcmis/property-type.hxx +index 1a8bee9..6ac946c 100644 +--- src/libcmis/property-type.hxx ++++ src/libcmis/property-type.hxx +@@ -28,6 +28,9 @@ + #ifndef _PROPERTY_TYPE_HXX_ + #define _PROPERTY_TYPE_HXX_ + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + #include + +diff --git src/libcmis/property.hxx src/libcmis/property.hxx +index f9be04a..2977fb3 100644 +--- src/libcmis/property.hxx ++++ src/libcmis/property.hxx +@@ -31,6 +31,9 @@ + #include + #include + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + #include + +diff --git src/libcmis/ws-session.cxx src/libcmis/ws-session.cxx +index b906a5a..bf50644 100644 +--- src/libcmis/ws-session.cxx ++++ src/libcmis/ws-session.cxx +@@ -28,6 +28,9 @@ + + #include + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + #include + #include +diff --git src/libcmis/xml-utils.hxx src/libcmis/xml-utils.hxx +index 52853e2..2f80b91 100644 +--- src/libcmis/xml-utils.hxx ++++ src/libcmis/xml-utils.hxx +@@ -33,6 +33,9 @@ + #include + #include + ++#ifndef BOOST_DATE_TIME_NO_LIB ++#define BOOST_DATE_TIME_NO_LIB ++#endif + #include + #include + #include diff --git a/external/libcmis/libcmis-0.4.1-empty-path.patch b/external/libcmis/libcmis-0.4.1-empty-path.patch new file mode 100644 index 000000000000..c48265d21681 --- /dev/null +++ b/external/libcmis/libcmis-0.4.1-empty-path.patch @@ -0,0 +1,13 @@ +diff --git src/libcmis/document.cxx src/libcmis/document.cxx +index 1af0d63..7ecfd24 100644 +--- src/libcmis/document.cxx ++++ src/libcmis/document.cxx +@@ -44,6 +44,8 @@ namespace libcmis + it != parents.end(); ++it ) + { + string path = ( *it )->getPath( ); ++ if ( path.empty() ) ++ continue; + if ( path[path.size() - 1] != '/' ) + path += "/"; + path += getName( ); diff --git a/external/libcmis/libcmis-0.4.1.patch b/external/libcmis/libcmis-0.4.1.patch new file mode 100644 index 000000000000..214475fc575d --- /dev/null +++ b/external/libcmis/libcmis-0.4.1.patch @@ -0,0 +1,95 @@ +diff --git src/libcmis/json-utils.cxx src/libcmis/json-utils.cxx +index b537a09..b4e037d 100644 +--- src/libcmis/json-utils.cxx ++++ src/libcmis/json-utils.cxx +@@ -213,48 +213,54 @@ Json::Type Json::parseType( ) + { + Type type = json_string; + string str = toString( ); +- boost::posix_time::ptime time = libcmis::parseDateTime( str ); +- if ( !time.is_not_a_date_time( ) ) +- type = json_datetime; +- else ++ if ( str.empty( ) ) ++ return type; ++ try + { +- Type backupType = type; +- type = json_bool; +- try +- { +- parseBool( str ); +- } +- catch (...) ++ boost::posix_time::ptime time = libcmis::parseDateTime( str ); ++ if ( !time.is_not_a_date_time( ) ) ++ return json_datetime; ++ } ++ catch (...) ++ { ++ // Try other types ++ } ++ Type backupType = type; ++ type = json_bool; ++ try ++ { ++ parseBool( str ); ++ } ++ catch (...) ++ { ++ type = backupType; ++ } ++ if ( type != json_bool ) ++ { ++ if ( str.find('.') == string::npos ) + { +- type = backupType; ++ backupType = type; ++ type = json_int; ++ try ++ { ++ parseInteger( str ); ++ } ++ catch(...) ++ { ++ type = backupType; ++ } + } +- if ( type != json_bool ) ++ else + { +- if ( str.find('.') == string::npos ) ++ backupType = type; ++ type = json_double; ++ try + { +- backupType = type; +- type = json_int; +- try +- { +- parseInteger( str ); +- } +- catch(...) +- { +- type = backupType; +- } ++ parseDouble( str ); + } +- else +- { +- backupType = type; +- type = json_double; +- try +- { +- parseDouble( str ); +- } +- catch(...) +- { +- type = backupType; +- } ++ catch(...) ++ { ++ type = backupType; + } + } + } -- cgit