From eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 Mon Sep 17 00:00:00 2001 From: Dave Cobbley Date: Tue, 14 Aug 2018 10:05:37 -0700 Subject: [Subtree] Removing import-layers directory As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley Signed-off-by: Brad Bishop --- poky/meta/recipes-devtools/vala/vala.inc | 57 ++++++ .../vala/vala/0001-Disable-valadoc.patch | 32 +++ ...-gen-don-t-append-dirty-if-we-re-not-in-g.patch | 55 +++++ ...001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch | 38 ++++ .../vala/vala/disable-graphviz.patch | 223 +++++++++++++++++++++ poky/meta/recipes-devtools/vala/vala_0.38.8.bb | 10 + 6 files changed, 415 insertions(+) create mode 100644 poky/meta/recipes-devtools/vala/vala.inc create mode 100644 poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch create mode 100644 poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch create mode 100644 poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch create mode 100644 poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch create mode 100644 poky/meta/recipes-devtools/vala/vala_0.38.8.bb (limited to 'poky/meta/recipes-devtools/vala') diff --git a/poky/meta/recipes-devtools/vala/vala.inc b/poky/meta/recipes-devtools/vala/vala.inc new file mode 100644 index 000000000..b22faad78 --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala.inc @@ -0,0 +1,57 @@ +SUMMARY = "C#-like programming language for easing GObject programming" +DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \ +Vala compiles to plain C and has no runtime environment nor penalities whatsoever." +SECTION = "devel" +DEPENDS = "bison-native flex-native glib-2.0" + +# Appending libxslt-native to dependencies has an effect +# of rebuilding the manual, which is very slow. Let's do this +# only when api-documentation distro feature is enabled. +DEPENDS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'libxslt-native', '', d)}" + +# vala-native contains a native version of vapigen, which we use instead of the target one +DEPENDS_append_class-target = " vala-native" +BBCLASSEXTEND = "native" +HOMEPAGE = "http://vala-project.org" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24" + +SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" + +SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz" +inherit autotools pkgconfig upstream-version-is-even + +FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/" +FILES_${PN}-doc += "${datadir}/devhelp" + +do_configure_prepend_class-target() { + # Write out a vapigen wrapper that will be provided by pkg-config file installed in target sysroot + # The wrapper will call a native vapigen + cat > ${B}/vapigen-wrapper << EOF +#!/bin/sh +vapigen-${SHRT_VER} "\$@" +EOF + chmod +x ${B}/vapigen-wrapper +} + +EXTRA_OECONF += " --disable-graphviz" + +# Vapigen wrapper needs to be available system-wide, because it will be used +# to build vapi files from all other packages with vala support +do_install_append_class-target() { + install -d ${D}${bindir}/ + install ${B}/vapigen-wrapper ${D}${bindir}/ +} + +# Put vapigen wrapper into target sysroot so that it can be used when building +# vapi files. +SYSROOT_DIRS_append_class-target = " ${bindir}" + +SYSROOT_PREPROCESS_FUNCS_append_class-target = " vapigen_sysroot_preprocess" +vapigen_sysroot_preprocess() { + # Tweak the vapigen name in the vapigen pkgconfig file, so that it picks + # up our wrapper. + sed -i \ + -e "s|vapigen=.*|vapigen=${bindir}/vapigen-wrapper|" \ + ${SYSROOT_DESTDIR}${libdir}/pkgconfig/vapigen-${SHRT_VER}.pc +} diff --git a/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch b/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch new file mode 100644 index 000000000..9b27b7fd1 --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala/0001-Disable-valadoc.patch @@ -0,0 +1,32 @@ +From b6ca3876e233c724fd460c1579abc4ab63c8d01e Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Wed, 4 Oct 2017 15:23:08 +0300 +Subject: [PATCH] Disable valadoc + +Valadoc is a documentation generator for Vala sources, which was +recently merged into the main vala source tree. Unsurprisingly, +it's broken in cross-compile environment in multiple ways, +so let's fix it some other time. + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Alexander Kanavin +--- + Makefile.am | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index e5dc0cc..813b3fc 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -13,8 +13,6 @@ SUBDIRS = \ + doc \ + gobject-introspection \ + vapigen \ +- libvaladoc \ +- valadoc \ + $(NULL) + + if ENABLE_UNVERSIONED +-- +2.14.1 + diff --git a/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch new file mode 100644 index 000000000..ac9dc8c83 --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch @@ -0,0 +1,55 @@ +From 2460d7b79f7e90dcfeebde5e9c53d9b6798a1f3c Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Tue, 21 Feb 2012 17:12:50 +0100 +Subject: [PATCH] git-version-gen: don't append -dirty if we're not in git + repo + +* for example if we have some dirty directory and we unpack clean vala tarball in it, then it will append -dirty + +Signed-off-by: Martin Jansa + +Upstream-Status: Inappropriate [OE-Specific] +--- + build-aux/git-version-gen | 25 ++++++++++++++----------- + 1 files changed, 14 insertions(+), 11 deletions(-) + +diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen +index 0fa6faa..1d1f9d2 100755 +--- a/build-aux/git-version-gen ++++ b/build-aux/git-version-gen +@@ -126,18 +126,21 @@ fi + + v=`echo "$v" |sed 's/^v//'` + +-# Don't declare a version "dirty" merely because a time stamp has changed. +-git status > /dev/null 2>&1 ++if test -d .git ++then ++ # Don't declare a version "dirty" merely because a time stamp has changed. ++ git status > /dev/null 2>&1 + +-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= +-case "$dirty" in +- '') ;; +- *) # Append the suffix only if there isn't one already. +- case $v in +- *-dirty) ;; +- *) v="$v-dirty" ;; +- esac ;; +-esac ++ dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty= ++ case "$dirty" in ++ '') ;; ++ *) # Append the suffix only if there isn't one already. ++ case $v in ++ *-dirty) ;; ++ *) v="$v-dirty" ;; ++ esac ;; ++ esac ++fi + + # Omit the trailing newline, so that m4_esyscmd can use the result directly. + echo "$v" | tr -d '\012' +-- +1.7.8.4 + diff --git a/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch b/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch new file mode 100644 index 000000000..ecab0fc1c --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala/0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch @@ -0,0 +1,38 @@ +From dbb1c58e86f2af4613f3ac9571d9b163d4bca675 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Fri, 23 Oct 2015 16:13:54 +0300 +Subject: [PATCH] vapigen.m4: use $PKG_CONFIG_SYSROOT_DIR + +This is necessary in cross-compiling environments, where directories +returned by pkg-config should be prefixed with sysroot location. + +Upstream-Status: Pending [review in oe-core list] +Signed-off-by: Alexander Kanavin +--- + vapigen/vapigen.m4 | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/vapigen/vapigen.m4 b/vapigen/vapigen.m4 +index 2c435e7..6228991 100644 +--- a/vapigen/vapigen.m4 ++++ b/vapigen/vapigen.m4 +@@ -82,12 +82,12 @@ AC_DEFUN([VAPIGEN_CHECK], + + AS_CASE([$enable_vala], + [yes], [ +- VAPIGEN=`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name` +- VAPIGEN_MAKEFILE=`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen ++ VAPIGEN=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapigen $vapigen_pkg_name` ++ VAPIGEN_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir $vapigen_pkg_name`/vala/Makefile.vapigen + AS_IF([test "x$2" = "x"], [ +- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name` ++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir $vapigen_pkg_name` + ], [ +- VAPIGEN_VAPIDIR=`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name` ++ VAPIGEN_VAPIDIR=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=vapidir_versioned $vapigen_pkg_name` + ]) + ]) + +-- +2.1.4 + diff --git a/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch b/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch new file mode 100644 index 000000000..15d186de0 --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala/disable-graphviz.patch @@ -0,0 +1,223 @@ +From eb716dc856c20b3da146a4e83e9800bd1f53c739 Mon Sep 17 00:00:00 2001 +From: Rico Tzschichholz +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 +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 c73d5d6b1..291e503d5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -98,34 +98,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 +- +- 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 ++ 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 89245d86b..7c07498b9 100644 +--- a/libvaladoc/Makefile.am ++++ b/libvaladoc/Makefile.am +@@ -127,10 +127,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) \ +@@ -182,8 +189,8 @@ 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 \ ++ $(LIBGVC_PKG) \ + --pkg config \ + $(filter %.vala %.c,$^) + touch $@ +@@ -209,6 +216,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 +@@ -216,6 +226,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 cc9ea4ed7..432c3818f 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 15ed9efd1..fe0d705d4 100644 +--- a/libvaladoc/html/htmlmarkupwriter.vala ++++ b/libvaladoc/html/htmlmarkupwriter.vala +@@ -43,12 +43,16 @@ public class Valadoc.Html.MarkupWriter : Valadoc.MarkupWriter { + }, xml_declaration); + } + ++#if HAVE_GRAPHVIZ + public MarkupWriter add_usemap (Charts.Chart chart) { + string? buf = (string?) chart.write_buffer ("cmapx"); + if (buf != null) { + raw_text ("\n"); + raw_text ((!) buf); + } ++#else ++ public MarkupWriter add_usemap (void* chart) { ++#endif + + return this; + } +-- +2.14.1 diff --git a/poky/meta/recipes-devtools/vala/vala_0.38.8.bb b/poky/meta/recipes-devtools/vala/vala_0.38.8.bb new file mode 100644 index 000000000..e2baf6555 --- /dev/null +++ b/poky/meta/recipes-devtools/vala/vala_0.38.8.bb @@ -0,0 +1,10 @@ +require ${BPN}.inc + +SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch \ + file://0001-vapigen.m4-use-PKG_CONFIG_SYSROOT_DIR.patch \ + file://disable-graphviz.patch \ + file://0001-Disable-valadoc.patch \ +" + +SRC_URI[md5sum] = "37edd0467d056fd9e3937d0bbceda80b" +SRC_URI[sha256sum] = "2fa746b51cd66e43577d1da06a80b708c2875cadaafee77e9700ea35cf23882c" -- cgit v1.2.3