tdf#139778 bundle external:zxing lib

Change-Id: I0023f6ce8315427b1a3deaf755e78ae06475b08c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112053
Reviewed-by: René Engelhard <rene@debian.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: René Engelhard <rene@debian.org>
Tested-by: Jenkins
This commit is contained in:
homeboy445 2021-03-06 14:21:25 +05:30 committed by Mike Kaganski
parent 05b62fa08b
commit f72cd65eef
12 changed files with 316 additions and 1 deletions

View file

@ -171,6 +171,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,MARIADB_CONNECTOR_C,MARIADB_CONNECTOR_C_TARBALL) \
$(call fetch_Optional,MDDS,MDDS_TARBALL) \
$(call fetch_Optional,QRCODEGEN,QRCODEGEN_TARBALL) \
$(call fetch_Optional,ZXING,ZXING_TARBALL) \
$(call fetch_Optional,MDNSRESPONDER,MDNSRESPONDER_TARBALL) \
$(call fetch_Optional,MORE_FONTS,FONT_CALADEA_TARBALL) \
$(call fetch_Optional,MORE_FONTS,FONT_CARLITO_TARBALL) \

View file

@ -4283,4 +4283,48 @@ endef
endif # SYSTEM_BOX2D
ifneq ($(SYSTEM_ZXING),)
define gb_LinkTarget__use_zxing
$(call gb_LinkTarget_set_include,$(1),\
-DSYSTEM_ZXING \
$$(INCLUDE) \
$(ZXING_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(ZXING_LIBS))
endef
gb_ExternalProject__use_zxing :=
else # !SYSTEM_ZXING
ifneq ($(ENABLE_ZXING),)
define gb_LinkTarget__use_zxing
$(call gb_LinkTarget_use_unpacked,$(1),zxing)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,zxing/core/src/)\
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
zxing \
)
endef
define gb_ExternalProject__use_zxing
$(call gb_ExternalProject_use_static_libraries,$(1),zxing)
endef
else # !ENABLE_ZXING
define gb_LinkTarget__use_zxing
endef
endif # ENABLE_ZXING
endif # SYSTEM_ZXING
# vim: set noet sw=4 ts=4:

View file

@ -503,6 +503,9 @@ export PYTHONWARNINGS=@PYTHONWARNINGS@
export ENABLE_QRCODEGEN=@ENABLE_QRCODEGEN@
export QRCODEGEN_CFLAGS=$(gb_SPACE)@QRCODEGEN_CFLAGS@
export QRCODEGEN_LIBS=$(gb_SPACE)@QRCODEGEN_LIBS@
export ENABLE_ZXING=@ENABLE_ZXING@
export ZXING_CFLAGS=$(gb_SPACE)@ZXING_CFLAGS@
export ZXING_LIBS=$(gb_SPACE)@ZXING_LIBS@
export QT5_CFLAGS=$(gb_SPACE)@QT5_CFLAGS@
export QT5_LIBS=$(gb_SPACE)@QT5_LIBS@
export QT5_GOBJECT_CFLAGS=$(gb_SPACE)@QT5_GOBJECT_CFLAGS@
@ -611,6 +614,7 @@ export SYSTEM_POPPLER=@SYSTEM_POPPLER@
export SYSTEM_POSTGRESQL=@SYSTEM_POSTGRESQL@
export SYSTEM_PYTHON=@SYSTEM_PYTHON@
export SYSTEM_QRCODEGEN=@SYSTEM_QRCODEGEN@
export SYSTEM_ZXING=@SYSTEM_ZXING@
export SYSTEM_QXP=@SYSTEM_QXP@
export SYSTEM_REDLAND=@SYSTEM_REDLAND@
export SYSTEM_REVENGE=@SYSTEM_REVENGE@

View file

