poppler: upgrade 24.11.0 -> 24.12.0

* Upgrade 24.11.0 -> 24.12.0
* Backport patch 0001-Don-t-update-pdfsig.pot-when-POT-Creation-date-is-th.patch
  to fix a parallel build issue, refer [1]

[1] https://gitlab.freedesktop.org/poppler/poppler/-/issues/1550

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Changqing Li
2024-12-30 10:22:43 +08:00
committed by Khem Raj
parent 79fbbad63c
commit 230ddc9439
2 changed files with 129 additions and 1 deletions
@@ -0,0 +1,127 @@
From 053acd5d2b310c696993dc97072d1f2b3b1dd7ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= <nbenitezl@gmail.com>
Date: Fri, 5 Apr 2024 15:08:09 +0100
Subject: [PATCH] Don't update pdfsig.pot when POT-Creation-date is the only
change
Everytime we perform a Poppler build the pdfsig.pot file is
updated with just a new timestamp in POT-Creation-date field.
That is a nuance as we have to always discard that change in Git
prior to submitting a MR or just switching branches locally.
- Fix it by only updating pdfsig.pot when there are changes
other than the POT-Creation-date. Currently only done for
platforms other than Windows as it requires 'diff' command.
- Change the OUTPUT/DEPENDS to be pdfsig.pot.new instead of
pdfsig.pot, which is more correct as the former is auto
generated while the later is a repo checked-in file, this
way we avoid pdfsig.pot from being marked as deleted by
git when doing a 'make clean'.
Other changes:
- Drop flag '-s' from msgmerge as it's deprecated, use
instead sort flag '-F' for both msgmerge and xgettext
so their output is more synced and so prevent useless
diffs that only carry reordering changes.
- Drop redundant flag '--language=C++' as xgettext will
use that anyway by recognizing source extension '.cc'
- Update 'pdfsig.pot' and 'ca/pdfsig.po' with the outputs
generated with the new flags.
Some related info:
https://savannah.gnu.org/bugs/?49654#comment1
Fixes #1479
Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/053acd5d2b310c696993dc97072d1f2b3b1dd7ac]
Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
utils/po/CMakeLists.txt | 24 +++++++++++++++++-------
utils/po/ca/pdfsig.po | 10 ++++++----
utils/po/pdfsig.pot | 6 ++++--
3 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/utils/po/CMakeLists.txt b/utils/po/CMakeLists.txt
index 2eb7f0f0..38e1fd44 100644
--- a/utils/po/CMakeLists.txt
+++ b/utils/po/CMakeLists.txt
@@ -13,16 +13,26 @@ macro(UPDATE_POT_FILE input)
foreach(_lang ${_langs})
set(_poFile "${CMAKE_CURRENT_SOURCE_DIR}/${_lang}/${input}.po")
list(APPEND _commands
- COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} "${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}")
+ COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -F ${_poFile} "${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}")
endforeach()
- add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}
- COMMAND xgettext --keyword=_ --language=c++ --package-name=pdfsig --output-dir=po --output=${_potFile} ${input}.cc
- ${_commands}
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.cc
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+ set(COPY_NEW_POTFILE ${CMAKE_COMMAND} -E copy po/${_potFile}.new po/${_potFile})
+ if (NOT (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows"))
+ # IF the new potfile carries changes other than an updated POT-creation-date (autogenerated) THEN proceed to use that new potfile
+ set(CM diff --brief --ignore-matching-lines="POT-Creation-Date.*" po/${_potFile} po/${_potFile}.new || ${COPY_NEW_POTFILE})
+ else ()
+ set(CM ${COPY_NEW_POTFILE})
+ endif ()
+
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}.new
+ COMMAND xgettext ${input}.cc --package-name=${input} --keyword=_ -F --output=po/${_potFile}.new
+ COMMAND ${CM}
+ ${_commands}
+ DEPENDS ../${input}.cc
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
add_custom_target(update_pot_${input}
ALL
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile})
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_potFile}.new)
endmacro()
UPDATE_POT_FILE(pdfsig)
diff --git a/utils/po/ca/pdfsig.po b/utils/po/ca/pdfsig.po
index fe6a14e7..0d83e42c 100644
--- a/utils/po/ca/pdfsig.po
+++ b/utils/po/ca/pdfsig.po
@@ -18,9 +18,11 @@ msgstr ""
"X-Generator: Lokalize 22.12.3\n"
#: pdfsig.cc:544
-msgid "Digitally signed by {0:s}"
-msgstr "Signat digitalment per {0:s}"
-
-#: pdfsig.cc:544
+#, c++-format
msgid "Date: {0:s}"
msgstr "Data: {0:s}"
+
+#: pdfsig.cc:544
+#, c++-format
+msgid "Digitally signed by {0:s}"
+msgstr "Signat digitalment per {0:s}"
diff --git a/utils/po/pdfsig.pot b/utils/po/pdfsig.pot
index 83095113..ffe3bc2f 100644
--- a/utils/po/pdfsig.pot
+++ b/utils/po/pdfsig.pot
@@ -18,9 +18,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
#: pdfsig.cc:544
-msgid "Digitally signed by {0:s}"
+#, c++-format
+msgid "Date: {0:s}"
msgstr ""
#: pdfsig.cc:544
-msgid "Date: {0:s}"
+#, c++-format
+msgid "Digitally signed by {0:s}"
msgstr ""
--
2.34.1
@@ -7,8 +7,9 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
file://0001-Do-not-overwrite-all-our-build-flags.patch \
file://basename-include.patch \
file://0001-cmake-Do-not-use-isystem.patch \
file://0001-Don-t-update-pdfsig.pot-when-POT-Creation-date-is-th.patch \
"
SRC_URI[sha256sum] = "7723d880565211740c13649d24a300257b86ddd7fa2d208187ff7e5cc8dfbd58"
SRC_URI[sha256sum] = "1cf374c3146f3f685d9257701bf0c2866c61d6c202c14d1f5c01a1f3a089028a"
DEPENDS = "fontconfig zlib cairo lcms glib-2.0 glib-2.0-native"