external/zxing/0001-TextEncoder-add-missing-include-Version.h.patch |   30 
++++++++++
 external/zxing/0001-add-ZXVersion-h.patch                           |   12 +++-
 external/zxing/StaticLibrary_zxing.mk                               |    2 
 external/zxing/UnpackedTarball_zxing.mk                             |    1 
 4 files changed, 41 insertions(+), 4 deletions(-)

New commits:
commit fad04176030657be8b678344d7a849f369b92d70
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Mar 3 13:43:41 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Mar 3 22:24:19 2026 +0100

    zxing: define ZXING_WRITERS and ZXING_USE_ZINT from Version.h
    
    Change-Id: Ia1d86103457e1bf8ad2bf328bff1e539d7ce556b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200886
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git 
a/external/zxing/0001-TextEncoder-add-missing-include-Version.h.patch 
b/external/zxing/0001-TextEncoder-add-missing-include-Version.h.patch
new file mode 100644
index 000000000000..4af4a326e4b0
--- /dev/null
+++ b/external/zxing/0001-TextEncoder-add-missing-include-Version.h.patch
@@ -0,0 +1,30 @@
+From 475a022e0c85edfc58b525bb7debe40df455b380 Mon Sep 17 00:00:00 2001
+From: axxel <[email protected]>
+Date: Tue, 3 Mar 2026 13:23:16 +0100
+Subject: [PATCH] TextEncoder: add missing #include "Version.h"
+
+Fails to compile with -DZXING_READERS=OFF -DZXING_WRITERS=NEW and without
+precompiled headers.
+
+Thanks to @x1sc0 for reporting this (showed up in LibreOffice's own build
+system).
+---
+ core/src/TextEncoder.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/core/src/TextEncoder.cpp b/core/src/TextEncoder.cpp
+index 06dc524d..afcaef85 100644
+--- a/core/src/TextEncoder.cpp
++++ b/core/src/TextEncoder.cpp
+@@ -9,6 +9,8 @@
+ #include "ECI.h"
+ #include "Utf.h"
+ #include "ZXAlgorithms.h"
++#include "Version.h"
++
+ #ifdef ZXING_USE_ZINT
+ #include <zint.h>
+ #else
+-- 
+2.39.5
+
diff --git a/external/zxing/0001-add-ZXVersion-h.patch 
b/external/zxing/0001-add-ZXVersion-h.patch
index 73c0b2ddf17f..84c9b2e2fdb5 100644
--- a/external/zxing/0001-add-ZXVersion-h.patch
+++ b/external/zxing/0001-add-ZXVersion-h.patch
@@ -1,6 +1,9 @@
+# Generated with 'cmake -DZXING_READERS=OFF -DZXING_WRITERS=NEW'
+# Unused symbologies are disabled
+
 --- /dev/null  2023-12-10 14:00:18.140142051 +0100
 +++ a/core/src/Version.h       2023-12-22 21:38:22.466302568 +0100
-@@ -0,0 +1,22 @@
+@@ -0,0 +1,28 @@
 +/*
 +* Copyright 2019 Nu-book Inc.
 +* Copyright 2023 Axel Waggershauser
@@ -9,6 +12,9 @@
 +
 +#pragma once
 +
++/* #undef ZXING_READERS */
++#define ZXING_WRITERS
++
 +#define ZXING_ENABLE_1D 1
 +#define ZXING_ENABLE_AZTEC 0
 +#define ZXING_ENABLE_DATAMATRIX 0
@@ -16,6 +22,9 @@
 +#define ZXING_ENABLE_PDF417 0
 +#define ZXING_ENABLE_QRCODE 1
 +
++/* #undef ZXING_EXPERIMENTAL_API */
++#define ZXING_USE_ZINT
++
 +// Version numbering
 +#define ZXING_VERSION_MAJOR 3
 +#define ZXING_VERSION_MINOR 0
@@ -23,4 +32,3 @@
 +#define ZXING_VERSION_SUFFIX ""
 +
 +#define ZXING_VERSION_STR "3.0.2"
-
diff --git a/external/zxing/StaticLibrary_zxing.mk 
b/external/zxing/StaticLibrary_zxing.mk
index b1c218acba51..6f7ffa51a1ad 100644
--- a/external/zxing/StaticLibrary_zxing.mk
+++ b/external/zxing/StaticLibrary_zxing.mk
@@ -27,8 +27,6 @@ $(eval $(call gb_StaticLibrary_set_include,zxing,\
 
 $(eval $(call gb_StaticLibrary_add_cxxflags,zxing,\
        -DZXING_INTERNAL \
-       -DZXING_USE_ZINT \
-       -DZXING_WRITERS \
 ))
 
 $(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\
diff --git a/external/zxing/UnpackedTarball_zxing.mk 
b/external/zxing/UnpackedTarball_zxing.mk
index 6a30860ddd50..0917df80f142 100644
--- a/external/zxing/UnpackedTarball_zxing.mk
+++ b/external/zxing/UnpackedTarball_zxing.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,zxing, \
        external/zxing/cassert.patch \
        
external/zxing/0001-Silence-deprecated-declarations-warnings-on-Windows-.patch \
        external/zxing/macOS14.patch \
+       external/zxing/0001-TextEncoder-add-missing-include-Version.h.patch \
 ))
 
 # vim: set noet sw=4 ts=4:

Reply via email to