@ -0,0 +1,17 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_CONFIG_ZXING_H
#define INCLUDED_CONFIG_ZXING_H
#define ENABLE_ZXING 0
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -2242,11 +2242,20 @@ libo_FUZZ_ARG_ENABLE(qrcodegen,
AS_HELP_STRING([--disable-qrcodegen],
[Disable use of qrcodegen external library.]))
libo_FUZZ_ARG_ENABLE(zxing,
AS_HELP_STRING([--disable-zxing],
[Disable use of zxing external library.]))
AC_ARG_WITH(system-qrcodegen,
AS_HELP_STRING([--with-system-qrcodegen],
[Use libqrcodegen already on system.]),,
[with_system_qrcodegen="$with_system_libs"])
AC_ARG_WITH(system-zxing,
AS_HELP_STRING([--with-system-zxing],
[Use libzxing already on system.]),,
[with_system_zxing="$with_system_libs"])
AC_ARG_WITH(system-box2d,
AS_HELP_STRING([--with-system-box2d],
[Use box2d already on system.]),,
@ -10833,6 +10842,45 @@ AC_SUBST(ENABLE_QRCODEGEN)
AC_SUBST(QRCODEGEN_CFLAGS)
AC_SUBST(QRCODEGEN_LIBS)
dnl ===================================================================
dnl Check for system zxing
dnl ===================================================================
AC_MSG_CHECKING([whether to use zxing])
if test "$enable_zxing" = "no"; then
AC_MSG_RESULT([no])
ENABLE_ZXING=
SYSTEM_ZXING=
else
AC_MSG_RESULT([yes])
ENABLE_ZXING=TRUE
AC_MSG_CHECKING([which libzxing to use])
if test "$with_system_zxing" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_ZXING=TRUE
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(ZXing/MultiFormatWriter.h, [],
[AC_MSG_ERROR(zxing headers not found.)], [#include <stdexcept>])
AC_CHECK_LIB([ZXing], [main], [ZXING_LIBS=-lZXing],
[ AC_CHECK_LIB([ZXingCore], [main], [ZXING_LIBS=-lZXingCore],
[ AC_MSG_ERROR(zxing C++ library not found.) ])], [])
AC_LANG_POP([C++])
ZXING_CFLAGS=$(printf '%s' "$ZXING_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${ZXING_LIBS}"
ZXING_LIBS="${filteredlibs}"
else
AC_MSG_RESULT([internal])
SYSTEM_ZXING=
BUILD_TYPE="$BUILD_TYPE ZXING"
fi
if test "$ENABLE_ZXING" = TRUE; then
AC_DEFINE(ENABLE_ZXING)
fi
fi
AC_SUBST(SYSTEM_ZXING)
AC_SUBST(ENABLE_ZXING)
AC_SUBST(ZXING_CFLAGS)
AC_SUBST(ZXING_LIBS)
dnl ===================================================================
dnl Check for system box2d
dnl ===================================================================
@ -14088,6 +14136,7 @@ AC_CONFIG_HEADERS([config_host/config_oox.h])
AC_CONFIG_HEADERS([config_host/config_options.h])
AC_CONFIG_HEADERS([config_host/config_options_calc.h])
AC_CONFIG_HEADERS([config_host/config_qrcodegen.h])
AC_CONFIG_HEADERS([config_host/config_zxing.h])
AC_CONFIG_HEADERS([config_host/config_skia.h])
AC_CONFIG_HEADERS([config_host/config_typesizes.h])
AC_CONFIG_HEADERS([config_host/config_vendor.h])

View file

@ -269,6 +269,7 @@ export ZLIB_SHA256SUM := 4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a211
export ZLIB_TARBALL := zlib-1.2.11.tar.xz
export ZMF_SHA256SUM := 27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22
export ZMF_TARBALL := libzmf-0.0.2.tar.xz
export ZXING_SHA256SUM := e595b3fa2ec320beb0b28f6af56b1141853257c2611686685639cebb3b248c86
export ZXING_TARBALL := zxing-cpp-1.1.1.tar.gz
NUMBERTEXT_EXTENSION_SHA256SUM := 1568ed1d2feb8210bb5de61d69574a165cded536cfa17c6953c9064076469de2
OPENSYMBOL_SHA256SUM := f543e6e2d7275557a839a164941c0a86e5f2c3f2a0042bfc434c88c6dde9e140

View file

@ -91,6 +91,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,PYTHON,python3) \
$(call gb_Helper_optional,QXP,libqxp) \
$(call gb_Helper_optional,QRCODEGEN,qrcodegen) \
$(call gb_Helper_optional,ZXING,zxing) \
$(call gb_Helper_optional,REDLAND,redland) \
$(call gb_Helper_optional,REVENGE,librevenge) \
$(call gb_Helper_optional,RHINO,rhino) \

7
external/zxing/Makefile vendored Normal file
View file

@ -0,0 +1,7 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:

20
external/zxing/Module_zxing.mk vendored Normal file
View file

@ -0,0 +1,20 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Module_Module,zxing))
$(eval $(call gb_Module_add_targets,zxing,\
UnpackedTarball_zxing \
))
$(eval $(call gb_Module_add_targets,zxing,\
StaticLibrary_zxing \
))
# vim: set noet sw=4 ts=4:

3
external/zxing/README vendored Normal file
View file

@ -0,0 +1,3 @@
Qr code generation library availaible from [https://github.com/nu-book/zxing-cpp]
Qr code generator to make a QR code out of a provided link or text in LibreOffice.

149
external/zxing/StaticLibrary_zxing.mk vendored Normal file
View file

@ -0,0 +1,149 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_StaticLibrary_StaticLibrary,zxing))
$(eval $(call gb_StaticLibrary_use_unpacked,zxing,zxing))
$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,zxing,cpp))
$(eval $(call gb_StaticLibrary_use_external,zxing,icu_headers))
$(eval $(call gb_StaticLibrary_set_warnings_disabled,zxing))
$(eval $(call gb_StaticLibrary_set_include,zxing,\
-I$(call gb_UnpackedTarball_get_dir,zxing/core/src/) \
$$(INCLUDE) \
))
$(eval $(call gb_StaticLibrary_add_generated_exception_objects,zxing,\
UnpackedTarball/zxing/core/src/aztec/AZReader \
UnpackedTarball/zxing/core/src/aztec/AZToken \
UnpackedTarball/zxing/core/src/aztec/AZEncoder \
UnpackedTarball/zxing/core/src/aztec/AZDecoder \
UnpackedTarball/zxing/core/src/aztec/AZDetector \
UnpackedTarball/zxing/core/src/aztec/AZHighLevelEncoder \
UnpackedTarball/zxing/core/src/aztec/AZWriter \
UnpackedTarball/zxing/core/src/BarcodeFormat \
UnpackedTarball/zxing/core/src/BitArray \
UnpackedTarball/zxing/core/src/BitMatrixIO \
UnpackedTarball/zxing/core/src/BitMatrix \
UnpackedTarball/zxing/core/src/BitSource \
UnpackedTarball/zxing/core/src/textcodec/Big5TextDecoder \
UnpackedTarball/zxing/core/src/textcodec/Big5TextEncoder \
UnpackedTarball/zxing/core/src/textcodec/Big5MapTable \
UnpackedTarball/zxing/core/src/CharacterSetECI \
UnpackedTarball/zxing/core/src/DecodeHints \
UnpackedTarball/zxing/core/src/DecodeStatus \
UnpackedTarball/zxing/core/src/datamatrix/DMWriter \
UnpackedTarball/zxing/core/src/datamatrix/DMDefaultPlacement \
UnpackedTarball/zxing/core/src/datamatrix/DMDetector \
UnpackedTarball/zxing/core/src/datamatrix/DMVersion \
UnpackedTarball/zxing/core/src/datamatrix/DMSymbolInfo \
UnpackedTarball/zxing/core/src/datamatrix/DMDecoder \
UnpackedTarball/zxing/core/src/datamatrix/DMBitMatrixParser \
UnpackedTarball/zxing/core/src/datamatrix/DMReader \
UnpackedTarball/zxing/core/src/datamatrix/DMDataBlock \
UnpackedTarball/zxing/core/src/datamatrix/DMECEncoder \
UnpackedTarball/zxing/core/src/datamatrix/DMHighLevelEncoder \
UnpackedTarball/zxing/core/src/GlobalHistogramBinarizer \
UnpackedTarball/zxing/core/src/GenericGF \
UnpackedTarball/zxing/core/src/GridSampler \
UnpackedTarball/zxing/core/src/GenericLuminanceSource \
UnpackedTarball/zxing/core/src/GenericGFPoly \
UnpackedTarball/zxing/core/src/textcodec/GBTextEncoder \
UnpackedTarball/zxing/core/src/textcodec/GBTextDecoder \
UnpackedTarball/zxing/core/src/HybridBinarizer \
UnpackedTarball/zxing/core/src/textcodec/JPTextEncoder \
UnpackedTarball/zxing/core/src/textcodec/JPTextDecoder \
UnpackedTarball/zxing/core/src/textcodec/KRHangulMapping \
UnpackedTarball/zxing/core/src/textcodec/KRTextEncoder \
UnpackedTarball/zxing/core/src/textcodec/KRTextDecoder \
UnpackedTarball/zxing/core/src/LuminanceSource \
UnpackedTarball/zxing/core/src/MultiFormatWriter \
UnpackedTarball/zxing/core/src/MultiFormatReader \
UnpackedTarball/zxing/core/src/maxicode/MCDecoder \
UnpackedTarball/zxing/core/src/maxicode/MCBitMatrixParser \
UnpackedTarball/zxing/core/src/maxicode/MCReader \
UnpackedTarball/zxing/core/src/oned/ODUPCEANExtensionSupport \
UnpackedTarball/zxing/core/src/oned/ODUPCEWriter \
UnpackedTarball/zxing/core/src/oned/ODEAN8Writer \
UnpackedTarball/zxing/core/src/oned/ODWriterHelper \
UnpackedTarball/zxing/core/src/oned/ODITFWriter \
UnpackedTarball/zxing/core/src/oned/ODITFReader \
UnpackedTarball/zxing/core/src/oned/ODCode39Reader \
UnpackedTarball/zxing/core/src/oned/ODRSSExpandedReader \
UnpackedTarball/zxing/core/src/oned/ODCode128Reader \
UnpackedTarball/zxing/core/src/oned/ODEAN13Writer \
UnpackedTarball/zxing/core/src/oned/ODEANManufacturerOrgSupport \
UnpackedTarball/zxing/core/src/oned/ODMultiUPCEANReader \
UnpackedTarball/zxing/core/src/oned/ODUPCEANReader \
UnpackedTarball/zxing/core/src/oned/ODCodabarWriter \
UnpackedTarball/zxing/core/src/oned/ODCode128Writer \
UnpackedTarball/zxing/core/src/oned/ODCode93Reader \
UnpackedTarball/zxing/core/src/oned/ODCodabarReader \
UnpackedTarball/zxing/core/src/oned/ODCode39Writer \
UnpackedTarball/zxing/core/src/oned/ODUPCEANCommon \
UnpackedTarball/zxing/core/src/oned/ODRowReader \
UnpackedTarball/zxing/core/src/oned/ODReader \
UnpackedTarball/zxing/core/src/oned/ODCode93Writer \
UnpackedTarball/zxing/core/src/oned/ODUPCEReader \
UnpackedTarball/zxing/core/src/oned/ODCode128Patterns \
UnpackedTarball/zxing/core/src/oned/ODEAN13Reader \
UnpackedTarball/zxing/core/src/oned/ODUPCAWriter \
UnpackedTarball/zxing/core/src/oned/ODRSS14Reader \
UnpackedTarball/zxing/core/src/oned/ODUPCAReader \
UnpackedTarball/zxing/core/src/oned/ODEAN8Reader \
UnpackedTarball/zxing/core/src/PerspectiveTransform \
UnpackedTarball/zxing/core/src/pdf417/PDFCodewordDecoder \
UnpackedTarball/zxing/core/src/pdf417/PDFHighLevelEncoder \
UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResultColumn \
UnpackedTarball/zxing/core/src/pdf417/PDFReader \
UnpackedTarball/zxing/core/src/pdf417/PDFBoundingBox \
UnpackedTarball/zxing/core/src/pdf417/PDFScanningDecoder \
UnpackedTarball/zxing/core/src/pdf417/PDFModulusGF \
UnpackedTarball/zxing/core/src/pdf417/PDFEncoder \
UnpackedTarball/zxing/core/src/pdf417/PDFDecodedBitStreamParser \
UnpackedTarball/zxing/core/src/pdf417/PDFWriter \
UnpackedTarball/zxing/core/src/pdf417/PDFDetectionResult \
UnpackedTarball/zxing/core/src/pdf417/PDFModulusPoly \
UnpackedTarball/zxing/core/src/pdf417/PDFDetector \
UnpackedTarball/zxing/core/src/pdf417/PDFBarcodeValue \
UnpackedTarball/zxing/core/src/qrcode/QRFinderPatternFinder \
UnpackedTarball/zxing/core/src/qrcode/QRDecoder \
UnpackedTarball/zxing/core/src/qrcode/QRReader \
UnpackedTarball/zxing/core/src/qrcode/QRErrorCorrectionLevel \
UnpackedTarball/zxing/core/src/qrcode/QRAlignmentPattern \
UnpackedTarball/zxing/core/src/qrcode/QRFormatInformation \
UnpackedTarball/zxing/core/src/qrcode/QREncoder \
UnpackedTarball/zxing/core/src/qrcode/QRFinderPattern \
UnpackedTarball/zxing/core/src/qrcode/QRMaskUtil \
UnpackedTarball/zxing/core/src/qrcode/QRWriter \
UnpackedTarball/zxing/core/src/qrcode/QRDataMask \
UnpackedTarball/zxing/core/src/qrcode/QRMatrixUtil \
UnpackedTarball/zxing/core/src/qrcode/QRDetector \
UnpackedTarball/zxing/core/src/qrcode/QRVersion \
UnpackedTarball/zxing/core/src/qrcode/QRCodecMode \
UnpackedTarball/zxing/core/src/qrcode/QRAlignmentPatternFinder \
UnpackedTarball/zxing/core/src/qrcode/QRDataBlock \
UnpackedTarball/zxing/core/src/qrcode/QRBitMatrixParser \
UnpackedTarball/zxing/core/src/Result \
UnpackedTarball/zxing/core/src/ReadBarcode \
UnpackedTarball/zxing/core/src/ResultPoint \
UnpackedTarball/zxing/core/src/ResultMetadata \
UnpackedTarball/zxing/core/src/ReedSolomonDecoder \
UnpackedTarball/zxing/core/src/ReedSolomonEncoder \
UnpackedTarball/zxing/core/src/TextDecoder \
UnpackedTarball/zxing/core/src/TextEncoder \
UnpackedTarball/zxing/core/src/TextUtfEncoding \
UnpackedTarball/zxing/core/src/WhiteRectDetector \
UnpackedTarball/zxing/core/src/ZXBigInteger \
))
# vim: set noet sw=4 ts=4:

19
external/zxing/UnpackedTarball_zxing.mk vendored Normal file
View file

@ -0,0 +1,19 @@
#-*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,zxing))
$(eval $(call gb_UnpackedTarball_set_tarball,zxing,$(ZXING_TARBALL)))
$(eval $(call gb_UnpackedTarball_set_patchlevel,zxing,1))
$(eval $(call gb_UnpackedTarball_add_patches,zxing, \
))
# vim: set noet sw=4 ts=4: