void-packages/srcpkgs/libreoffice/patches/008-zxing.patch

97 lines
3.4 KiB
Diff

Upstream: maybe
Description: we should always check for full path
(i.e. ZXing/MultiFormatWriter), however those file hierarchy is made
by installation step, thus libreoffice must use the non-prefix.
Perhap we should changes the file hierarchy of zxing-cpp project instead?
--- a/configure.ac
+++ b/configure.ac
@@ -11483,35 +11483,16 @@ else
SYSTEM_ZXING=TRUE
ZXING_CFLAGS=
AC_LANG_PUSH([C++])
- save_CXXFLAGS=$CXXFLAGS
- save_IFS=$IFS
- IFS=$P_SEP
- for i in $CPLUS_INCLUDE_PATH /usr/include; do
- dnl Reset IFS as soon as possible, to avoid unexpected side effects (and the
- dnl "/usr/include" fallback makes sure we get here at least once; resetting rather than
- dnl unsetting follows the advice at <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;
- dnl a=commitdiff;h=e51c9919f2cf70185b7916ac040bc0bbfd0f743b> "Add recommendation on (not)
- dnl unsetting IFS."):
- IFS=$save_IFS
- dnl TODO: GCC and Clang treat empty paths in CPLUS_INCLUDE_PATH like ".", but we simply
- dnl ignore them here:
- if test -z "$i"; then
- continue
- fi
- dnl TODO: White space in $i would cause problems:
- CXXFLAGS="$save_CXXFLAGS ${CXXFLAGS_CXX11} -I$i/ZXing"
- AC_CHECK_HEADER(MultiFormatWriter.h, [ZXING_CFLAGS=-I$i/ZXing; break],
- [unset ac_cv_header_MultiFormatWriter_h], [#include <stdexcept>])
- done
- CXXFLAGS=$save_CXXFLAGS
- if test -z "$ZXING_CFLAGS"; then
+ AC_CHECK_HEADER([ZXing/MultiFormatWriter.h],[],[
AC_MSG_ERROR(zxing headers not found.)
- fi
+ ], [
+ AC_INCLUDES_DEFAULT
+ #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
@@ -11528,8 +11509,8 @@ else
save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 $ZXING_CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- #include <BitMatrix.h>
- #include <BitMatrixIO.h>
+ #include <ZXing/BitMatrix.h>
+ #include <ZXing/BitMatrixIO.h>
int main(){
ZXing::BitMatrix matrix(1, 1);
matrix.set(0, 0, true);
--- a/cui/source/dialogs/QrCodeGenDialog.cxx
+++ b/cui/source/dialogs/QrCodeGenDialog.cxx
@@ -19,7 +19,7 @@
#include <vcl/svapp.hxx>
#if ENABLE_ZXING
-#include <ZXVersion.h>
+#include <ZXing/ZXVersion.h>
#include <rtl/strbuf.hxx>
#ifdef __GNUC__
@@ -27,20 +27,20 @@
#pragma GCC diagnostic ignored "-Wshadow"
#endif
-#include <BarcodeFormat.h>
-#include <BitMatrix.h>
-#include <MultiFormatWriter.h>
+#include <ZXing/BarcodeFormat.h>
+#include <ZXing/BitMatrix.h>
+#include <ZXing/MultiFormatWriter.h>
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#if HAVE_ZXING_TOSVG
-#include <BitMatrixIO.h>
+#include <ZXing/BitMatrixIO.h>
#endif
#if ZXING_VERSION_MAJOR < 2
-#include <TextUtfEncoding.h>
+#include <ZXing/TextUtfEncoding.h>
#endif
#endif // ENABLE_ZXING