[mingw-poppler] Add patches, bump soname
Sandro Mani
smani at fedoraproject.org
Wed May 14 18:27:39 UTC 2014
commit acff643a588b6731bed8b3fe400220aee6a0af3d
Author: Sandro Mani <manisandro at gmail.com>
Date: Wed May 14 20:27:25 2014 +0200
Add patches, bump soname
mingw-poppler.spec | 10 ++++++++--
poppler_mingw.patch | 36 ++++++++++++++++++++++++++++++++++++
poppler_qt5-configureac.patch | 27 +++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 2 deletions(-)
---
diff --git a/mingw-poppler.spec b/mingw-poppler.spec
index 392fc2b..b4e2f2c 100644
--- a/mingw-poppler.spec
+++ b/mingw-poppler.spec
@@ -13,6 +13,10 @@ URL: http://poppler.freedesktop.org/
Source0: http://poppler.freedesktop.org/%{pkgname}-%{version}.tar.xz
# Add Libs.private sections to pkg-config
Patch0: poppler_pkgconfig_private_libs.patch
+# Fix issues when building in mingw environment
+Patch1: poppler_mingw.patch
+# Fix Qt5 detection
+Patch2: poppler_qt5-configureac.patch
# Needed for Patch0
BuildRequires: autoconf automake libtool
@@ -210,6 +214,8 @@ Static version of the MinGW Windows C++ Poppler library.
%prep
%setup -q -n %{pkgname}-%{version}
%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
autoreconf -if
@@ -240,7 +246,7 @@ rm -f %{buildroot}%{mingw64_bindir}/*.exe
%files -n mingw32-%{pkgname}
%doc COPYING README
-%{mingw32_bindir}/libpoppler-44.dll
+%{mingw32_bindir}/libpoppler-46.dll
%{mingw32_includedir}/poppler/
%{mingw32_libdir}/libpoppler.dll.a
%{mingw32_libdir}/pkgconfig/poppler.pc
@@ -288,7 +294,7 @@ rm -f %{buildroot}%{mingw64_bindir}/*.exe
%files -n mingw64-%{pkgname}
%doc COPYING README
-%{mingw64_bindir}/libpoppler-44.dll
+%{mingw64_bindir}/libpoppler-46.dll
%{mingw64_includedir}/poppler/
%{mingw64_libdir}/libpoppler.dll.a
%{mingw64_libdir}/pkgconfig/poppler.pc
diff --git a/poppler_mingw.patch b/poppler_mingw.patch
new file mode 100644
index 0000000..93bd8ac
--- /dev/null
+++ b/poppler_mingw.patch
@@ -0,0 +1,36 @@
+diff -rupN poppler-0.26.0/qt4/tests/stress-threads-qt4.cpp poppler-0.26.0-new/qt4/tests/stress-threads-qt4.cpp
+--- poppler-0.26.0/qt4/tests/stress-threads-qt4.cpp 2014-02-09 16:10:33.000000000 +0100
++++ poppler-0.26.0-new/qt4/tests/stress-threads-qt4.cpp 2014-05-14 20:18:03.518160259 +0200
+@@ -2,7 +2,7 @@
+ #ifndef _WIN32
+ #include <unistd.h>
+ #else
+-#include <Windows.h>
++#include <windows.h>
+ #define sleep Sleep
+ #endif
+ #include <time.h>
+diff -rupN poppler-0.26.0/qt5/src/poppler-private.h poppler-0.26.0-new/qt5/src/poppler-private.h
+--- poppler-0.26.0/qt5/src/poppler-private.h 2014-04-14 23:43:14.000000000 +0200
++++ poppler-0.26.0-new/qt5/src/poppler-private.h 2014-05-14 20:19:59.367568497 +0200
+@@ -88,7 +88,7 @@ namespace Poppler {
+ #ifdef _WIN32
+ wchar_t *fileName = new WCHAR[filePath.length()];
+ std::wstring wstr = (const wchar_t *)filePath.utf16();
+- int length = wstr._Copy_s(fileName, filePath.length(), filePath.length());
++ int length = wstr.copy(fileName, filePath.length());
+ doc = new PDFDoc(fileName, length, ownerPassword, userPassword);
+ delete[] fileName;
+ #else
+diff -rupN poppler-0.26.0/qt5/tests/stress-threads-qt5.cpp poppler-0.26.0-new/qt5/tests/stress-threads-qt5.cpp
+--- poppler-0.26.0/qt5/tests/stress-threads-qt5.cpp 2014-02-09 16:10:34.000000000 +0100
++++ poppler-0.26.0-new/qt5/tests/stress-threads-qt5.cpp 2014-05-14 20:18:03.519160280 +0200
+@@ -2,7 +2,7 @@
+ #ifndef _WIN32
+ #include <unistd.h>
+ #else
+-#include <Windows.h>
++#include <windows.h>
+ #define sleep Sleep
+ #endif
+ #include <time.h>
diff --git a/poppler_qt5-configureac.patch b/poppler_qt5-configureac.patch
new file mode 100644
index 0000000..bf5d3a1
--- /dev/null
+++ b/poppler_qt5-configureac.patch
@@ -0,0 +1,27 @@
+diff -rupN poppler-0.26.0/configure.ac poppler-0.26.0-new/configure.ac
+--- poppler-0.26.0/configure.ac 2014-04-25 00:40:07.000000000 +0200
++++ poppler-0.26.0-new/configure.ac 2014-05-14 20:11:46.279077876 +0200
+@@ -646,20 +646,20 @@ if test x$enable_poppler_qt5 = xyes; the
+ AC_CHECK_TOOL(MOCQT5, moc)
+ AC_MSG_CHECKING([for Qt5 moc])
+ mocversion=`$MOCQT5 -v 2>&1`
+- mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"`
++ mocversiongrep=`echo $mocversion | grep "5\."`
+ if test x"$mocversiongrep" != x"$mocversion"; then
+ AC_MSG_RESULT([no])
+ # moc was not the qt5 one, try with moc-qt5
+ AC_CHECK_TOOL(MOCQT52, moc-qt5)
+ AC_MSG_CHECKING([for Qt5 moc-qt5])
+ mocversion=`$MOCQT52 -v 2>&1`
+- mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"`
++ mocversiongrep=`echo $mocversion | grep "5\."`
+ if test x"$mocversiongrep" != x"$mocversion"; then
+ AC_CHECK_TOOL(QTCHOOSER, qtchooser)
+ AC_MSG_CHECKING([for qtchooser])
+ qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2`
+ mocversion=`$qt5tooldir/moc -v 2>&1`
+- mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"`
++ mocversiongrep=`echo $mocversion | grep "5\."`
+ if test x"$mocversiongrep" != x"$mocversion"; then
+ # no valid moc found
+ enable_poppler_qt5=no;
More information about the scm-commits
mailing list