slackware-current/source/d/vala/disable-graphviz.patch
Patrick J Volkerding 44f92d940d Thu Nov 22 05:56:56 UTC 2018
a/kernel-generic-4.19.3-x86_64-1.txz:  Upgraded.
a/kernel-huge-4.19.3-x86_64-1.txz:  Upgraded.
a/kernel-modules-4.19.3-x86_64-1.txz:  Upgraded.
a/openssl-solibs-1.1.1a-x86_64-1.txz:  Upgraded.
a/sysvinit-scripts-2.1-noarch-21.txz:  Rebuilt.
  rc.S: Don't run rc.fuse - udev takes care of the FUSE module and filesystem.
  rc.S: Support replacing the /etc/mtab file with a symlink to /proc/mounts.
  rc.6: Show more information when unmounting filesystems at shutdown.
ap/ghostscript-9.26-x86_64-1.txz:  Upgraded.
ap/mariadb-10.3.11-x86_64-1.txz:  Upgraded.
  This update fixes bugs and security issues.
  For more information, see:
    https://mariadb.com/kb/en/library/mariadb-10311-release-notes/
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3282
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2016-9843
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3174
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3143
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3156
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3251
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3185
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3277
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3162
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3173
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3200
    https://cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2018-3284
  (* Security fix *)
d/cmake-3.13.0-x86_64-1.txz:  Upgraded.
d/git-2.19.2-x86_64-1.txz:  Upgraded.
d/kernel-headers-4.14.63-x86-1.txz:  Upgraded.
d/kernel-headers-4.19.3-x86-1.txz:  Upgraded.
d/vala-0.42.3-x86_64-1.txz:  Added.
k/kernel-source-4.19.3-noarch-1.txz:  Upgraded.
l/adwaita-icon-theme-3.30.0-noarch-1.txz:  Upgraded.
l/at-spi2-atk-2.30.0-x86_64-1.txz:  Upgraded.
l/at-spi2-core-2.30.0-x86_64-1.txz:  Upgraded.
l/atk-2.30.0-x86_64-1.txz:  Upgraded.
l/atkmm-2.28.0-x86_64-1.txz:  Upgraded.
l/dconf-0.28.0-x86_64-1.txz:  Upgraded.
  dconf and dconf-editor require Vala; the alternative would be to try to
  stick with the old versions forever, and we don't want to do that.
l/dconf-editor-3.30.2-x86_64-1.txz:  Upgraded.
l/gcr-3.28.0-x86_64-3.txz:  Rebuilt.
  Recompiled to add Vala bindings.
l/gdk-pixbuf2-2.38.0-x86_64-1.txz:  Upgraded.
l/gexiv2-0.10.9-x86_64-1.txz:  Upgraded.
l/glib-networking-2.58.0-x86_64-1.txz:  Upgraded.
l/glib2-2.58.1-x86_64-1.txz:  Upgraded.
l/glibmm-2.58.0-x86_64-1.txz:  Upgraded.
l/gobject-introspection-1.58.0-x86_64-1.txz:  Upgraded.
l/gtk+3-3.24.1-x86_64-1.txz:  Upgraded.
l/gtkmm3-3.24.0-x86_64-1.txz:  Upgraded.
l/gvfs-1.38.1-x86_64-1.txz:  Upgraded.
l/libcap-2.26-x86_64-1.txz:  Upgraded.
l/libpsl-0.20.1-x86_64-1.txz:  Added.
  Required by libsoup.
l/libsoup-2.64.2-x86_64-1.txz:  Upgraded.
l/pangomm-2.42.0-x86_64-1.txz:  Upgraded.
l/pygobject3-3.30.2-x86_64-1.txz:  Upgraded.
l/vte-0.54.2-x86_64-1.txz:  Upgraded.
n/openssl-1.1.1a-x86_64-1.txz:  Upgraded.
  This update fixes timing side channel attacks on DSA and ECDSA signature
  generation that could allow an attacker to recover the private key.
  For more information, see:
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0734
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0735
  (* Security fix *)
x/pixman-0.36.0-x86_64-1.txz:  Upgraded.
xfce/xfce4-terminal-0.8.7.4-x86_64-2.txz:  Rebuilt.
isolinux/initrd.img:  Rebuilt.
kernels/*:  Upgraded.
usb-and-pxe-installers/usbboot.img:  Rebuilt.
2018-11-22 17:59:46 +01:00

224 lines
6.6 KiB
Diff

From 57f6b661d7865e8cecd17be36fab68f7f8447998 Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Wed, 6 Sep 2017 18:52:55 +0200
Subject: [PATCH] libvaladoc: Allow disabling the graphviz dependency of
valadoc
https://bugzilla.gnome.org/show_bug.cgi?id=787375
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Upstream-Status: Submitted [bugzilla link above]
---
configure.ac | 60 +++++++++++++++++++----------------
libvaladoc/Makefile.am | 25 +++++++++++----
libvaladoc/html/basicdoclet.vala | 8 +++++
libvaladoc/html/htmlmarkupwriter.vala | 4 +++
4 files changed, 63 insertions(+), 34 deletions(-)
diff --git a/configure.ac b/configure.ac
index 730c72d..af81986 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,34 +119,38 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
-PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
-AC_MSG_CHECKING([for CGRAPH])
-cgraph_tmp_LIBADD="$LIBADD"
-cgraph_tmp_CFLAGS="$CFLAGS"
-LIBADD="$LIBADD $LIBGVC_LIBS"
-CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
-AC_RUN_IFELSE(
- [AC_LANG_SOURCE([
- #include <gvc.h>
-
- int main(void) {
- #ifdef WITH_CGRAPH
- return 0;
- #else
- return -1;
- #endif
- }
- ])], [
- AC_MSG_RESULT([yes])
- VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
- have_cgraph=yes
- ], [
- AC_MSG_RESULT([no])
- have_cgraph=no
- ]
-)
-LIBADD="$cgraph_tmp_LIBADD"
-CFLAGS="$cgraph_tmp_CFLAGS"
+AC_ARG_ENABLE(graphviz, AS_HELP_STRING([--disable-graphviz], [Disable graphviz usage for valadoc]), enable_graphviz=$enableval, enable_graphviz=yes)
+if test x$enable_graphviz = xyes; then
+ PKG_CHECK_MODULES(LIBGVC, libgvc >= $LIBGVC_REQUIRED)
+ AC_MSG_CHECKING([for CGRAPH])
+ VALAFLAGS="$VALAFLAGS -D HAVE_GRAPHVIZ"
+ cgraph_tmp_LIBADD="$LIBADD"
+ cgraph_tmp_CFLAGS="$CFLAGS"
+ LIBADD="$LIBADD $LIBGVC_LIBS"
+ CFLAGS="$CFLAGS $LIBGVC_CFLAGS"
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([
+ #include <gvc.h>
+ int main(void) {
+ #ifdef WITH_CGRAPH
+ return 0;
+ #else
+ return -1;
+ #endif
+ }
+ ])], [
+ AC_MSG_RESULT([yes])
+ VALAFLAGS="$VALAFLAGS -D WITH_CGRAPH"
+ have_cgraph=yes
+ ], [
+ AC_MSG_RESULT([no])
+ have_cgraph=no
+ ]
+ )
+ LIBADD="$cgraph_tmp_LIBADD"
+ CFLAGS="$cgraph_tmp_CFLAGS"
+fi
+AM_CONDITIONAL(ENABLE_GRAPHVIZ, test x$enable_graphviz = xyes)
AM_CONDITIONAL(HAVE_CGRAPH, test "$have_cgraph" = "yes")
AC_PATH_PROG([XSLTPROC], [xsltproc], :)
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 384292f..cce50d8 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -126,10 +126,6 @@ libvaladoc_la_VALASOURCES = \
content/tablerow.vala \
content/taglet.vala \
content/text.vala \
- charts/chart.vala \
- charts/chartfactory.vala \
- charts/hierarchychart.vala \
- charts/simplechartfactory.vala \
parser/manyrule.vala \
parser/oneofrule.vala \
parser/optionalrule.vala \
@@ -156,13 +152,24 @@ libvaladoc_la_VALASOURCES = \
highlighter/codetoken.vala \
highlighter/highlighter.vala \
html/basicdoclet.vala \
- html/htmlchartfactory.vala \
html/linkhelper.vala \
html/cssclassresolver.vala \
html/htmlmarkupwriter.vala \
html/htmlrenderer.vala \
$(NULL)
+if ENABLE_GRAPHVIZ
+libvaladoc_la_VALASOURCES += \
+ charts/chart.vala \
+ charts/chartfactory.vala \
+ charts/hierarchychart.vala \
+ charts/simplechartfactory.vala \
+ html/htmlchartfactory.vala \
+ $(NULL)
+
+LIBGVC_PKG = --vapidir $(top_srcdir)/vapi --pkg libgvc
+endif
+
libvaladoc@PACKAGE_SUFFIX@_la_SOURCES = \
libvaladoc.vala.stamp \
$(libvaladoc_la_VALASOURCES:.vala=.c) \
@@ -182,9 +189,9 @@ libvaladoc.vala.stamp: $(libvaladoc_la_VALASOURCES)
--library valadoc \
--vapi valadoc@PACKAGE_SUFFIX@.vapi \
--vapidir $(top_srcdir)/vapi --pkg gmodule-2.0 \
- --vapidir $(top_srcdir)/vapi --pkg libgvc \
--vapidir $(top_srcdir)/gee --pkg gee \
--vapidir $(top_srcdir)/vala --pkg vala \
+ $(LIBGVC_PKG) \
--pkg config \
$(filter %.vala %.c,$^)
touch $@
@@ -211,6 +218,9 @@ nodist_pkgconfig_DATA = valadoc@PACKAGE_SUFFIX@.pc
valadoc@PACKAGE_SUFFIX@.pc: valadoc.pc
cp $< $@
+if !ENABLE_GRAPHVIZ
+ sed -i "s/libgvc //g" $@
+endif
vapidir = $(datadir)/vala/vapi
dist_vapi_DATA = valadoc@PACKAGE_SUFFIX@.vapi
@@ -218,6 +228,9 @@ nodist_vapi_DATA = valadoc@PACKAGE_SUFFIX@.deps
valadoc@PACKAGE_SUFFIX@.deps: valadoc.deps
cp $< $@
+if !ENABLE_GRAPHVIZ
+ sed -i "s/libgvc//g" $@
+endif
EXTRA_DIST = \
$(libvaladoc_la_VALASOURCES) \
diff --git a/libvaladoc/html/basicdoclet.vala b/libvaladoc/html/basicdoclet.vala
index 37c731c..e0326ef 100644
--- a/libvaladoc/html/basicdoclet.vala
+++ b/libvaladoc/html/basicdoclet.vala
@@ -46,7 +46,11 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
protected HtmlRenderer _renderer;
protected Html.MarkupWriter writer;
protected Html.CssClassResolver cssresolver;
+#if HAVE_GRAPHVIZ
protected Charts.Factory image_factory;
+#else
+ protected void* image_factory;
+#endif
protected ErrorReporter reporter;
protected string package_list_link = "../index.html";
@@ -120,7 +124,9 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
this.linker = new LinkHelper ();
_renderer = new HtmlRenderer (settings, this.linker, this.cssresolver);
+#if HAVE_GRAPHVIZ
this.image_factory = new SimpleChartFactory (settings, linker);
+#endif
}
@@ -1025,6 +1031,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
}
protected void write_image_block (Api.Node element) {
+#if HAVE_GRAPHVIZ
if (element is Class || element is Interface || element is Struct) {
unowned string format = (settings.use_svg_images ? "svg" : "png");
var chart = new Charts.Hierarchy (image_factory, element);
@@ -1044,6 +1051,7 @@ public abstract class Valadoc.Html.BasicDoclet : Api.Visitor, Doclet {
this.get_img_path_html (element, format)});
writer.add_usemap (chart);
}
+#endif
}
public void write_namespace_content (Namespace node, Api.Node? parent) {
diff --git a/libvaladoc/html/htmlmarkupwriter.vala b/libvaladoc/html/htmlmarkupwriter.vala
index 5aa4afd..e79b0b8 100644
--- a/libvaladoc/html/htmlmarkupwriter.vala
+++ b/libvaladoc/html/htmlmarkupwriter.vala
@@ -51,12 +51,16 @@ public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter {
}
}
+#if HAVE_GRAPHVIZ
public unowned MarkupWriter add_usemap (Charts.Chart chart) {
string? buf = (string?) chart.write_buffer ("cmapx");
if (buf != null) {
raw_text ("\n");
raw_text ((!) buf);
}
+#else
+ public unowned MarkupWriter add_usemap (void* chart) {
+#endif
return this;
}