Skip to content

Commit

Permalink
bundle external: qrcodegen
Browse files Browse the repository at this point in the history
The bundle helps to generate QR code in LO.

Change-Id: Iaa9225a72d15806c929d30951cefd3f3fee8960e
Reviewed-on: https://gerrit.libreoffice.org/73302
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
  • Loading branch information
22shubh22 authored and Michael Stahl committed Jul 2, 2019
1 parent 5d22b9a commit b4141ca
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.fetch
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,LXML,LXML_TARBALL) \
$(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,MDNSRESPONDER,MDNSRESPONDER_TARBALL) \
$(call fetch_Optional,MORE_FONTS,FONT_CALADEA_TARBALL) \
$(call fetch_Optional,MORE_FONTS,FONT_CARLITO_TARBALL) \
Expand Down
34 changes: 34 additions & 0 deletions RepositoryExternal.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4156,6 +4156,40 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo,\
))
endif

ifneq ($(SYSTEM_QRCODEGEN),)

define gb_LinkTarget__use_qrcodegen
$(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \
$(QRCODEGEN_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(QRCODEGEN_LIBS))

endef

gb_ExternalProject__use_qrcodegen :=

else # !SYSTEM_QRCODEGEN

define gb_LinkTarget__use_qrcodegen
l$(call gb_LinkTarget_use_unpacked,$(1),qrcodegen)
$(call gb_LinkTarget_set_include,$(1),\
-I$(call gb_UnpackedTarball_get_dir,qrcodegen/cpp/)\
$$(INCLUDE) \
)
$(call gb_LinkTarget_use_static_libraries,$(1),\
qrcodegen \
)

endef

define gb_ExternalProject__use_qrcodegen
$(call gb_ExternalProject_use_static_libraries,$(1),qrcodegen)

endef

endif # SYSTEM_QRCODEGEN

$(eval $(call gb_Helper_register_packages_for_install,ucrt_binarytable,\
$(if $(UCRT_REDISTDIR),ucrt) \
))
Expand Down
3 changes: 3 additions & 0 deletions config_host.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ export PYTHON_LIBS=$(gb_SPACE)@PYTHON_LIBS@
export PYTHON_VERSION=@PYTHON_VERSION@
export PYTHON_VERSION_MAJOR=@PYTHON_VERSION_MAJOR@
export PYTHON_VERSION_MINOR=@PYTHON_VERSION_MINOR@
export QRCODEGEN_CFLAGS=$(gb_SPACE)@QRCODEGEN_CFLAGS@
export QRCODEGEN_LIBS=$(gb_SPACE)@QRCODEGEN_LIBS@
export QT5_CFLAGS=$(gb_SPACE)@QT5_CFLAGS@
export QT5_LIBS=$(gb_SPACE)@QT5_LIBS@
export QT5_GOBJECT_CFLAGS=$(gb_SPACE)@QT5_GOBJECT_CFLAGS@
Expand Down Expand Up @@ -569,6 +571,7 @@ export SYSTEM_PAGEMAKER=@SYSTEM_PAGEMAKER@
export SYSTEM_POPPLER=@SYSTEM_POPPLER@
export SYSTEM_POSTGRESQL=@SYSTEM_POSTGRESQL@
export SYSTEM_PYTHON=@SYSTEM_PYTHON@
export STSTEM_QRCODEGEN=@SYSTEM_QRCODEGEN@
export SYSTEM_QXP=@SYSTEM_QXP@
export SYSTEM_REDLAND=@SYSTEM_REDLAND@
export SYSTEM_REVENGE=@SYSTEM_REVENGE@
Expand Down
31 changes: 31 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1909,6 +1909,11 @@ AC_ARG_WITH(system-hunspell,
[Use libhunspell already on system.]),,
[with_system_hunspell="$with_system_libs"])

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-mythes,
AS_HELP_STRING([--with-system-mythes],
[Use mythes already on system.]),,
Expand Down Expand Up @@ -9821,6 +9826,32 @@ AC_SUBST(SYSTEM_HUNSPELL)
AC_SUBST(HUNSPELL_CFLAGS)
AC_SUBST(HUNSPELL_LIBS)

dnl ===================================================================
dnl Check for system qrcodegen
dnl ===================================================================
AC_MSG_CHECKING([which libqrcodegen to use])
if test "$with_system_qrcodegen" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_QRCODEGEN=TRUE
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(qrcodegen/QrCode.hpp, [],
[AC_MSG_ERROR(qrcodegen headers not found.)], [#include <stdexcept>])
AC_CHECK_LIB([qrcodegencpp], [main], [:],
[ AC_MSG_ERROR(qrcodegen C++ library not found.) ], [])
QRCODEGEN_LIBS=-lqrcodegencpp
AC_LANG_POP([C++])
QRCODEGEN_CFLAGS=$(printf '%s' "$QRCODEGEN_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${QRCODEGEN_LIBS}"
QRCODEGEN_LIBS="${filteredlibs}"
else
AC_MSG_RESULT([internal])
SYSTEM_QRCODEGEN=
BUILD_TYPE="$BUILD_TYPE QRCODEGEN"
fi
AC_SUBST(SYSTEM_QRCODEGEN)
AC_SUBST(QRCODEGEN_CFLAGS)
AC_SUBST(QRCODEGEN_LIBS)

dnl ===================================================================
dnl Checking for altlinuxhyph
dnl ===================================================================
Expand Down
2 changes: 2 additions & 0 deletions download.lst
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export POSTGRESQL_SHA256SUM := a754c02f7051c2f21e52f8669a421b50485afcde9a581674d
export POSTGRESQL_TARBALL := postgresql-9.2.24.tar.bz2
export PYTHON_SHA256SUM := 285892899bf4d5737fd08482aa6171c6b2564a45b9102dfacfb72826aebdc7dc
export PYTHON_TARBALL := Python-3.5.7.tar.xz
export QRCODEGEN_SHA256SUM := fcdf9fd69fde07ae4dca2351d84271a9de8093002f733b77c70f52f1630f6e4a
export QRCODEGEN_TARBALL := QR-Code-generator-1.4.0.tar.gz
export QXP_SHA256SUM := e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
export QXP_TARBALL := libqxp-0.0.2.tar.xz
export RAPTOR_SHA256SUM := ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed
Expand Down
1 change: 1 addition & 0 deletions external/Module_external.mk
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,POSTGRESQL,postgresql) \
$(call gb_Helper_optional,PYTHON,python3) \
$(call gb_Helper_optional,QXP,libqxp) \
$(call gb_Helper_optional,QRCODEGEN,qrcodegen) \
$(call gb_Helper_optional,REDLAND,redland) \
$(call gb_Helper_optional,REVENGE,librevenge) \
$(call gb_Helper_optional,RHINO,rhino) \
Expand Down
7 changes: 7 additions & 0 deletions external/qrcodegen/Makefile
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 0 deletions external/qrcodegen/Module_qrcodegen.mk
Original file line number Diff line number Diff line change
@@ -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,qrcodegen))

$(eval $(call gb_Module_add_targets,qrcodegen,\
UnpackedTarball_qrcodegen \
))

$(eval $(call gb_Module_add_targets,qrcodegen,\
StaticLibrary_qrcodegen \
))

# vim: set noet sw=4 ts=4:
3 changes: 3 additions & 0 deletions external/qrcodegen/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QR code generating library, available from [https://github.com/nayuki/QR-Code-generator/tree/master/cpp].

qrcodegenerator to make the QR code out of a link or text in libreoffice.
26 changes: 26 additions & 0 deletions external/qrcodegen/StaticLibrary_qrcodegen.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- 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,qrcodegen))

$(eval $(call gb_StaticLibrary_use_unpacked,qrcodegen,qrcodegen))

$(eval $(call gb_StaticLibrary_set_generated_cxx_suffix,qrcodegen,cpp))

$(eval $(call gb_StaticLibrary_use_external,qrcodegen,icu_headers))

$(eval $(call gb_StaticLibrary_set_warnings_disabled,qrcodegen))

$(eval $(call gb_StaticLibrary_add_generated_exception_objects,qrcodegen,\
UnpackedTarball/qrcodegen/cpp/BitBuffer \
UnpackedTarball/qrcodegen/cpp/QrCode \
UnpackedTarball/qrcodegen/cpp/QrSegment \
))

# vim: set noet sw=4 ts=4:
19 changes: 19 additions & 0 deletions external/qrcodegen/UnpackedTarball_qrcodegen.mk
Original file line number Diff line number Diff line change
@@ -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,qrcodegen))

$(eval $(call gb_UnpackedTarball_set_tarball,qrcodegen,$(QRCODEGEN_TARBALL)))

$(eval $(call gb_UnpackedTarball_set_patchlevel,qrcodegen,1))

$(eval $(call gb_UnpackedTarball_add_patches,qrcodegen, \
))

# vim: set noet sw=4 ts=4:
26 changes: 26 additions & 0 deletions readlicense_oo/license/license.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,32 @@
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</p>
</div>
<div class ="QRCODEGEN">
<h2>QR-Code-Generator</h2>
<p>The following software may be included in this product: QR Code Generator.</p>
<p>The libqrcodegen project code is covered by the MIT license:</p>
<blockquote>
<p> Copyright © 2019 Project Nayuki. (MIT License) [<a href="https://www.nayuki.io/page/qr-code-generator-library">https://www.nayuki.io/page/qr-code-generator-library</a>]</p>

<p>Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:</p>

<p>*The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.</p>

<p>*The Software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the Software or the use or other dealings in the
Software.</p>
</blockquote>
</div>
<h2>Random123: a Library of Counter-Based Random Number Generators</h2>
<p>The following software may be included in this product: Random123: a Library of Counter-Based Random Number
Generators. Use of any of this software is governed by the terms of the license below:</p>
Expand Down

0 comments on commit b4141ca

Please sign in to comment.