From d681c471940cecdd0bf366933ee931f123e4c62c Mon Sep 17 00:00:00 2001 From: chengzihan2 Date: Tue, 22 Sep 2020 14:11:24 +0800 Subject: [PATCH] Fix build failure --- Boolean-#define-s-removed-frome-json-c.patch | 37 ++++++++++++++++++++ Support-pngmath-replacement.patch | 30 ++++++++++++++++ libmypaint.spec | 8 ++++- 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 Boolean-#define-s-removed-frome-json-c.patch create mode 100644 Support-pngmath-replacement.patch diff --git a/Boolean-#define-s-removed-frome-json-c.patch b/Boolean-#define-s-removed-frome-json-c.patch new file mode 100644 index 0000000..7163ebf --- /dev/null +++ b/Boolean-#define-s-removed-frome-json-c.patch @@ -0,0 +1,37 @@ +From a2b3f56b347c1897454eac1b5bdfe9d228302b80 Mon Sep 17 00:00:00 2001 +From: Jehan +Date: Sat, 26 Jan 2019 12:50:31 +0100 +Subject: [PATCH] Boolean #define-s removed from json-c in 2017. + +We don't need to #undef TRUE and FALSE before including json.h as this +redefinition has been removed in upstream json-c. +See json-c commit 0992aac61f8b087efd7094e9ac2b84fa9c040fcd. + +Note that it still works even if using an older json-c since the +original code was alreadying #undef-ing these 2 values before redefining +them. So that was anyway useless code and this change should work both +with old or new json-c. + +Note: the previous code was still working fine when building on Linux, +but not when cross-compiling on Windows. But this is the correct fix +anyway. + +(cherry picked from commit f4fd97445d3b6843af57ff8ba5f02cbdeb3942e9) +--- + mypaint-brush.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/mypaint-brush.c b/mypaint-brush.c +index 4759d11b..7a1380c7 100644 +--- a/mypaint-brush.c ++++ b/mypaint-brush.c +@@ -35,9 +35,6 @@ + #include "rng-double.h" + + #ifdef HAVE_JSON_C +-// Allow the C99 define from json.h +-#undef TRUE +-#undef FALSE + #include + #endif // HAVE_JSON_C + diff --git a/Support-pngmath-replacement.patch b/Support-pngmath-replacement.patch new file mode 100644 index 0000000..cd36613 --- /dev/null +++ b/Support-pngmath-replacement.patch @@ -0,0 +1,30 @@ +From 22836df9bff5e5ad5d2c3e1b997cbf81b1c86466 Mon Sep 17 00:00:00 2001 +From: Jesper Lloyd +Date: Mon, 10 Feb 2020 07:10:14 +0100 +Subject: [PATCH] docs: Support pngmath replacement (sphinx >= 1.8) + +The pngmath module was removed in favor of the imgmath module in 1.8 +Thanks to avsej for drawing attention to this. +--- + doc/source/conf.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/doc/source/conf.py b/doc/source/conf.py +index 0ae986de..8d076508 100644 +--- a/doc/source/conf.py ++++ b/doc/source/conf.py +@@ -27,7 +27,13 @@ + + # Add any Sphinx extension module names here, as strings. They can be extensions + # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] ++extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] ++ ++try: ++ import sphinx.ext.pngmath ++ extensions.append('sphinx.ext.pngmath') ++except ImportError: ++ extensions.append('sphinx.ext.imgmath') + + # Breathe setup, for integrating doxygen content + extensions.append('breathe') diff --git a/libmypaint.spec b/libmypaint.spec index c56b22d..cad6266 100644 --- a/libmypaint.spec +++ b/libmypaint.spec @@ -1,11 +1,13 @@ Name: libmypaint Version: 1.3.0 -Release: 10 +Release: 11 Summary: Rush library used by MyPaint License: ISC URL: https://github.com/mypaint/libmypaint Source0: https://github.com/mypaint/libmypaint/releases/download/v%{version}/libmypaint-%{version}.tar.xz Patch0: libmypaint-1.3.0-gegl04.patch +Patch1: Boolean-#define-s-removed-frome-json-c.patch +Patch2: Support-pngmath-replacement.patch BuildRequires: babl-devel, breathe, doxygen, gegl04-devel, glib2-devel, gobject-introspection-devel BuildRequires: intltool, json-c-devel, python-sphinx @@ -52,6 +54,10 @@ find $RPM_BUILD_ROOT%{_libdir} -name '*.la' -delete -print %{_datadir}/gir-1.0/MyPaint*-1.3.gir %changelog +* Tue Sep 22 2020 chengzihan - 1.3.0-11 +- Remove #undef TRUE and FALSE before including json.h +- Replace pngmath module with imgmath module + * Fri Dec 13 2019 openEuler Buildteam - 1.3.0-10 - Package init