diff --git a/poppler-0.30.0-rotated-words-selection.patch b/poppler-0.30.0-rotated-words-selection.patch deleted file mode 100644 index 33c6b8e3fbe5dfbb7077e7b49a31600b4cfb5103..0000000000000000000000000000000000000000 --- a/poppler-0.30.0-rotated-words-selection.patch +++ /dev/null @@ -1,285 +0,0 @@ -From 0ab1f29d4ce315b0fca260c0e0f3007024d00342 Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Tue, 28 Jan 2014 15:13:24 +0100 -Subject: [PATCH] TextOutputDev: Respect orientation when selecting words - -Take rotation into account when visiting selection. -This doesn't fix all problems (there are still problems -on line and block levels). - -https://bugs.freedesktop.org/show_bug.cgi?id=16619 ---- - poppler/TextOutputDev.cc | 193 ++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 150 insertions(+), 43 deletions(-) - -diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc -index 7c2ca78..e93908c 100644 ---- a/poppler/TextOutputDev.cc -+++ b/poppler/TextOutputDev.cc -@@ -178,6 +178,12 @@ - // (Or 1/tan(angle) for 90/270 degrees.) - #define diagonalThreshold 0.1 - -+// Returns whether x is between a and b or equal to a or b. -+// a and b don't need to be sorted. -+#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \ -+ ((x) < (a) && (x) < (b))) ? \ -+ true : false) -+ - namespace { - - inline bool isAscii7 (Unicode uchar) { -@@ -4411,11 +4417,37 @@ void TextSelectionSizer::visitLine (TextLine *line, - PDFRectangle *rect; - double x1, y1, x2, y2, margin; - -- margin = (line->yMax - line->yMin) / 8; -- x1 = line->edge[edge_begin]; -- y1 = line->yMin - margin; -- x2 = line->edge[edge_end]; -- y2 = line->yMax + margin; -+ switch (line->rot) { -+ default: -+ case 0: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_begin]; -+ x2 = line->edge[edge_end]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 1: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_begin]; -+ y2 = line->edge[edge_end]; -+ break; -+ case 2: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_end]; -+ x2 = line->edge[edge_begin]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 3: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_end]; -+ y2 = line->edge[edge_begin]; -+ break; -+ } - - rect = new PDFRectangle (floor (x1 * scale), - floor (y1 * scale), -@@ -4499,19 +4531,56 @@ void TextSelectionPainter::visitLine (TextLine *line, - { - double x1, y1, x2, y2, margin; - -- margin = (line->yMax - line->yMin) / 8; -- x1 = floor (line->edge[edge_begin]); -- y1 = floor (line->yMin - margin); -- x2 = ceil (line->edge[edge_end]); -- y2 = ceil (line->yMax + margin); -+ switch (line->rot) { -+ default: -+ case 0: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_begin]; -+ x2 = line->edge[edge_end]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 1: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_begin]; -+ y2 = line->edge[edge_end]; -+ break; -+ case 2: -+ margin = (line->yMax - line->yMin) / 8; -+ x1 = line->edge[edge_end]; -+ x2 = line->edge[edge_begin]; -+ y1 = line->yMin - margin; -+ y2 = line->yMax + margin; -+ break; -+ case 3: -+ margin = (line->xMax - line->xMin) / 8; -+ x1 = line->xMin - margin; -+ x2 = line->xMax + margin; -+ y1 = line->edge[edge_end]; -+ y2 = line->edge[edge_begin]; -+ break; -+ } -+ -+ ctm.transform(x1, y1, &x1, &y1); -+ ctm.transform(x2, y2, &x2, &y2); - -- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1); -- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2); -+ if (x1 < x2) { -+ x1 = floor (x1); -+ x2 = ceil (x2); -+ } else { -+ x1 = ceil (x1); -+ x2 = floor (x2); -+ } - -- x1 = floor (x1); -- y1 = floor (y1); -- x2 = ceil (x2); -- y2 = ceil (y2); -+ if (y1 < y2) { -+ y1 = floor (y1); -+ y2 = ceil (y2); -+ } else { -+ y1 = ceil (y1); -+ y2 = floor (y2); -+ } - - ictm.transform(x1, y1, &x1, &y1); - ictm.transform(x2, y2, &x2, &y2); -@@ -4589,17 +4658,27 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor, - SelectionStyle style) - { - int i, begin, end; -- double mid; -+ double mid, s1, s2; -+ -+ if (rot == 0 || rot == 2) { -+ s1 = selection->x1; -+ s2 = selection->x2; -+ } else { -+ s1 = selection->y1; -+ s2 = selection->y2; -+ } - - begin = len; - end = 0; - for (i = 0; i < len; i++) { - mid = (edge[i] + edge[i + 1]) / 2; -- if (selection->x1 < mid || selection->x2 < mid) -- if (i < begin) -- begin = i; -- if (mid < selection->x1 || mid < selection->x2) -- end = i + 1; -+ if (XBetweenAB (mid, s1, s2)) -+ { -+ if (i < begin) -+ begin = i; -+ -+ end = i + 1; -+ } - } - - /* Skip empty selection. */ -@@ -4615,30 +4694,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, - TextWord *p, *begin, *end, *current; - int i, edge_begin, edge_end; - PDFRectangle child_selection; -+ double s1, s2, p_min, p_max; -+ -+ if (rot == 0 || rot == 2) { -+ s1 = selection->x1; -+ s2 = selection->x2; -+ } else { -+ s1 = selection->y1; -+ s2 = selection->y2; -+ } - - begin = nullptr; - end = nullptr; - current = nullptr; - for (p = words; p != nullptr; p = p->next) { -+ if (rot == 0 || rot == 2) { -+ p_min = p->xMin; -+ p_max = p->xMax; -+ } else { -+ p_min = p->yMin; -+ p_max = p->yMax; -+ } -+ - if (blk->page->primaryLR) { -- if ((selection->x1 < p->xMax) || -- (selection->x2 < p->xMax)) -- if (begin == nullptr) -- begin = p; -+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr) -+ begin = p; - -- if (((selection->x1 > p->xMin) || -- (selection->x2 > p->xMin)) && (begin != nullptr)) { -+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) { - end = p->next; - current = p; - } - } else { -- if ((selection->x1 > p->xMin) || -- (selection->x2 > p->xMin)) -- if (begin == nullptr) -- begin = p; -+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr) -+ begin = p; - -- if (((selection->x1 < p->xMax) || -- (selection->x2 < p->xMax)) && (begin != nullptr)) { -+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) { - end = p->next; - current = p; - } -@@ -4650,23 +4740,42 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, - - child_selection = *selection; - if (style == selectionStyleWord) { -- child_selection.x1 = begin ? begin->xMin : xMin; -- if (end && end->xMax != -1) { -- child_selection.x2 = current->xMax; -+ if (rot == 0 || rot == 2) { -+ child_selection.x1 = begin ? begin->xMin : xMin; -+ if (end && end->xMax != -1) { -+ child_selection.x2 = current->xMax; -+ } else { -+ child_selection.x2 = xMax; -+ } - } else { -- child_selection.x2 = xMax; -+ child_selection.y1 = begin ? begin->yMin : yMin; -+ if (end && end->yMax != -1) { -+ child_selection.y2 = current->yMax; -+ } else { -+ child_selection.y2 = yMax; -+ } - } - } - -+ if (rot == 0 || rot == 2) { -+ s1 = child_selection.x1; -+ s2 = child_selection.x2; -+ } else { -+ s1 = child_selection.y1; -+ s2 = child_selection.y2; -+ } -+ - edge_begin = len; - edge_end = 0; - for (i = 0; i < len; i++) { - double mid = (edge[i] + edge[i + 1]) / 2; -- if (child_selection.x1 < mid || child_selection.x2 < mid) -- if (i < edge_begin) -- edge_begin = i; -- if (mid < child_selection.x2 || mid < child_selection.x1) -- edge_end = i + 1; -+ if (XBetweenAB (mid, s1, s2)) -+ { -+ if (i < edge_begin) -+ edge_begin = i; -+ -+ edge_end = i + 1; -+ } - } - - /* Skip empty selection. */ --- -1.8.4.2 - diff --git a/poppler-0.73.0-PSOutputDev-buffer-read.patch b/poppler-0.73.0-PSOutputDev-buffer-read.patch deleted file mode 100644 index 707ef1bace9e42264e740b57a65e34b6e46ed6bb..0000000000000000000000000000000000000000 --- a/poppler-0.73.0-PSOutputDev-buffer-read.patch +++ /dev/null @@ -1,289 +0,0 @@ -From 9bcc9d0a164dbd1f24aae8f900c28feafd0cb3f2 Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Tue, 30 Apr 2019 18:47:44 +0200 -Subject: [PATCH] PSOutputDev: Don't read outside of image buffer - -Check whether input image is RGB or BGR to not treat -it as CMYK in those cases in PSOutputDev::checkPageSlice(). - -Fixes #751 ---- - poppler/PSOutputDev.cc | 248 ++++++++++++++++++++++++++++++++--------- - 1 file changed, 196 insertions(+), 52 deletions(-) - -diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc -index 0d201835..155a8cbe 100644 ---- a/poppler/PSOutputDev.cc -+++ b/poppler/PSOutputDev.cc -@@ -3374,6 +3374,14 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, - } - break; - case psLevel1Sep: -+ GfxColor inputColor; -+ GfxCMYK cmyk; -+ unsigned char cmykColor[4]; -+ GfxDeviceRGBColorSpace *rgbCS; -+ SplashColorMode colorMode; -+ -+ colorMode = bitmap->getMode(); -+ - p = bitmap->getDataPtr(); - // Check for an all gray image - if (getOptimizeColorSpace()) { -@@ -3448,65 +3456,201 @@ bool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/, - } - } else if (((psProcessCyan | psProcessMagenta | psProcessYellow | psProcessBlack) & ~processColors) != 0) { - // Color image, need to check color flags for each dot -- for (y = 0; y < h; ++y) { -- for (comp = 0; comp < 4; ++comp) { -- if (useBinary) { -- // Binary color image -- for (x = 0; x < w; ++x) { -- col[comp] |= p[4*x + comp]; -- hexBuf[i++] = p[4*x + comp]; -- if (i >= 64) { -- writePSBuf(hexBuf, i); -- i = 0; -+ switch (colorMode) { -+ case splashModeRGB8: -+ case splashModeBGR8: -+ rgbCS = new GfxDeviceRGBColorSpace(); -+ for (y = 0; y < h; ++y) { -+ for (comp = 0; comp < 4; ++comp) { -+ if (useBinary) { -+ // Binary color image -+ for (x = 0; x < w; ++x) { -+ if (likely(colorMode == splashModeRGB8)) { -+ inputColor.c[0] = byteToCol(p[3*x + 0]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 2]); -+ } else { -+ inputColor.c[0] = byteToCol(p[3*x + 2]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 0]); -+ } -+ rgbCS->getCMYK(&inputColor, &cmyk); -+ cmykColor[0] = colToByte(cmyk.c); -+ cmykColor[1] = colToByte(cmyk.m); -+ cmykColor[2] = colToByte(cmyk.y); -+ cmykColor[3] = colToByte(cmyk.k); -+ -+ col[comp] |= cmykColor[comp]; -+ hexBuf[i++] = cmykColor[comp]; -+ if (i >= 64) { -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } -+ } else { -+ // Gray color image -+ for (x = 0; x < w; ++x) { -+ if (likely(colorMode == splashModeRGB8)) { -+ inputColor.c[0] = byteToCol(p[3*x + 0]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 2]); -+ } else { -+ inputColor.c[0] = byteToCol(p[3*x + 2]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 0]); -+ } -+ rgbCS->getCMYK(&inputColor, &cmyk); -+ cmykColor[0] = colToByte(cmyk.c); -+ cmykColor[1] = colToByte(cmyk.m); -+ cmykColor[2] = colToByte(cmyk.y); -+ cmykColor[3] = colToByte(cmyk.k); -+ -+ col[comp] |= cmykColor[comp]; -+ digit = cmykColor[comp] / 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ digit = cmykColor[comp] % 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ if (i >= 64) { -+ hexBuf[i++] = '\n'; -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } - } -- } -- } else { -- // Gray color image -- for (x = 0; x < w; ++x) { -- col[comp] |= p[4*x + comp]; -- digit = p[4*x + comp] / 16; -- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -- digit = p[4*x + comp] % 16; -- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -- if (i >= 64) { -- hexBuf[i++] = '\n'; -- writePSBuf(hexBuf, i); -- i = 0; -+ } -+ p -= bitmap->getRowSize(); -+ } -+ delete rgbCS; -+ break; -+ default: -+ for (y = 0; y < h; ++y) { -+ for (comp = 0; comp < 4; ++comp) { -+ if (useBinary) { -+ // Binary color image -+ for (x = 0; x < w; ++x) { -+ col[comp] |= p[4*x + comp]; -+ hexBuf[i++] = p[4*x + comp]; -+ if (i >= 64) { -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } -+ } else { -+ // Gray color image -+ for (x = 0; x < w; ++x) { -+ col[comp] |= p[4*x + comp]; -+ digit = p[4*x + comp] / 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ digit = p[4*x + comp] % 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ if (i >= 64) { -+ hexBuf[i++] = '\n'; -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } - } -- } -- } -- } -- p -= bitmap->getRowSize(); -+ } -+ p -= bitmap->getRowSize(); -+ } -+ break; - } - } else { - // Color image, do not need to check color flags -- for (y = 0; y < h; ++y) { -- for (comp = 0; comp < 4; ++comp) { -- if (useBinary) { -- // Binary color image -- for (x = 0; x < w; ++x) { -- hexBuf[i++] = p[4*x + comp]; -- if (i >= 64) { -- writePSBuf(hexBuf, i); -- i = 0; -+ switch (colorMode) { -+ case splashModeRGB8: -+ case splashModeBGR8: -+ rgbCS = new GfxDeviceRGBColorSpace(); -+ for (y = 0; y < h; ++y) { -+ for (comp = 0; comp < 4; ++comp) { -+ if (useBinary) { -+ // Binary color image -+ for (x = 0; x < w; ++x) { -+ if (likely(colorMode == splashModeRGB8)) { -+ inputColor.c[0] = byteToCol(p[3*x + 0]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 2]); -+ } else { -+ inputColor.c[0] = byteToCol(p[3*x + 2]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 0]); -+ } -+ rgbCS->getCMYK(&inputColor, &cmyk); -+ cmykColor[0] = colToByte(cmyk.c); -+ cmykColor[1] = colToByte(cmyk.m); -+ cmykColor[2] = colToByte(cmyk.y); -+ cmykColor[3] = colToByte(cmyk.k); -+ -+ hexBuf[i++] = cmykColor[comp]; -+ if (i >= 64) { -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } -+ } else { -+ // Hex color image -+ for (x = 0; x < w; ++x) { -+ if (likely(colorMode == splashModeRGB8)) { -+ inputColor.c[0] = byteToCol(p[3*x + 0]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 2]); -+ } else { -+ inputColor.c[0] = byteToCol(p[3*x + 2]); -+ inputColor.c[1] = byteToCol(p[3*x + 1]); -+ inputColor.c[2] = byteToCol(p[3*x + 0]); -+ } -+ rgbCS->getCMYK(&inputColor, &cmyk); -+ cmykColor[0] = colToByte(cmyk.c); -+ cmykColor[1] = colToByte(cmyk.m); -+ cmykColor[2] = colToByte(cmyk.y); -+ cmykColor[3] = colToByte(cmyk.k); -+ -+ digit = cmykColor[comp] / 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ digit = cmykColor[comp] % 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ if (i >= 64) { -+ hexBuf[i++] = '\n'; -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } - } -- } -- } else { -- // Hex color image -- for (x = 0; x < w; ++x) { -- digit = p[4*x + comp] / 16; -- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -- digit = p[4*x + comp] % 16; -- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -- if (i >= 64) { -- hexBuf[i++] = '\n'; -- writePSBuf(hexBuf, i); -- i = 0; -+ } -+ p -= bitmap->getRowSize(); -+ } -+ delete rgbCS; -+ break; -+ default: -+ for (y = 0; y < h; ++y) { -+ for (comp = 0; comp < 4; ++comp) { -+ if (useBinary) { -+ // Binary color image -+ for (x = 0; x < w; ++x) { -+ hexBuf[i++] = p[4*x + comp]; -+ if (i >= 64) { -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } -+ } else { -+ // Hex color image -+ for (x = 0; x < w; ++x) { -+ digit = p[4*x + comp] / 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ digit = p[4*x + comp] % 16; -+ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); -+ if (i >= 64) { -+ hexBuf[i++] = '\n'; -+ writePSBuf(hexBuf, i); -+ i = 0; -+ } -+ } - } -- } -- } -- } -- p -= bitmap->getRowSize(); -+ } -+ p -= bitmap->getRowSize(); -+ } -+ break; - } - } - if (i != 0) { --- -2.21.0 - diff --git a/poppler-0.84.0-MacroPushRequiredVars.patch b/poppler-0.84.0-MacroPushRequiredVars.patch deleted file mode 100644 index 3d47d81c5b7beb11f67b857c21c5843184c600e3..0000000000000000000000000000000000000000 --- a/poppler-0.84.0-MacroPushRequiredVars.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 25feab2736d35ca707bde173b4a7d548da342211 Mon Sep 17 00:00:00 2001 -From: Marek Kasik -Date: Thu, 2 Jan 2020 13:40:40 +0100 -Subject: [PATCH] Revert Remove unused MacroPushRequiredVars.cmake - -This is needed by the QT4 removal revert. ---- - cmake/modules/MacroPushRequiredVars.cmake | 46 +++++++++++++++++++++++ - 1 file changed, 46 insertions(+) - create mode 100644 cmake/modules/MacroPushRequiredVars.cmake - -diff --git a/cmake/modules/MacroPushRequiredVars.cmake b/cmake/modules/MacroPushRequiredVars.cmake -new file mode 100644 -index 00000000..35a6df5e ---- /dev/null -+++ b/cmake/modules/MacroPushRequiredVars.cmake -@@ -0,0 +1,46 @@ -+# this module defines two macros: -+# MACRO_PUSH_REQUIRED_VARS() -+# and -+# MACRO_POP_REQUIRED_VARS() -+# use these if you call cmake macros which use -+# any of the CMAKE_REQUIRED_XXX variables -+# -+# Usage: -+# MACRO_PUSH_REQUIRED_VARS() -+# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF) -+# CHECK_FUNCTION_EXISTS(...) -+# MACRO_POP_REQUIRED_VARS() -+ -+# Copyright (c) 2006, Alexander Neundorf, -+# -+# Redistribution and use is allowed according to the terms of the BSD license. -+# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -+ -+MACRO(MACRO_PUSH_REQUIRED_VARS) -+ -+ IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) -+ SET(_PUSH_REQUIRED_VARS_COUNTER 0) -+ ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER) -+ -+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1") -+ -+ SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) -+ SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) -+ SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) -+ SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_FLAGS}) -+ENDMACRO(MACRO_PUSH_REQUIRED_VARS) -+ -+MACRO(MACRO_POP_REQUIRED_VARS) -+ -+# don't pop more than we pushed -+ IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") -+ -+ SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) -+ SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) -+ SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) -+ SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}}) -+ -+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1") -+ ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0") -+ -+ENDMACRO(MACRO_POP_REQUIRED_VARS) --- -2.24.1 - diff --git a/poppler-0.90.0.tar.xz b/poppler-0.90.0.tar.xz deleted file mode 100644 index 7abd8ff4242b70572f4ca82e14599d61bae4dd2b..0000000000000000000000000000000000000000 Binary files a/poppler-0.90.0.tar.xz and /dev/null differ diff --git a/poppler-21.01.0-glib-introspection.patch b/poppler-21.01.0-glib-introspection.patch new file mode 100644 index 0000000000000000000000000000000000000000..9bbb221ddb84360e260d0b7fd479f7cc3cf5af02 --- /dev/null +++ b/poppler-21.01.0-glib-introspection.patch @@ -0,0 +1,11 @@ +--- poppler-21.01.0/glib/CMakeLists.txt ++++ poppler-21.01.0/glib/CMakeLists.txt +@@ -121,7 +121,7 @@ if (HAVE_INTROSPECTION AND BUILD_SHARED_ + + # General gir: Reset object-list for introspection & load tool args + set(INTROSPECTION_GIRS) +- set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all") ++ set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR}" "--warn-all" "--sources-top-dirs=${CMAKE_SOURCE_DIR}" "--sources-top-dirs=${CMAKE_BINARY_DIR}") + set(INTROSPECTION_COMPILER_ARGS "--includedir=${CMAKE_CURRENT_SOURCE_DIR}") + + # Poppler: Assign package to gir & export keys diff --git a/poppler-22.01.0.tar.xz b/poppler-22.01.0.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..2f03191617e9c053d9498ef440e033c79197594a Binary files /dev/null and b/poppler-22.01.0.tar.xz differ diff --git a/poppler-gcc11.patch b/poppler-gcc11.patch deleted file mode 100644 index f6614c36f397bb3e8bb7576396ad864a809b50cd..0000000000000000000000000000000000000000 --- a/poppler-gcc11.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/glib/poppler-enums.c.template b/glib/poppler-enums.c.template -index 26a51b4..27be2b9 100644 ---- a/glib/poppler-enums.c.template -+++ b/glib/poppler-enums.c.template -@@ -15,7 +15,7 @@ - GType - @enum_name@_get_type (void) - { -- static volatile gsize g_define_type_id__volatile = 0; -+ static gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) { - static const G@Type@Value values[] = { -diff --git a/glib/poppler-private.h b/glib/poppler-private.h -index 7726ec7..436bca5 100644 ---- a/glib/poppler-private.h -+++ b/glib/poppler-private.h -@@ -167,7 +167,7 @@ gboolean _poppler_convert_pdf_date_to_gtime (const GooString *date, - GType \ - type_name##_get_type (void) \ - { \ -- static volatile gsize g_define_type_id__volatile = 0; \ -+ static gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_boxed_type_register_static (g_intern_static_string (#TypeName), \ diff --git a/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz b/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz similarity index 51% rename from poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz rename to poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz index c168d867a6f4ed87357a869a589055cbc64a5926..309191432992841726336c2cc651b7177ee8a7ee 100644 Binary files a/poppler-test-2018-12-18-45f55f1e03b9bf3fbd334c31776b6f5e472889ec.tar.xz and b/poppler-test-2021-01-11-03a4b9eb854a06a83c465e82de601796c458bbe9.tar.xz differ diff --git a/poppler.spec b/poppler.spec index 0511c0caf18d167fdfb0c6d40b28c04673d22ffe..41dfde14f4c303123e3302d4e3905a836947eed7 100644 --- a/poppler.spec +++ b/poppler.spec @@ -1,20 +1,20 @@ -%global test_sha 45f55f1e03b9bf3fbd334c31776b6f5e472889ec -%global test_date 2018-12-18 +%global test_sha 03a4b9eb854a06a83c465e82de601796c458bbe9 +%global test_date 2021-01-11 +%global qt6 0 -Summary: PDF rendering library Name: poppler -Version: 0.90.0 -Release: 2 -License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT +Version: 22.01.0 +Release: 1 +Summary: PDF rendering library +License: GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz Source1: %{name}-test-%{test_date}-%{test_sha}.tar.xz -Patch0: poppler-0.30.0-rotated-words-selection.patch -Patch4: poppler-0.73.0-PSOutputDev-buffer-read.patch -Patch5: poppler-0.84.0-MacroPushRequiredVars.patch -Patch7: poppler-0.90.0-position-independent-code.patch -Patch8: %{name}-gcc11.patch +Patch1: poppler-0.90.0-position-independent-code.patch +Patch3: poppler-21.01.0-glib-introspection.patch + +BuildRequires: make BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gettext-devel @@ -28,7 +28,7 @@ BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gdk-pixbuf-2.0) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gobject-2.0) -BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(gtk-doc) BuildRequires: pkgconfig(lcms2) @@ -43,6 +43,15 @@ BuildRequires: pkgconfig(Qt5Gui) BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Xml) +%if 0%{?qt6} +BuildRequires: cmake(Qt6Core) +BuildRequires: cmake(Qt6Gui) +BuildRequires: cmake(Qt6Test) +BuildRequires: cmake(Qt6Widgets) +BuildRequires: cmake(Qt6Xml) +%endif +BuildRequires: boost-devel + Requires: poppler-data Obsoletes: poppler-glib-demos < 0.60.1-1 @@ -83,6 +92,7 @@ BuildArch: noarch %package qt5 Summary: Qt5 wrapper for poppler Requires: %{name} = %{version}-%{release} +Obsoletes: %{name}-qt < 0.90.0-9 %description qt5 %{summary}. @@ -91,9 +101,26 @@ Summary: Development files for Qt5 wrapper Requires: %{name}-qt5 = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release} Requires: qt5-qtbase-devel +Obsoletes: %{name}-qt-devel < 0.90.0-9 %description qt5-devel %{summary}. +%if 0%{?qt6} +%package qt6 +Summary: Qt6 wrapper for poppler +Requires: %{name} = %{version}-%{release} +%description qt6 +%{summary}. + +%package qt6-devel +Summary: Development files for Qt6 wrapper +Requires: %{name}-qt6 = %{version}-%{release} +Requires: %{name}-devel = %{version}-%{release} +Requires: qt6-qtbase-devel +%description qt6-devel +%{summary}. +%endif + %package cpp Summary: Pure C++ wrapper for poppler Requires: %{name} = %{version}-%{release} @@ -120,6 +147,7 @@ other formats. %prep %autosetup -p1 -b 1 +chmod -x poppler/CairoFontEngine.cc %build mkdir build @@ -140,25 +168,30 @@ cd build %check %make_build test export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig -#test "$(pkg-config --modversion poppler)" = "%{version}" -test "$(pkg-config --modversion poppler-cairo)" = "%{version}" +test "$(pkg-config --modversion poppler)" = "%{version}" test "$(pkg-config --modversion poppler-cpp)" = "%{version}" test "$(pkg-config --modversion poppler-glib)" = "%{version}" test "$(pkg-config --modversion poppler-qt5)" = "%{version}" -test "$(pkg-config --modversion poppler-splash)" = "%{version}" +%if 0%{?qt6} +test "$(pkg-config --modversion poppler-qt6)" = "%{version}" +%endif + %ldconfig_scriptlets %ldconfig_scriptlets glib %ldconfig_scriptlets qt5 %ldconfig_scriptlets cpp +%if 0%{?qt6} +%ldconfig_scriptlets qt6 +%endif + %files %license COPYING -%{_libdir}/libpoppler.so.101* +%{_libdir}/libpoppler.so.117* %files devel %{_libdir}/pkgconfig/poppler.pc -%{_libdir}/pkgconfig/poppler-splash.pc %{_libdir}/libpoppler.so %dir %{_includedir}/poppler/ # xpdf headers @@ -173,7 +206,6 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %files glib-devel %{_libdir}/pkgconfig/poppler-glib.pc -%{_libdir}/pkgconfig/poppler-cairo.pc %{_libdir}/libpoppler-glib.so %{_datadir}/gir-1.0/Poppler-0.18.gir %{_includedir}/poppler/glib/ @@ -201,11 +233,24 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %files utils %{_bindir}/pdf* +%if 0%{?qt6} +%files qt6 +%{_libdir}/libpoppler-qt6.so.3* + +%files qt6-devel +%{_libdir}/libpoppler-qt6.so +%{_libdir}/pkgconfig/poppler-qt6.pc +%{_includedir}/poppler/qt6/ +%endif + %files help %doc README.md %{_mandir}/man1/* %changelog +* Mon Jun 13 2022 lin zhang - 22.01.0-1 +- Update to 22.01.0 + * Tue Sep 07 2021 chenchen - 0.90.0-2 - add help moudle for ISO creating diff --git a/poppler.yaml b/poppler.yaml index 05affd59fb2171445c8cbb241bb307c088cf85a0..96e99fb2785ee37f8c647d77bd4f1ccfd5684594 100644 --- a/poppler.yaml +++ b/poppler.yaml @@ -1,4 +1,4 @@ version_control: git src_repo: https://anongit.freedesktop.org/git/poppler/poppler.git tag_prefix: ^poppler- -seperator: . +separator: .