From 3fc1a7abc7750529b36d7258ddb4cb80b9c0adcb Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 30 Sep 2016 14:33:14 +0200 Subject: [PATCH] allow build with mdds 1.2 (and possible future versions) --- 0001-Allow-building-with-mdds-1.2.patch | 82 +++++++++++++++++++ ...ake-the-mdds-test-forward-compatible.patch | 38 +++++++++ libetonyek.spec | 26 +++--- 3 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 0001-Allow-building-with-mdds-1.2.patch create mode 100644 0001-make-the-mdds-test-forward-compatible.patch diff --git a/0001-Allow-building-with-mdds-1.2.patch b/0001-Allow-building-with-mdds-1.2.patch new file mode 100644 index 0000000..645eeb5 --- /dev/null +++ b/0001-Allow-building-with-mdds-1.2.patch @@ -0,0 +1,82 @@ +From f6d14b3b510de5c50e45c98fe812a73ba00f3def Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= +Date: Thu, 9 Jun 2016 10:50:41 +0200 +Subject: [PATCH] Allow building with mdds-1.2 + +Change-Id: If8791b4c1c3fbefdd06af345276e0a724dff5482 +--- + configure.ac | 44 +++++++++++++++++++++++--------------------- + 1 file changed, 23 insertions(+), 21 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ca4bb07..bb946eb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -24,7 +24,7 @@ AC_LANG([C++]) + # Configure options + # ================= + AC_ARG_WITH([mdds], +- AS_HELP_STRING([--with-mdds=1.0|0.x], [Specify which version of mdds to use (1.0 is the default)]), ++ AS_HELP_STRING([--with-mdds=1.2|1.0|0.x], [Specify which version of mdds to use (1.0 is the default)]), + [], [with_mdds="1.0"]) + + # =========================== +@@ -47,7 +47,7 @@ AC_PROG_SED + + AM_MISSING_PROG([GPERF], [gperf]) + +-AS_IF([test "$with_mdds" = "1.0"], [AX_CXX_COMPILE_STDCXX_11([noext])]) ++AS_IF([test "$with_mdds" = "1.0" -o "$with_mdds" = "1.2" ], [AX_CXX_COMPILE_STDCXX_11([noext])]) + + # =============== + # Find librevenge +@@ -138,25 +138,27 @@ AC_SUBST([GLM_CFLAGS]) + # ========= + # Find mdds + # ========= +-AS_IF([test "$with_mdds" = "1.0"], [ +- PKG_CHECK_MODULES([MDDS], [mdds-1.0]) +-], [ +- PKG_CHECK_MODULES([MDDS], [mdds]) +- AC_MSG_CHECKING([checking if mdds::flat_segment_tree can store values of any type]) +- old_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$MDDS_CFLAGS $CPPFLAGS" +- AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +- #include +- struct Value {}; +- mdds::flat_segment_tree tree(0, 4, Value()); +- ])], [ +- AC_MSG_RESULT([yes]) +- ], [ +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([please install mdds >= 0.12.1]) +- ]) +- CPPFLAGS="$old_CPPFLAGS" +-]) ++AS_CASE(["$with_mdds"], ++ ["1.2"], [PKG_CHECK_MODULES([MDDS], [mdds-1.2])], ++ ["1.0"], [PKG_CHECK_MODULES([MDDS], [mdds-1.0])], ++ [ ++ PKG_CHECK_MODULES([MDDS], [mdds]) ++ AC_MSG_CHECKING([checking if mdds::flat_segment_tree can store values of any type]) ++ old_CPPFLAGS="$CPPFLAGS" ++ CPPFLAGS="$MDDS_CFLAGS $CPPFLAGS" ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ++ #include ++ struct Value {}; ++ mdds::flat_segment_tree tree(0, 4, Value()); ++ ])], [ ++ AC_MSG_RESULT([yes]) ++ ], [ ++ AC_MSG_RESULT([no]) ++ AC_MSG_ERROR([please install mdds >= 0.12.1]) ++ ]) ++ CPPFLAGS="$old_CPPFLAGS" ++ ] ++) + + # ================================= + # Libtool/Version Makefile settings +-- +2.9.3 + diff --git a/0001-make-the-mdds-test-forward-compatible.patch b/0001-make-the-mdds-test-forward-compatible.patch new file mode 100644 index 0000000..a0f11ef --- /dev/null +++ b/0001-make-the-mdds-test-forward-compatible.patch @@ -0,0 +1,38 @@ +From 71ccd90029745e33eb62384e90069a77f5a69730 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Fri, 30 Sep 2016 10:40:03 +0200 +Subject: [PATCH] make the mdds test forward-compatible + +Change-Id: I8111097cbd51b5c875a9510ad26a2a0a7b8c90e8 +--- + configure.ac | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index bb946eb..39dd7fb 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -47,7 +47,7 @@ AC_PROG_SED + + AM_MISSING_PROG([GPERF], [gperf]) + +-AS_IF([test "$with_mdds" = "1.0" -o "$with_mdds" = "1.2" ], [AX_CXX_COMPILE_STDCXX_11([noext])]) ++AS_IF([test "$with_mdds" != "0.x"], [AX_CXX_COMPILE_STDCXX_11([noext])]) + + # =============== + # Find librevenge +@@ -138,9 +138,8 @@ AC_SUBST([GLM_CFLAGS]) + # ========= + # Find mdds + # ========= +-AS_CASE(["$with_mdds"], +- ["1.2"], [PKG_CHECK_MODULES([MDDS], [mdds-1.2])], +- ["1.0"], [PKG_CHECK_MODULES([MDDS], [mdds-1.0])], ++AS_IF([test "$with_mdds" != "0.x"], ++ [PKG_CHECK_MODULES([MDDS], [mdds-][$with_mdds])], + [ + PKG_CHECK_MODULES([MDDS], [mdds]) + AC_MSG_CHECKING([checking if mdds::flat_segment_tree can store values of any type]) +-- +2.9.3 + diff --git a/libetonyek.spec b/libetonyek.spec index ead0318..5d6b73b 100644 --- a/libetonyek.spec +++ b/libetonyek.spec @@ -1,5 +1,11 @@ %global apiversion 0.1 +%if 0%{?fedora} >= 25 +%global mddsver 1.2 +%else if 0%{?fedora} >= 24 +%global mddsver 1.0 +%endif + Name: libetonyek Version: 0.1.6 Release: 4%{?dist} @@ -9,6 +15,7 @@ License: MPLv2.0 URL: http://wiki.documentfoundation.org/DLP/Libraries/libetonyek Source: http://dev-www.libreoffice.org/src/%{name}/%{name}-%{version}.tar.xz +BuildRequires: autoconf BuildRequires: boost-devel BuildRequires: doxygen BuildRequires: glm-devel @@ -18,13 +25,12 @@ BuildRequires: pkgconfig(cppunit) BuildRequires: pkgconfig(liblangtag) BuildRequires: pkgconfig(librevenge-0.0) BuildRequires: pkgconfig(libxml-2.0) -%if 0%{?fedora} >= 24 -BuildRequires: pkgconfig(mdds-1.0) -%else -BuildRequires: pkgconfig(mdds) -%endif +BuildRequires: pkgconfig(mdds%{?mddsver:-%{mddsver}}) BuildRequires: pkgconfig(zlib) +Patch0: 0001-Allow-building-with-mdds-1.2.patch +Patch1: 0001-make-the-mdds-test-forward-compatible.patch + %description %{name} is library for import of documents from Apple iWork applications (Keynote, Pages and Numbers). It can import documents created by @@ -58,13 +64,9 @@ supported: CSV, HTML, SVG, text, and raw. %autosetup -p1 %build -%if 0%{?fedora} >= 24 -%global distrooptions %{nil} -%else -%global distrooptions --with-mdds=0.x -%endif - -%configure --disable-silent-rules --disable-static --disable-werror %{distrooptions} +autoconf +%configure --disable-silent-rules --disable-static --disable-werror \ + --with-mdds=%{?mddsver:%{mddsver}}%{!?mddsver:0.x} sed -i \ -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \