From 54613409907e8764cdf1c96f9fd390941b2eaee1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Dec 2019 13:08:22 +0000 Subject: [PATCH] Add workaround for some const casting badness in the OCaml bindings. --- graphviz-2.42.2-ocaml-allow-const-cast.patch | 15 +++++++++++++++ graphviz.spec | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 graphviz-2.42.2-ocaml-allow-const-cast.patch diff --git a/graphviz-2.42.2-ocaml-allow-const-cast.patch b/graphviz-2.42.2-ocaml-allow-const-cast.patch new file mode 100644 index 0000000..31af6da --- /dev/null +++ b/graphviz-2.42.2-ocaml-allow-const-cast.patch @@ -0,0 +1,15 @@ +--- graphviz-stable_release_2.42.2/tclpkg/gv/Makefile.am 2019-09-12 03:11:30.000000000 +0100 ++++ graphviz-stable_release_2.42.2.new/tclpkg/gv/Makefile.am 2019-12-06 13:05:44.064150008 +0000 +@@ -130,7 +130,11 @@ + libgv_ocaml_la_SOURCES = $(BASESOURCES) gv_dummy_init.c + libgv_ocaml_la_LIBADD = $(BASELIBS) $(OCAML_LIBS) + libgv_ocaml_la_LDFLAGS = -module -avoid-version +-libgv_ocaml_la_CPPFLAGS = $(BASECPPFLAGS) $(OCAML_INCLUDES) -Dint64=int64_t ++libgv_ocaml_la_CPPFLAGS = \ ++ $(BASECPPFLAGS) \ ++ $(OCAML_INCLUDES) \ ++ -Dint64=int64_t \ ++ -fpermissive + gv.ml gv.mli: gv_ocaml.cpp + gv_ocaml.cpp: gv.i + $(SWIG) -c++ -ocaml -o gv_ocaml.cpp $(srcdir)/gv.i diff --git a/graphviz.spec b/graphviz.spec index 3579163..3f6beec 100644 --- a/graphviz.spec +++ b/graphviz.spec @@ -73,6 +73,9 @@ Source0: https://gitlab.com/%{name}/%{name}/-/archive/stable_release_%{version} # rhbz#1505230 Patch0: graphviz-2.42.2-dotty-menu-fix.patch Patch1: graphviz-2.42.2-coverity-scan-fixes.patch +# Workaround for some const casting badness in the OCaml bindings. +# Real fix will need a fix to SWIG. +Patch2: graphviz-2.42.2-ocaml-allow-const-cast.patch BuildRequires: zlib-devel, libpng-devel, libjpeg-devel, expat-devel, freetype-devel >= 2 BuildRequires: ksh, bison, m4, flex, tk-devel, tcl-devel >= 8.3, swig, sed BuildRequires: fontconfig-devel, libtool-ltdl-devel, ruby-devel, ruby, guile-devel @@ -286,6 +289,7 @@ Various tcl packages (extensions) for the graphviz tools. %setup -q -n graphviz-stable_release_%{version} %patch0 -p1 -b .dotty-menu-fix %patch1 -p1 -b .coverity-scan-fixes +%patch2 -p1 # Attempt to fix rpmlint warnings about executable sources find -type f -regex '.*\.\(c\|h\)$' -exec chmod a-x {} ';'