Merge pull request #57709 from worldofpeace/vala-updates/03-2019
vala updates 03-2019
This commit is contained in:
commit
f102c309c9
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl, gettext, pkgconfig, glib, libnotify, gtk3, libgee
|
||||
, keybinder3, json-glib, zeitgeist, vala_0_38, hicolor-icon-theme, gobject-introspection
|
||||
, keybinder3, json-glib, zeitgeist, vala, hicolor-icon-theme, gobject-introspection
|
||||
}:
|
||||
|
||||
let
|
||||
@ -13,7 +13,7 @@ in stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgconfig gettext vala_0_38
|
||||
pkgconfig gettext vala
|
||||
# For setup hook
|
||||
gobject-introspection
|
||||
];
|
||||
|
@ -54,7 +54,7 @@ lib.makeScope pkgs.newScope (self: with self; {
|
||||
libsoup = pkgs.libsoup.override { gnomeSupport = true; };
|
||||
libchamplain = pkgs.libchamplain.override { libsoup = libsoup; };
|
||||
gnome3 = self // { recurseForDerivations = false; };
|
||||
vala = pkgs.vala_0_42;
|
||||
vala = pkgs.vala_0_44;
|
||||
gegl_0_4 = pkgs.gegl_0_4.override { gtk = pkgs.gtk3; };
|
||||
|
||||
# ISO installer
|
||||
|
@ -30,12 +30,20 @@ let
|
||||
};
|
||||
|
||||
# NOTE: the openembedded-core project doesn't have a patch for 0.40.12
|
||||
# or 0.42.4 just yet; we've fixed the single merge conflict in the
|
||||
# patches below and checked them in here.
|
||||
# We've fixed the single merge conflict in the following patch.
|
||||
# 0.40.12: https://github.com/openembedded/openembedded-core/raw/8553c52f174af4c8c433c543f806f5ed5c1ec48c/meta/recipes-devtools/vala/vala/disable-graphviz.patch
|
||||
# 0.42.4: https://github.com/openembedded/openembedded-core/raw/dfbbff39cfd413510abbd60930232a9c6b35d765/meta/recipes-devtools/vala/vala/disable-graphviz.patch
|
||||
"0.40" = ./disable-graphviz-0.40.12.patch;
|
||||
"0.42" = ./disable-graphviz-0.42.4.patch;
|
||||
|
||||
"0.42" = fp {
|
||||
commit = "f2b4f9ec6f44dced7f88df849cca68961419eeb8";
|
||||
sha256 = "112qhdzix0d7lfpfcam1cxprzmfzpwypb1226m5ma1vq9qy0sn7g";
|
||||
};
|
||||
|
||||
# NOTE: the openembedded-core project doesn't have a patch for 0.44.1
|
||||
# We've reverted the addition of the "--disable-valadoc" option
|
||||
# and then applied the following patch.
|
||||
# 0.42.4: https://github.com/openembedded/openembedded-core/raw/f2b4f9ec6f44dced7f88df849cca68961419eeb8/meta/recipes-devtools/vala/vala/disable-graphviz.patch
|
||||
"0.44" = ./disable-graphviz-0.44.1.patch;
|
||||
|
||||
}.${major} or (throw "no graphviz patch for this version of vala");
|
||||
|
||||
@ -88,15 +96,15 @@ let
|
||||
homepage = https://wiki.gnome.org/Projects/Vala;
|
||||
license = licenses.lgpl21Plus;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ antono jtojnar lethalman peterhoeg ];
|
||||
maintainers = with maintainers; [ antono jtojnar lethalman peterhoeg worldofpeace ];
|
||||
};
|
||||
});
|
||||
|
||||
in rec {
|
||||
vala_0_36 = generic {
|
||||
major = "0.36";
|
||||
minor = "17";
|
||||
sha256 = "1f6qg40zd6jzhbwr3dy4fb66k4qs1xlk2whdyqh64zxxjw0k9pv7";
|
||||
minor = "18";
|
||||
sha256 = "0csb9skgy663y05kl813dsarzjbfcdsmx5fvz13p8gas3hycciq9";
|
||||
};
|
||||
|
||||
vala_0_38 = generic {
|
||||
@ -108,15 +116,21 @@ in rec {
|
||||
|
||||
vala_0_40 = generic {
|
||||
major = "0.40";
|
||||
minor = "12";
|
||||
sha256 = "1nhk45w5iwg97q3cfybn0i4qz5w9qvk423ndpg6mq6cnna076snx";
|
||||
minor = "14";
|
||||
sha256 = "0llid9b9cgjcrcclc0pw2skkssb7br7b2clq9cql3p14dl94gki0";
|
||||
};
|
||||
|
||||
vala_0_42 = generic {
|
||||
major = "0.42";
|
||||
minor = "4";
|
||||
sha256 = "07jgkx812y7wq4cswwfsf1f4k3lq9hcjra45682bdi8a11nr0a5m";
|
||||
minor = "6";
|
||||
sha256 = "14024gvs23q323fmd62hqd8jiypaxbjjvamyd782ixbhxmpz8x1p";
|
||||
};
|
||||
|
||||
vala = vala_0_42;
|
||||
vala_0_44 = generic {
|
||||
major = "0.44";
|
||||
minor = "1";
|
||||
sha256 = "1qiglkgymws6a3m8xz1v8b3na165ywx2dbipp3bdg134bi0w3a4n";
|
||||
};
|
||||
|
||||
vala = vala_0_44;
|
||||
}
|
||||
|
@ -1,208 +0,0 @@
|
||||
diff --git i/configure.ac w/configure.ac
|
||||
index 730c72d7b..af8198637 100644
|
||||
--- i/configure.ac
|
||||
+++ w/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 i/libvaladoc/Makefile.am w/libvaladoc/Makefile.am
|
||||
index f3f790e76..3c5dc4c80 100644
|
||||
--- i/libvaladoc/Makefile.am
|
||||
+++ w/libvaladoc/Makefile.am
|
||||
@@ -128,10 +128,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 \
|
||||
@@ -158,13 +154,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) \
|
||||
@@ -184,11 +191,11 @@ 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 \
|
||||
--vapidir $(top_srcdir)/ccode --pkg ccode \
|
||||
--vapidir $(top_srcdir)/codegen --pkg codegen \
|
||||
+ $(LIBGVC_PKG) \
|
||||
--pkg config \
|
||||
$(filter %.vala %.c,$^)
|
||||
touch $@
|
||||
@@ -217,6 +224,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
|
||||
@@ -224,6 +234,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 i/libvaladoc/html/basicdoclet.vala w/libvaladoc/html/basicdoclet.vala
|
||||
index 192e488cd..ec0960222 100644
|
||||
--- i/libvaladoc/html/basicdoclet.vala
|
||||
+++ w/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
|
||||
}
|
||||
|
||||
|
||||
@@ -1026,6 +1032,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);
|
||||
@@ -1045,6 +1052,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 i/libvaladoc/html/htmlmarkupwriter.vala w/libvaladoc/html/htmlmarkupwriter.vala
|
||||
index 5aa4afdea..e79b0b8f5 100644
|
||||
--- i/libvaladoc/html/htmlmarkupwriter.vala
|
||||
+++ w/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;
|
||||
}
|
261
pkgs/development/compilers/vala/disable-graphviz-0.44.1.patch
Normal file
261
pkgs/development/compilers/vala/disable-graphviz-0.44.1.patch
Normal file
@ -0,0 +1,261 @@
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index f70234759..b3d6c3833 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -13,19 +13,9 @@ SUBDIRS = \
|
||||
doc \
|
||||
gobject-introspection \
|
||||
vapigen \
|
||||
- $(NULL)
|
||||
-
|
||||
-if ENABLE_VALADOC
|
||||
-SUBDIRS += \
|
||||
libvaladoc \
|
||||
valadoc \
|
||||
$(NULL)
|
||||
-endif
|
||||
-
|
||||
-DISTCHECK_CONFIGURE_FLAGS = \
|
||||
- --enable-valadoc \
|
||||
- --enable-unversioned \
|
||||
- $(NULL)
|
||||
|
||||
if ENABLE_UNVERSIONED
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 16ebd1f81..cf23db4b8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -156,10 +156,11 @@ PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= $GLIB_REQUIRED)
|
||||
AC_SUBST(GMODULE_CFLAGS)
|
||||
AC_SUBST(GMODULE_LIBS)
|
||||
|
||||
-AC_ARG_ENABLE(valadoc, AS_HELP_STRING([--disable-valadoc], [Disable valadoc]), enable_valadoc=$enableval, enable_valadoc=yes)
|
||||
-if test x$enable_valadoc = xyes; then
|
||||
+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"
|
||||
@@ -186,8 +187,8 @@ if test x$enable_valadoc = xyes; then
|
||||
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")
|
||||
-AM_CONDITIONAL(ENABLE_VALADOC, test x$enable_valadoc = xyes)
|
||||
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc], :)
|
||||
AM_CONDITIONAL(HAVE_XSLTPROC, test "$XSLTPROC" != :)
|
||||
diff --git a/doc/Makefile.am b/doc/Makefile.am
|
||||
index d2684a0e0..b343c7c10 100644
|
||||
--- a/doc/Makefile.am
|
||||
+++ b/doc/Makefile.am
|
||||
@@ -6,16 +6,11 @@ SUBDIRS = \
|
||||
|
||||
dist_man_MANS = \
|
||||
valac.1 \
|
||||
+ valadoc.1 \
|
||||
vala-gen-introspect.1 \
|
||||
vapigen.1 \
|
||||
$(NULL)
|
||||
|
||||
-if ENABLE_VALADOC
|
||||
-dist_man_MANS += \
|
||||
- valadoc.1 \
|
||||
- $(NULL)
|
||||
-endif
|
||||
-
|
||||
EXTRA_DIST = \
|
||||
valac.h2m \
|
||||
valadoc.h2m \
|
||||
@@ -24,11 +19,7 @@ EXTRA_DIST = \
|
||||
$(NULL)
|
||||
|
||||
if HAVE_HELP2MAN
|
||||
-if ENABLE_VALADOC
|
||||
manpages: valac.1 valadoc.1 vala-gen-introspect.1 vapigen.1
|
||||
-else
|
||||
-manpages: valac.1 vala-gen-introspect.1 vapigen.1
|
||||
-endif
|
||||
@rm $^
|
||||
$(MAKE) $(AM_MAKEFLAGS) $^
|
||||
|
||||
@@ -37,13 +28,11 @@ valac.1:
|
||||
--include $(srcdir)/valac.h2m \
|
||||
--libtool --no-info \
|
||||
--output=$@
|
||||
-if ENABLE_VALADOC
|
||||
valadoc.1:
|
||||
$(HELP2MAN) $(top_builddir)/valadoc/valadoc \
|
||||
--include $(srcdir)/valadoc.h2m \
|
||||
--libtool --no-info \
|
||||
--output=$@
|
||||
-endif
|
||||
vala-gen-introspect.1:
|
||||
$(HELP2MAN) $(top_builddir)/gobject-introspection/gen-introspect \
|
||||
--include $(srcdir)/vala-gen-introspect.h2m \
|
||||
@@ -60,15 +49,12 @@ endif
|
||||
if ENABLE_UNVERSIONED
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(man1dir) && $(LN_S) -f valac@PACKAGE_SUFFIX@.1 valac.1
|
||||
-if ENABLE_VALADOC
|
||||
cd $(DESTDIR)$(man1dir) && $(LN_S) -f valadoc@PACKAGE_SUFFIX@.1 valadoc.1
|
||||
-endif
|
||||
cd $(DESTDIR)$(man1dir) && $(LN_S) -f vala-gen-introspect@PACKAGE_SUFFIX@.1 vala-gen-introspect.1
|
||||
cd $(DESTDIR)$(man1dir) && $(LN_S) -f vapigen@PACKAGE_SUFFIX@.1 vapigen.1
|
||||
endif
|
||||
|
||||
|
||||
-if ENABLE_VALADOC
|
||||
COMMON_VALADOCFLAGS = \
|
||||
--force \
|
||||
--verbose \
|
||||
@@ -150,7 +136,6 @@ internal-apis/valadoc: $(valadoc_VALASOURCES) internal-apis/codegen
|
||||
@touch $@
|
||||
|
||||
internal-api-docs: internal-apis/gee internal-apis/vala internal-apis/ccode internal-apis/codegen internal-apis/valadoc
|
||||
-endif
|
||||
|
||||
clean-local:
|
||||
rm -rf $(builddir)/internal-apis
|
||||
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
|
||||
index 7456fb836..107338e91 100644
|
||||
--- a/libvaladoc/Makefile.am
|
||||
+++ b/libvaladoc/Makefile.am
|
||||
@@ -119,10 +119,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 \
|
||||
@@ -149,13 +145,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) \
|
||||
@@ -175,11 +182,11 @@ 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 \
|
||||
--vapidir $(top_srcdir)/ccode --pkg ccode \
|
||||
--vapidir $(top_srcdir)/codegen --pkg codegen \
|
||||
+ $(LIBGVC_PKG) \
|
||||
--pkg config \
|
||||
$(filter %.vala %.c,$^)
|
||||
touch $@
|
||||
@@ -207,6 +214,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
|
||||
@@ -214,6 +224,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 46578c28f..f6ce7097c 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 5aa4afdea..e79b0b8f5 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;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{ stdenv, fetchurl, lib, file
|
||||
, pkgconfig, intltool
|
||||
, glib, dbus-glib, json-glib
|
||||
, gobject-introspection, vala_0_38, gnome-doc-utils
|
||||
, gobject-introspection, vala, gnome-doc-utils
|
||||
, gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
|
||||
|
||||
with lib;
|
||||
@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig intltool ];
|
||||
nativeBuildInputs = [ vala pkgconfig intltool ];
|
||||
|
||||
buildInputs = [
|
||||
glib dbus-glib json-glib
|
||||
gobject-introspection vala_0_38 gnome-doc-utils
|
||||
gobject-introspection gnome-doc-utils
|
||||
] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
|
||||
|
||||
postPatch = ''
|
||||
@ -49,9 +49,9 @@ stdenv.mkDerivation rec {
|
||||
doCheck = false; # generates shebangs in check phase, too lazy to fix
|
||||
|
||||
installFlags = [
|
||||
"sysconfdir=\${out}/etc"
|
||||
"sysconfdir=${placeholder ''out''}/etc"
|
||||
"localstatedir=\${TMPDIR}"
|
||||
"typelibdir=\${out}/lib/girepository-1.0"
|
||||
"typelibdir=${placeholder ''out''}/lib/girepository-1.0"
|
||||
];
|
||||
|
||||
meta = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl, pkgconfig, meson, ninja, makeFontsConf, vala_0_40
|
||||
, gnome3, glib, json-glib, libarchive, libsoup, gobject-introspection }:
|
||||
{ stdenv, fetchurl, pkgconfig, meson, ninja, makeFontsConf, vala, fetchpatch
|
||||
, gnome3, glib, json-glib, libarchive, libsoup, gobject-introspection, valadoc }:
|
||||
|
||||
let
|
||||
pname = "libhttpseverywhere";
|
||||
@ -12,10 +12,17 @@ in stdenv.mkDerivation rec {
|
||||
sha256 = "1jmn6i4vsm89q1axlq4ajqkzqmlmjaml9xhw3h9jnal46db6y00w";
|
||||
};
|
||||
|
||||
# Broken with newest Vala https://gitlab.gnome.org/GNOME/libhttpseverywhere/issues/1
|
||||
nativeBuildInputs = [ vala_0_40 gobject-introspection meson ninja pkgconfig ];
|
||||
nativeBuildInputs = [ vala gobject-introspection meson ninja pkgconfig ];
|
||||
buildInputs = [ glib gnome3.libgee json-glib libsoup libarchive ];
|
||||
|
||||
# Fixes build with vala >=0.42
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.gnome.org/GNOME/libhttpseverywhere/commit/6da08ef1ade9ea267cecf14dd5cb2c3e6e5e50cb.patch";
|
||||
sha256 = "1nwjlh8iqgjayccwdh0fbpq2g1h8bg1k1g9i324f2bhhvyhmpq8f";
|
||||
})
|
||||
];
|
||||
|
||||
mesonFlags = [ "-Denable_valadoc=true" ];
|
||||
|
||||
doCheck = true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ stdenv, fetchFromGitHub, lib
|
||||
, intltool, glib, pkgconfig, polkit, python, sqlite
|
||||
, gobject-introspection, vala_0_38, gtk-doc, autoreconfHook, autoconf-archive
|
||||
, gobject-introspection, vala, gtk-doc, autoreconfHook, autoconf-archive
|
||||
# TODO: set enableNixBackend to true, as soon as it builds
|
||||
, nix, enableNixBackend ? false, boost
|
||||
, enableCommandNotFound ? false
|
||||
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "02wq3jw3mkdld90irh5vdfd5bri2g1p89mhrmj56kvif1fqak46x";
|
||||
};
|
||||
|
||||
buildInputs = [ glib polkit python gobject-introspection vala_0_38 ]
|
||||
buildInputs = [ glib polkit python gobject-introspection vala ]
|
||||
++ lib.optional enableSystemd systemd
|
||||
++ lib.optional enableBashCompletion bash-completion;
|
||||
propagatedBuildInputs = [ sqlite nix boost ];
|
||||
|
@ -7688,6 +7688,7 @@ in
|
||||
vala_0_38
|
||||
vala_0_40
|
||||
vala_0_42
|
||||
vala_0_44
|
||||
vala;
|
||||
|
||||
valadoc = callPackage ../development/tools/valadoc { };
|
||||
|
Loading…
x
Reference in New Issue
Block a user