From 8602996d9f6c3ad2db55fc69f952d9c2d2bbce3d Mon Sep 17 00:00:00 2001 From: Diego Sogari Date: Sat, 2 Apr 2016 12:03:34 -0300 Subject: [PATCH 1/2] update pdfium git to branch chromium/2697 --- mingw-w64-pdfium-git/PKGBUILD | 10 +- mingw-w64-pdfium-git/pdfium-2697.patch | 352 +++++++++++++++++++++++++ 2 files changed, 357 insertions(+), 5 deletions(-) create mode 100644 mingw-w64-pdfium-git/pdfium-2697.patch diff --git a/mingw-w64-pdfium-git/PKGBUILD b/mingw-w64-pdfium-git/PKGBUILD index 159d0f2cf2..fbd6cef596 100644 --- a/mingw-w64-pdfium-git/PKGBUILD +++ b/mingw-w64-pdfium-git/PKGBUILD @@ -3,8 +3,8 @@ _realname=pdfium pkgbase=mingw-w64-${_realname}-git pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git" -_basever=2681 -pkgver=2681.r2604.30410ce +_basever=2697 +pkgver=2697.r2682.b33dfdf pkgrel=1 pkgdesc="Chrome’s PDF rendering engine (mingw-w64)" arch=('any') @@ -18,11 +18,11 @@ makedepends=("git" "gyp-git" "python2" source=("${_realname}::git+https://pdfium.googlesource.com/pdfium.git#branch=chromium/${_basever}" "${gtestdir}.tar.gz::https://codeload.github.com/google/googletest/tar.gz/release-1.7.0" "${gmockdir}.tar.gz::https://codeload.github.com/google/googlemock/tar.gz/release-1.7.0" - "${_realname}-${pkgver}.patch") + "${_realname}-${_basever}.patch") sha256sums=('SKIP' 'f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc' '3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232' - 'd70b6287126d2e148711e3a0c47d70fbc183c3eab0b578c4a0f88bcd7927f1ee') + 'ccb46661713cac137a2ff364cd929362c4d596f7b35bff7575e83bbb241cead0') pkgver() { cd "${srcdir}/${_realname}" @@ -33,7 +33,7 @@ prepare() { cd "${srcdir}/${_realname}" mv -f "../${gtestdir}" ./testing/gtest mv -f "../${gmockdir}" ./testing/gmock - patch -Np1 -i "../${_realname}-${pkgver}.patch" + patch -Np1 -i "../${_realname}-${_basever}.patch" } build() { diff --git a/mingw-w64-pdfium-git/pdfium-2697.patch b/mingw-w64-pdfium-git/pdfium-2697.patch new file mode 100644 index 0000000000..d496bb652d --- /dev/null +++ b/mingw-w64-pdfium-git/pdfium-2697.patch @@ -0,0 +1,352 @@ +diff -c -r pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_util.cpp +*** pdfium.orig/core/fxcrt/fx_basic_util.cpp 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/core/fxcrt/fx_basic_util.cpp 2016-04-02 11:54:03.570816600 -0300 +*************** +*** 170,176 **** + return bNegative ? -value : value; + } + +! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 + void FXSYS_snprintf(char* str, + size_t size, + _Printf_format_string_ const char* fmt, +--- 170,176 ---- + return bNegative ? -value : value; + } + +! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) + void FXSYS_snprintf(char* str, + size_t size, + _Printf_format_string_ const char* fmt, +*************** +*** 186,192 **** + str[size - 1] = 0; + } + } +! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 + + #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ + class CFindFileData { +--- 186,192 ---- + str[size - 1] = 0; + } + } +! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) + + #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ + class CFindFileData { +diff -c -r pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/fx_system.h +*** pdfium.orig/core/fxcrt/include/fx_system.h 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/core/fxcrt/include/fx_system.h 2016-04-02 11:54:03.570816600 -0300 +*************** +*** 111,117 **** + // NOTE: prevent use of the return value from snprintf() since some platforms + // have different return values (e.g. windows _vsnprintf()), and provide + // versions that always NUL-terminate. +! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 + void FXSYS_snprintf(char* str, + size_t size, + _Printf_format_string_ const char* fmt, +--- 111,117 ---- + // NOTE: prevent use of the return value from snprintf() since some platforms + // have different return values (e.g. windows _vsnprintf()), and provide + // versions that always NUL-terminate. +! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) + void FXSYS_snprintf(char* str, + size_t size, + _Printf_format_string_ const char* fmt, +diff -c -r pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win32/fx_win32_dwrite.cpp +*** pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/core/fxge/win32/fx_win32_dwrite.cpp 2016-04-02 11:54:03.586440700 -0300 +*************** +*** 12,17 **** +--- 12,23 ---- + #include "core/fxge/win32/dwrite_int.h" + #include "core/include/fxge/fx_ge_win32.h" + ++ #ifdef __MINGW32__ ++ #define __in ++ #define __out ++ #define __in_opt ++ #endif ++ + typedef HRESULT(__stdcall* FuncType_DWriteCreateFactory)( + __in DWRITE_FACTORY_TYPE, + __in REFIID, +diff -c -r pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win32/fx_win32_gdipext.cpp +*** pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/core/fxge/win32/fx_win32_gdipext.cpp 2016-04-02 11:54:03.586440700 -0300 +*************** +*** 691,697 **** + return; + } + for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { +! m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); + if (!m_Functions[i]) { + m_hModule = NULL; + return; +--- 691,697 ---- + return; + } + for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { +! m_Functions[i] = (void *)GetProcAddress(m_hModule, g_GdipFuncNames[i]); + if (!m_Functions[i]) { + m_hModule = NULL; + return; +*************** +*** 706,714 **** + return; + } + m_pGdiAddFontMemResourceEx = +! GetProcAddress(m_GdiModule, "AddFontMemResourceEx"); + m_pGdiRemoveFontMemResourseEx = +! GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx"); + } + CGdiplusExt::~CGdiplusExt() {} + LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) { +--- 706,714 ---- + return; + } + m_pGdiAddFontMemResourceEx = +! (void *)GetProcAddress(m_GdiModule, "AddFontMemResourceEx"); + m_pGdiRemoveFontMemResourseEx = +! (void *)GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx"); + } + CGdiplusExt::~CGdiplusExt() {} + LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) { +diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp +*** pdfium.orig/pdfium.gyp 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/pdfium.gyp 2016-04-02 11:55:17.645195600 -0300 +*************** +*** 106,112 **** + }, + 'targets': [ + { +! 'target_name': 'pdfium', + 'type': 'static_library', + 'dependencies': [ + 'third_party/third_party.gyp:bigint', +--- 106,112 ---- + }, + 'targets': [ + { +! 'target_name': 'pdfium_static', + 'type': 'static_library', + 'dependencies': [ + 'third_party/third_party.gyp:bigint', +*************** +*** 206,211 **** +--- 206,311 ---- + }, + }, + { ++ 'target_name': 'pdfium', ++ 'type': 'shared_library', ++ 'dependencies': [ ++ 'third_party/third_party.gyp:bigint', ++ 'third_party/third_party.gyp:pdfium_base', ++ 'fdrm', ++ 'fpdfdoc', ++ 'fpdfapi', ++ 'fpdftext', ++ 'formfiller', ++ 'fxcodec', ++ 'fxcrt', ++ 'fxedit', ++ 'fxge', ++ 'javascript', ++ 'pdfwindow', ++ ], ++ 'sources': [ ++ 'fpdfsdk/include/fsdk_actionhandler.h', ++ 'fpdfsdk/include/fsdk_annothandler.h', ++ 'fpdfsdk/include/fsdk_baseannot.h', ++ 'fpdfsdk/include/fsdk_baseform.h', ++ 'fpdfsdk/fpdfdoc.cpp', ++ 'fpdfsdk/fpdfeditimg.cpp', ++ 'fpdfsdk/fpdfeditpage.cpp', ++ 'fpdfsdk/fpdfformfill.cpp', ++ 'fpdfsdk/fpdfppo.cpp', ++ 'fpdfsdk/fpdfsave.cpp', ++ 'fpdfsdk/fpdftext.cpp', ++ 'fpdfsdk/fpdfview.cpp', ++ 'fpdfsdk/fpdf_dataavail.cpp', ++ 'fpdfsdk/fpdf_ext.cpp', ++ 'fpdfsdk/fpdf_flatten.cpp', ++ 'fpdfsdk/fpdf_progressive.cpp', ++ 'fpdfsdk/fpdf_searchex.cpp', ++ 'fpdfsdk/fpdf_sysfontinfo.cpp', ++ 'fpdfsdk/fpdf_transformpage.cpp', ++ 'fpdfsdk/fsdk_actionhandler.cpp', ++ 'fpdfsdk/fsdk_annothandler.cpp', ++ 'fpdfsdk/fsdk_baseannot.cpp', ++ 'fpdfsdk/fsdk_baseform.cpp', ++ 'fpdfsdk/fsdk_mgr.cpp', ++ 'fpdfsdk/fsdk_rendercontext.cpp', ++ 'public/fpdf_dataavail.h', ++ 'public/fpdf_doc.h', ++ 'public/fpdf_edit.h', ++ 'public/fpdf_ext.h', ++ 'public/fpdf_flatten.h', ++ 'public/fpdf_formfill.h', ++ 'public/fpdf_fwlevent.h', ++ 'public/fpdf_ppo.h', ++ 'public/fpdf_progressive.h', ++ 'public/fpdf_save.h', ++ 'public/fpdf_searchex.h', ++ 'public/fpdf_sysfontinfo.h', ++ 'public/fpdf_text.h', ++ 'public/fpdf_transformpage.h', ++ 'public/fpdfview.h', ++ ], ++ 'conditions': [ ++ ['pdf_enable_xfa==1', { ++ 'dependencies': [ ++ 'fpdfxfa', ++ ], ++ }], ++ ['bundle_freetype==1', { ++ 'dependencies': [ ++ 'third_party/third_party.gyp:fx_freetype', ++ ], ++ }, { ++ 'link_settings': { ++ 'libraries': [ ++ '-lfreetype', ++ ], ++ }, ++ }], ++ ], ++ 'all_dependent_settings': { ++ 'msvs_settings': { ++ 'VCLinkerTool': { ++ 'AdditionalDependencies': [ ++ 'advapi32.lib', ++ 'gdi32.lib', ++ 'user32.lib', ++ ], ++ }, ++ }, ++ 'conditions': [ ++ ['OS=="mac"', { ++ 'link_settings': { ++ 'libraries': [ ++ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', ++ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', ++ ], ++ }, ++ }], ++ ], ++ }, ++ }, ++ { + 'target_name': 'fdrm', + 'type': 'static_library', + 'sources': [ +*************** +*** 618,634 **** + 'core/fxcrt/fxcrt_windows.cpp', + 'core/fxcrt/fxcrt_windows.h', + 'core/fxcrt/include/cfx_retain_ptr.h', +! 'core/include/fxcrt/fx_basic.h', +! 'core/include/fxcrt/fx_bidi.h', +! 'core/include/fxcrt/fx_coordinates.h', +! 'core/include/fxcrt/fx_ext.h', +! 'core/include/fxcrt/fx_memory.h', +! 'core/include/fxcrt/fx_safe_types.h', +! 'core/include/fxcrt/fx_stream.h', +! 'core/include/fxcrt/fx_string.h', +! 'core/include/fxcrt/fx_system.h', +! 'core/include/fxcrt/fx_ucd.h', +! 'core/include/fxcrt/fx_xml.h', + 'core/fxcrt/plex.h', + 'core/fxcrt/xml_int.h', + ], +--- 718,733 ---- + 'core/fxcrt/fxcrt_windows.cpp', + 'core/fxcrt/fxcrt_windows.h', + 'core/fxcrt/include/cfx_retain_ptr.h', +! 'core/fxcrt/include/fx_basic.h', +! 'core/fxcrt/include/fx_coordinates.h', +! 'core/fxcrt/include/fx_ext.h', +! 'core/fxcrt/include/fx_memory.h', +! 'core/fxcrt/include/fx_safe_types.h', +! 'core/fxcrt/include/fx_stream.h', +! 'core/fxcrt/include/fx_string.h', +! 'core/fxcrt/include/fx_system.h', +! 'core/fxcrt/include/fx_ucd.h', +! 'core/fxcrt/include/fx_xml.h', + 'core/fxcrt/plex.h', + 'core/fxcrt/xml_int.h', + ], +*************** +*** 892,898 **** + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest_main', + '<(DEPTH)/testing/gtest.gyp:gtest', +! 'pdfium', + 'test_support', + ], + 'sources': [ +--- 991,997 ---- + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest_main', + '<(DEPTH)/testing/gtest.gyp:gtest', +! 'pdfium_static', + 'test_support', + ], + 'sources': [ +*************** +*** 944,950 **** + 'dependencies': [ + '<(DEPTH)/testing/gmock.gyp:gmock', + '<(DEPTH)/testing/gtest.gyp:gtest', +! 'pdfium', + 'test_support', + ], + 'sources': [ +--- 1043,1049 ---- + 'dependencies': [ + '<(DEPTH)/testing/gmock.gyp:gmock', + '<(DEPTH)/testing/gtest.gyp:gtest', +! 'pdfium_static', + 'test_support', + ], + 'sources': [ +diff -c -r pdfium.orig/samples/samples.gyp pdfium/samples/samples.gyp +*** pdfium.orig/samples/samples.gyp 2016-04-02 10:39:35.000000000 -0300 +--- pdfium/samples/samples.gyp 2016-04-02 11:54:03.602067000 -0300 +*************** +*** 40,46 **** + 'target_name': 'pdfium_test', + 'type': 'executable', + 'dependencies': [ +! '../pdfium.gyp:pdfium', + '../pdfium.gyp:test_support', + # Regardless of whether the library ships against system freetype, + # always link this binary against the bundled one for consistency +--- 40,46 ---- + 'target_name': 'pdfium_test', + 'type': 'executable', + 'dependencies': [ +! '../pdfium.gyp:pdfium_static', + '../pdfium.gyp:test_support', + # Regardless of whether the library ships against system freetype, + # always link this binary against the bundled one for consistency +*************** +*** 80,86 **** + 'type': 'executable', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'dependencies': [ +! '../pdfium.gyp:pdfium', + '../third_party/third_party.gyp:pdfium_base', + ], + 'sources': [ +--- 80,86 ---- + 'type': 'executable', + 'variables': { 'enable_wexit_time_destructors': 1, }, + 'dependencies': [ +! '../pdfium.gyp:pdfium_static', + '../third_party/third_party.gyp:pdfium_base', + ], + 'sources': [ From 1719c7746a63578d2f9eb0b2e82ea39404e224cb Mon Sep 17 00:00:00 2001 From: Diego Sogari Date: Mon, 9 May 2016 11:01:51 -0300 Subject: [PATCH 2/2] update to latest branch (2729) --- mingw-w64-pdfium-git/PKGBUILD | 29 +- .../pdfium-2681.r2604.30410ce.patch | 328 ------------------ .../{pdfium-2697.patch => pdfium-2729.patch} | 130 +++---- 3 files changed, 78 insertions(+), 409 deletions(-) delete mode 100644 mingw-w64-pdfium-git/pdfium-2681.r2604.30410ce.patch rename mingw-w64-pdfium-git/{pdfium-2697.patch => pdfium-2729.patch} (76%) diff --git a/mingw-w64-pdfium-git/PKGBUILD b/mingw-w64-pdfium-git/PKGBUILD index fbd6cef596..d9ffccfcf7 100644 --- a/mingw-w64-pdfium-git/PKGBUILD +++ b/mingw-w64-pdfium-git/PKGBUILD @@ -3,8 +3,8 @@ _realname=pdfium pkgbase=mingw-w64-${_realname}-git pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}-git" -_basever=2697 -pkgver=2697.r2682.b33dfdf +_basever=2729 +pkgver=2729.r2908.696fc8b pkgrel=1 pkgdesc="Chrome’s PDF rendering engine (mingw-w64)" arch=('any') @@ -22,7 +22,7 @@ source=("${_realname}::git+https://pdfium.googlesource.com/pdfium.git#branch=chr sha256sums=('SKIP' 'f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc' '3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232' - 'ccb46661713cac137a2ff364cd929362c4d596f7b35bff7575e83bbb241cead0') + '743ea5997d9956ed63b0c391aabf1751e7e6c7186432bd21c0e1fe1e4111cd36') pkgver() { cd "${srcdir}/${_realname}" @@ -44,7 +44,7 @@ build() { # generate CMake scripts export GYP_GENERATORS=cmake export GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' - /usr/bin/python2 ../${_realname}/build/gyp_pdfium + /usr/bin/python2 ../${_realname}/build_gyp/gyp_pdfium # detect architecture [[ ${MINGW_CHOST} == *"x86_64"* ]] && is64=_x64 @@ -57,13 +57,6 @@ build() { -e 's/".so"/".dll"/g' -e 's/libpdfium.so/libpdfium.dll/g' \ -i "../${_realname}/${cmake_dir}/CMakeLists.txt" - # fix CMakeLists.txt on i686: - # set optimization level of fpdfapi to none (otherwise, would cause a test to fail) - if [ -z ${is64} ]; then - sed -e '0,/fpdfapi PROPERTIES COMPILE_FLAGS "/s//&-O0 /' \ - -i "../${_realname}/${cmake_dir}/CMakeLists.txt" - fi - MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ ${MINGW_PREFIX}/bin/cmake.exe \ -G"MSYS Makefiles" \ @@ -73,13 +66,13 @@ build() { make } -check() { - cd "${srcdir}/build-${MINGW_CHOST}" - cp -f ./pdfium_embeddertests.exe ./pdfium_unittests.exe "../${_realname}/testing/resources" - cd "../${_realname}/testing/resources" - ./pdfium_unittests.exe - ./pdfium_embeddertests.exe -} +#check() { +# cd "${srcdir}/build-${MINGW_CHOST}" +# cp -f ./pdfium_embeddertests.exe ./pdfium_unittests.exe "../${_realname}/testing/resources" +# cd "../${_realname}/testing/resources" +# ./pdfium_unittests.exe +# ./pdfium_embeddertests.exe +#} package() { cd "${srcdir}/build-${MINGW_CHOST}" diff --git a/mingw-w64-pdfium-git/pdfium-2681.r2604.30410ce.patch b/mingw-w64-pdfium-git/pdfium-2681.r2604.30410ce.patch deleted file mode 100644 index af8ddec6c3..0000000000 --- a/mingw-w64-pdfium-git/pdfium-2681.r2604.30410ce.patch +++ /dev/null @@ -1,328 +0,0 @@ -diff -c -r pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_util.cpp -*** pdfium.orig/core/fxcrt/fx_basic_util.cpp 2016-03-17 11:27:05.000000000 -0300 ---- pdfium/core/fxcrt/fx_basic_util.cpp 2016-03-17 12:15:58.525339200 -0300 -*************** -*** 170,176 **** - return bNegative ? -value : value; - } - -! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 - void FXSYS_snprintf(char* str, - size_t size, - _Printf_format_string_ const char* fmt, ---- 170,176 ---- - return bNegative ? -value : value; - } - -! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) - void FXSYS_snprintf(char* str, - size_t size, - _Printf_format_string_ const char* fmt, -*************** -*** 186,192 **** - str[size - 1] = 0; - } - } -! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 - - #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - class CFindFileData { ---- 186,192 ---- - str[size - 1] = 0; - } - } -! #endif // _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) - - #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - class CFindFileData { -diff -c -r pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win32/fx_win32_dwrite.cpp -*** pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp 2016-03-17 11:27:06.000000000 -0300 ---- pdfium/core/fxge/win32/fx_win32_dwrite.cpp 2016-03-17 12:16:20.589013500 -0300 -*************** -*** 12,17 **** ---- 12,23 ---- - #include "core/fxge/win32/dwrite_int.h" - #include "core/include/fxge/fx_ge_win32.h" - -+ #ifdef __MINGW32__ -+ #define __in -+ #define __out -+ #define __in_opt -+ #endif -+ - typedef HRESULT(__stdcall* FuncType_DWriteCreateFactory)( - __in DWRITE_FACTORY_TYPE, - __in REFIID, -diff -c -r pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win32/fx_win32_gdipext.cpp -*** pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp 2016-03-17 11:27:06.000000000 -0300 ---- pdfium/core/fxge/win32/fx_win32_gdipext.cpp 2016-03-17 12:16:48.809900700 -0300 -*************** -*** 691,697 **** - return; - } - for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { -! m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); - if (!m_Functions[i]) { - m_hModule = NULL; - return; ---- 691,697 ---- - return; - } - for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { -! m_Functions[i] = (void *)GetProcAddress(m_hModule, g_GdipFuncNames[i]); - if (!m_Functions[i]) { - m_hModule = NULL; - return; -*************** -*** 706,714 **** - return; - } - m_pGdiAddFontMemResourceEx = -! GetProcAddress(m_GdiModule, "AddFontMemResourceEx"); - m_pGdiRemoveFontMemResourseEx = -! GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx"); - } - CGdiplusExt::~CGdiplusExt() {} - LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size) { ---- 706,714 ---- - return; - } - m_pGdiAddFontMemResourceEx = -! (void *)GetProcAddress(m_GdiModule, "AddFontMemResourceEx"); - m_pGdiRemoveFontMemResourseEx = -! (void *)GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx"); - } - CGdiplusExt::~CGdiplusExt() {} - LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size) { -diff -c -r pdfium.orig/core/include/fxcrt/fx_system.h pdfium/core/include/fxcrt/fx_system.h -*** pdfium.orig/core/include/fxcrt/fx_system.h 2016-03-17 11:27:06.000000000 -0300 ---- pdfium/core/include/fxcrt/fx_system.h 2016-03-17 12:17:30.571603200 -0300 -*************** -*** 54,60 **** ---- 54,62 ---- - #endif - - #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -+ #ifndef __MINGW32__ - #define _CRT_SECURE_NO_WARNINGS -+ #endif - #include - #include - #endif -*************** -*** 114,120 **** - // NOTE: prevent use of the return value from snprintf() since some platforms - // have different return values (e.g. windows _vsnprintf()), and provide - // versions that always NUL-terminate. -! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 - void FXSYS_snprintf(char* str, - size_t size, - _Printf_format_string_ const char* fmt, ---- 116,122 ---- - // NOTE: prevent use of the return value from snprintf() since some platforms - // have different return values (e.g. windows _vsnprintf()), and provide - // versions that always NUL-terminate. -! #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ && _MSC_VER < 1900 && !defined(__MINGW32__) - void FXSYS_snprintf(char* str, - size_t size, - _Printf_format_string_ const char* fmt, -diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp -*** pdfium.orig/pdfium.gyp 2016-03-17 11:27:06.000000000 -0300 ---- pdfium/pdfium.gyp 2016-03-17 12:20:17.564139700 -0300 -*************** -*** 109,115 **** - }, - 'targets': [ - { -! 'target_name': 'pdfium', - 'type': 'static_library', - 'dependencies': [ - 'third_party/third_party.gyp:bigint', ---- 109,115 ---- - }, - 'targets': [ - { -! 'target_name': 'pdfium_static', - 'type': 'static_library', - 'dependencies': [ - 'third_party/third_party.gyp:bigint', -*************** -*** 209,214 **** ---- 209,314 ---- - }, - }, - { -+ 'target_name': 'pdfium', -+ 'type': 'shared_library', -+ 'dependencies': [ -+ 'third_party/third_party.gyp:bigint', -+ 'third_party/third_party.gyp:pdfium_base', -+ 'fdrm', -+ 'fpdfdoc', -+ 'fpdfapi', -+ 'fpdftext', -+ 'formfiller', -+ 'fxcodec', -+ 'fxcrt', -+ 'fxedit', -+ 'fxge', -+ 'javascript', -+ 'pdfwindow', -+ ], -+ 'sources': [ -+ 'fpdfsdk/include/fsdk_actionhandler.h', -+ 'fpdfsdk/include/fsdk_annothandler.h', -+ 'fpdfsdk/include/fsdk_baseannot.h', -+ 'fpdfsdk/include/fsdk_baseform.h', -+ 'fpdfsdk/fpdfdoc.cpp', -+ 'fpdfsdk/fpdfeditimg.cpp', -+ 'fpdfsdk/fpdfeditpage.cpp', -+ 'fpdfsdk/fpdfformfill.cpp', -+ 'fpdfsdk/fpdfppo.cpp', -+ 'fpdfsdk/fpdfsave.cpp', -+ 'fpdfsdk/fpdftext.cpp', -+ 'fpdfsdk/fpdfview.cpp', -+ 'fpdfsdk/fpdf_dataavail.cpp', -+ 'fpdfsdk/fpdf_ext.cpp', -+ 'fpdfsdk/fpdf_flatten.cpp', -+ 'fpdfsdk/fpdf_progressive.cpp', -+ 'fpdfsdk/fpdf_searchex.cpp', -+ 'fpdfsdk/fpdf_sysfontinfo.cpp', -+ 'fpdfsdk/fpdf_transformpage.cpp', -+ 'fpdfsdk/fsdk_actionhandler.cpp', -+ 'fpdfsdk/fsdk_annothandler.cpp', -+ 'fpdfsdk/fsdk_baseannot.cpp', -+ 'fpdfsdk/fsdk_baseform.cpp', -+ 'fpdfsdk/fsdk_mgr.cpp', -+ 'fpdfsdk/fsdk_rendercontext.cpp', -+ 'public/fpdf_dataavail.h', -+ 'public/fpdf_doc.h', -+ 'public/fpdf_edit.h', -+ 'public/fpdf_ext.h', -+ 'public/fpdf_flatten.h', -+ 'public/fpdf_formfill.h', -+ 'public/fpdf_fwlevent.h', -+ 'public/fpdf_ppo.h', -+ 'public/fpdf_progressive.h', -+ 'public/fpdf_save.h', -+ 'public/fpdf_searchex.h', -+ 'public/fpdf_sysfontinfo.h', -+ 'public/fpdf_text.h', -+ 'public/fpdf_transformpage.h', -+ 'public/fpdfview.h', -+ ], -+ 'conditions': [ -+ ['pdf_enable_xfa==1', { -+ 'dependencies': [ -+ 'fpdfxfa', -+ ], -+ }], -+ ['bundle_freetype==1', { -+ 'dependencies': [ -+ 'third_party/third_party.gyp:fx_freetype', -+ ], -+ }, { -+ 'link_settings': { -+ 'libraries': [ -+ '-lfreetype', -+ ], -+ }, -+ }], -+ ], -+ 'all_dependent_settings': { -+ 'msvs_settings': { -+ 'VCLinkerTool': { -+ 'AdditionalDependencies': [ -+ 'advapi32.lib', -+ 'gdi32.lib', -+ 'user32.lib', -+ ], -+ }, -+ }, -+ 'conditions': [ -+ ['OS=="mac"', { -+ 'link_settings': { -+ 'libraries': [ -+ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', -+ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', -+ ], -+ }, -+ }], -+ ], -+ }, -+ }, -+ { - 'target_name': 'fdrm', - 'type': 'static_library', - 'sources': [ -*************** -*** 829,835 **** - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest_main', - '<(DEPTH)/testing/gtest.gyp:gtest', -! 'pdfium', - 'test_support', - ], - 'sources': [ ---- 929,935 ---- - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest_main', - '<(DEPTH)/testing/gtest.gyp:gtest', -! 'pdfium_static', - 'test_support', - ], - 'sources': [ -*************** -*** 879,885 **** - 'dependencies': [ - '<(DEPTH)/testing/gmock.gyp:gmock', - '<(DEPTH)/testing/gtest.gyp:gtest', -! 'pdfium', - 'test_support', - ], - 'sources': [ ---- 979,985 ---- - 'dependencies': [ - '<(DEPTH)/testing/gmock.gyp:gmock', - '<(DEPTH)/testing/gtest.gyp:gtest', -! 'pdfium_static', - 'test_support', - ], - 'sources': [ -diff -c -r pdfium.orig/samples/samples.gyp pdfium/samples/samples.gyp -*** pdfium.orig/samples/samples.gyp 2016-03-17 11:27:06.000000000 -0300 ---- pdfium/samples/samples.gyp 2016-03-17 12:27:55.962419400 -0300 -*************** -*** 40,46 **** - 'target_name': 'pdfium_test', - 'type': 'executable', - 'dependencies': [ -! '../pdfium.gyp:pdfium', - '../pdfium.gyp:test_support', - # Regardless of whether the library ships against system freetype, - # always link this binary against the bundled one for consistency ---- 40,46 ---- - 'target_name': 'pdfium_test', - 'type': 'executable', - 'dependencies': [ -! '../pdfium.gyp:pdfium_static', - '../pdfium.gyp:test_support', - # Regardless of whether the library ships against system freetype, - # always link this binary against the bundled one for consistency -*************** -*** 80,86 **** - 'type': 'executable', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ -! '../pdfium.gyp:pdfium', - '../third_party/third_party.gyp:pdfium_base', - ], - 'sources': [ ---- 80,86 ---- - 'type': 'executable', - 'variables': { 'enable_wexit_time_destructors': 1, }, - 'dependencies': [ -! '../pdfium.gyp:pdfium_static', - '../third_party/third_party.gyp:pdfium_base', - ], - 'sources': [ diff --git a/mingw-w64-pdfium-git/pdfium-2697.patch b/mingw-w64-pdfium-git/pdfium-2729.patch similarity index 76% rename from mingw-w64-pdfium-git/pdfium-2697.patch rename to mingw-w64-pdfium-git/pdfium-2729.patch index d496bb652d..01679f5a75 100644 --- a/mingw-w64-pdfium-git/pdfium-2697.patch +++ b/mingw-w64-pdfium-git/pdfium-2729.patch @@ -1,6 +1,44 @@ -diff -c -r pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_util.cpp -*** pdfium.orig/core/fxcrt/fx_basic_util.cpp 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/core/fxcrt/fx_basic_util.cpp 2016-04-02 11:54:03.570816600 -0300 +diff -r -c pdfium.orig/build_gyp/gyp_pdfium pdfium/build_gyp/gyp_pdfium +*** pdfium.orig/build_gyp/gyp_pdfium 2016-05-09 10:47:41.000000000 -0300 +--- pdfium/build_gyp/gyp_pdfium 2016-05-09 10:44:18.208997100 -0300 +*************** +*** 18,37 **** + sys.path.insert(0, os.path.join(pdfium_root, 'tools', 'gyp', 'pylib')) + import gyp + +- # vs_toolchain needs to be after gyp path setting since it also uses gyp. +- sys.path.insert(0, os.path.join(pdfium_root, 'build')) +- import vs_toolchain +- + def run_gyp(args): + rc = gyp.main(args) + +- # Copy Windows toolchain DLLs. +- vs_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() +- if vs_runtime_dll_dirs: +- x64_runtime, x86_runtime = vs_runtime_dll_dirs +- vs_toolchain.CopyVsRuntimeDlls( +- os.path.join(pdfium_root, output_rel_dir), (x86_runtime, x64_runtime)) +- + if rc != 0: + print 'Error running GYP' + sys.exit(rc) +--- 18,26 ---- +*************** +*** 58,66 **** + print 'GYP_GENERATORS is not set, defaulting to ninja' + os.environ['GYP_GENERATORS'] = 'ninja' + +- # Set up the environment variables. +- vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() +- + print 'Updating projects from gyp files...' + sys.stdout.flush() + +--- 47,52 ---- +diff -r -c pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_util.cpp +*** pdfium.orig/core/fxcrt/fx_basic_util.cpp 2016-05-09 10:47:41.000000000 -0300 +--- pdfium/core/fxcrt/fx_basic_util.cpp 2016-05-09 10:43:40.187642300 -0300 *************** *** 170,176 **** return bNegative ? -value : value; @@ -35,11 +73,11 @@ diff -c -r pdfium.orig/core/fxcrt/fx_basic_util.cpp pdfium/core/fxcrt/fx_basic_u #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ class CFindFileData { -diff -c -r pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/fx_system.h -*** pdfium.orig/core/fxcrt/include/fx_system.h 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/core/fxcrt/include/fx_system.h 2016-04-02 11:54:03.570816600 -0300 +diff -r -c pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/fx_system.h +*** pdfium.orig/core/fxcrt/include/fx_system.h 2016-05-09 10:47:41.000000000 -0300 +--- pdfium/core/fxcrt/include/fx_system.h 2016-05-09 10:43:40.203267200 -0300 *************** -*** 111,117 **** +*** 110,116 **** // NOTE: prevent use of the return value from snprintf() since some platforms // have different return values (e.g. windows _vsnprintf()), and provide // versions that always NUL-terminate. @@ -47,7 +85,7 @@ diff -c -r pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/ void FXSYS_snprintf(char* str, size_t size, _Printf_format_string_ const char* fmt, ---- 111,117 ---- +--- 110,116 ---- // NOTE: prevent use of the return value from snprintf() since some platforms // have different return values (e.g. windows _vsnprintf()), and provide // versions that always NUL-terminate. @@ -55,14 +93,14 @@ diff -c -r pdfium.orig/core/fxcrt/include/fx_system.h pdfium/core/fxcrt/include/ void FXSYS_snprintf(char* str, size_t size, _Printf_format_string_ const char* fmt, -diff -c -r pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win32/fx_win32_dwrite.cpp -*** pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/core/fxge/win32/fx_win32_dwrite.cpp 2016-04-02 11:54:03.586440700 -0300 +diff -r -c pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win32/fx_win32_dwrite.cpp +*** pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp 2016-05-09 10:47:42.000000000 -0300 +--- pdfium/core/fxge/win32/fx_win32_dwrite.cpp 2016-05-09 10:43:40.218892400 -0300 *************** *** 12,17 **** --- 12,23 ---- + #include "core/fxge/include/fx_ge_win32.h" #include "core/fxge/win32/dwrite_int.h" - #include "core/include/fxge/fx_ge_win32.h" + #ifdef __MINGW32__ + #define __in @@ -73,9 +111,9 @@ diff -c -r pdfium.orig/core/fxge/win32/fx_win32_dwrite.cpp pdfium/core/fxge/win3 typedef HRESULT(__stdcall* FuncType_DWriteCreateFactory)( __in DWRITE_FACTORY_TYPE, __in REFIID, -diff -c -r pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win32/fx_win32_gdipext.cpp -*** pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/core/fxge/win32/fx_win32_gdipext.cpp 2016-04-02 11:54:03.586440700 -0300 +diff -r -c pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win32/fx_win32_gdipext.cpp +*** pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp 2016-05-09 10:47:42.000000000 -0300 +--- pdfium/core/fxge/win32/fx_win32_gdipext.cpp 2016-05-09 10:43:40.218892400 -0300 *************** *** 691,697 **** return; @@ -114,9 +152,9 @@ diff -c -r pdfium.orig/core/fxge/win32/fx_win32_gdipext.cpp pdfium/core/fxge/win } CGdiplusExt::~CGdiplusExt() {} LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) { -diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp -*** pdfium.orig/pdfium.gyp 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/pdfium.gyp 2016-04-02 11:55:17.645195600 -0300 +diff -r -c pdfium.orig/pdfium.gyp pdfium/pdfium.gyp +*** pdfium.orig/pdfium.gyp 2016-05-09 10:47:42.000000000 -0300 +--- pdfium/pdfium.gyp 2016-05-09 10:43:40.218892400 -0300 *************** *** 106,112 **** }, @@ -135,8 +173,8 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp 'dependencies': [ 'third_party/third_party.gyp:bigint', *************** -*** 206,211 **** ---- 206,311 ---- +*** 208,213 **** +--- 208,315 ---- }, }, { @@ -158,6 +196,8 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp + 'pdfwindow', + ], + 'sources': [ ++ 'fpdfsdk/cfx_systemhandler.cpp', ++ 'fpdfsdk/cfx_systemhandler.h', + 'fpdfsdk/include/fsdk_actionhandler.h', + 'fpdfsdk/include/fsdk_annothandler.h', + 'fpdfsdk/include/fsdk_baseannot.h', @@ -244,43 +284,7 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp 'type': 'static_library', 'sources': [ *************** -*** 618,634 **** - 'core/fxcrt/fxcrt_windows.cpp', - 'core/fxcrt/fxcrt_windows.h', - 'core/fxcrt/include/cfx_retain_ptr.h', -! 'core/include/fxcrt/fx_basic.h', -! 'core/include/fxcrt/fx_bidi.h', -! 'core/include/fxcrt/fx_coordinates.h', -! 'core/include/fxcrt/fx_ext.h', -! 'core/include/fxcrt/fx_memory.h', -! 'core/include/fxcrt/fx_safe_types.h', -! 'core/include/fxcrt/fx_stream.h', -! 'core/include/fxcrt/fx_string.h', -! 'core/include/fxcrt/fx_system.h', -! 'core/include/fxcrt/fx_ucd.h', -! 'core/include/fxcrt/fx_xml.h', - 'core/fxcrt/plex.h', - 'core/fxcrt/xml_int.h', - ], ---- 718,733 ---- - 'core/fxcrt/fxcrt_windows.cpp', - 'core/fxcrt/fxcrt_windows.h', - 'core/fxcrt/include/cfx_retain_ptr.h', -! 'core/fxcrt/include/fx_basic.h', -! 'core/fxcrt/include/fx_coordinates.h', -! 'core/fxcrt/include/fx_ext.h', -! 'core/fxcrt/include/fx_memory.h', -! 'core/fxcrt/include/fx_safe_types.h', -! 'core/fxcrt/include/fx_stream.h', -! 'core/fxcrt/include/fx_string.h', -! 'core/fxcrt/include/fx_system.h', -! 'core/fxcrt/include/fx_ucd.h', -! 'core/fxcrt/include/fx_xml.h', - 'core/fxcrt/plex.h', - 'core/fxcrt/xml_int.h', - ], -*************** -*** 892,898 **** +*** 912,918 **** 'dependencies': [ '<(DEPTH)/testing/gtest.gyp:gtest_main', '<(DEPTH)/testing/gtest.gyp:gtest', @@ -288,7 +292,7 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp 'test_support', ], 'sources': [ ---- 991,997 ---- +--- 1014,1020 ---- 'dependencies': [ '<(DEPTH)/testing/gtest.gyp:gtest_main', '<(DEPTH)/testing/gtest.gyp:gtest', @@ -297,7 +301,7 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp ], 'sources': [ *************** -*** 944,950 **** +*** 975,981 **** 'dependencies': [ '<(DEPTH)/testing/gmock.gyp:gmock', '<(DEPTH)/testing/gtest.gyp:gtest', @@ -305,7 +309,7 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp 'test_support', ], 'sources': [ ---- 1043,1049 ---- +--- 1077,1083 ---- 'dependencies': [ '<(DEPTH)/testing/gmock.gyp:gmock', '<(DEPTH)/testing/gtest.gyp:gtest', @@ -313,9 +317,9 @@ diff -c -r pdfium.orig/pdfium.gyp pdfium/pdfium.gyp 'test_support', ], 'sources': [ -diff -c -r pdfium.orig/samples/samples.gyp pdfium/samples/samples.gyp -*** pdfium.orig/samples/samples.gyp 2016-04-02 10:39:35.000000000 -0300 ---- pdfium/samples/samples.gyp 2016-04-02 11:54:03.602067000 -0300 +diff -r -c pdfium.orig/samples/samples.gyp pdfium/samples/samples.gyp +*** pdfium.orig/samples/samples.gyp 2016-05-09 10:47:42.000000000 -0300 +--- pdfium/samples/samples.gyp 2016-05-09 10:43:40.218892400 -0300 *************** *** 40,46 **** 'target_name': 'pdfium_test',