diff options
Diffstat (limited to 'source/d')
-rw-r--r-- | source/d/vala/disable-graphviz.patch | 224 | ||||
-rw-r--r-- | source/d/vala/disable-graphviz.patch.url | 1 | ||||
-rw-r--r-- | source/d/vala/no.gvc-compat.c.diff | 10 | ||||
-rw-r--r-- | source/d/vala/slack-desc | 19 | ||||
-rwxr-xr-x | source/d/vala/vala.SlackBuild | 152 |
5 files changed, 406 insertions, 0 deletions
diff --git a/source/d/vala/disable-graphviz.patch b/source/d/vala/disable-graphviz.patch new file mode 100644 index 00000000..477504dc --- /dev/null +++ b/source/d/vala/disable-graphviz.patch @@ -0,0 +1,224 @@ +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; + } diff --git a/source/d/vala/disable-graphviz.patch.url b/source/d/vala/disable-graphviz.patch.url new file mode 100644 index 00000000..ef2d26c6 --- /dev/null +++ b/source/d/vala/disable-graphviz.patch.url @@ -0,0 +1 @@ +https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-devtools/vala/vala/disable-graphviz.patch diff --git a/source/d/vala/no.gvc-compat.c.diff b/source/d/vala/no.gvc-compat.c.diff new file mode 100644 index 00000000..d23d0b0e --- /dev/null +++ b/source/d/vala/no.gvc-compat.c.diff @@ -0,0 +1,10 @@ +--- ./libvaladoc/Makefile.am.orig 2018-11-10 23:02:49.675409848 -0600 ++++ ./libvaladoc/Makefile.am 2018-11-10 23:09:49.068418810 -0600 +@@ -173,7 +173,6 @@ + libvaladoc@PACKAGE_SUFFIX@_la_SOURCES = \ + libvaladoc.vala.stamp \ + $(libvaladoc_la_VALASOURCES:.vala=.c) \ +- gvc-compat.c \ + $(NULL) + + valadoc@PACKAGE_SUFFIX@.vapi valadoc.h: libvaladoc.vala.stamp diff --git a/source/d/vala/slack-desc b/source/d/vala/slack-desc new file mode 100644 index 00000000..20dfbf27 --- /dev/null +++ b/source/d/vala/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +vala: vala (GNOME programming language) +vala: +vala: Vala is a programming language that aims to bring modern programming +vala: language features to GNOME developers without imposing any additional +vala: runtime requirements and without using a different ABI compared to +vala: applications and libraries written in C. +vala: +vala: Homepage: https://wiki.gnome.org/Projects/Vala +vala: +vala: +vala: diff --git a/source/d/vala/vala.SlackBuild b/source/d/vala/vala.SlackBuild new file mode 100755 index 00000000..0fb81699 --- /dev/null +++ b/source/d/vala/vala.SlackBuild @@ -0,0 +1,152 @@ +#!/bin/sh + +# Copyright 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=vala +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$(uname -m)" in + i?86) ARCH=i586 ;; + arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$(uname -m) ;; + esac + export ARCH +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "armv7hl" ]; then + SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16" + LIBDIRSUFFIX="" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1 +cd $PKGNAM-$VERSION || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Don't use graphviz if it's not on the system. Unless you already have a Vala +# compiler though, you'll need to build with graphviz the first time to use +# the resulting package to bootstrap a non-graphviz build. +# Sorry in advance to the Slackware From Scratch folks. +if ! /bin/ls /usr/man/man7/graphviz.7.gz 1> /dev/null 2> /dev/null ; then + zcat $CWD/disable-graphviz.patch.gz | patch -p1 --verbose || exit 1 + # The last one doesn't quite do it for 0.42.3. + zcat $CWD/no.gvc-compat.c.diff.gz | patch -p1 --verbose || exit 1 + GRAPHVIZ_SUPPORT="--disable-graphviz" + autoreconf -vif || exit 1 +fi + +# Configure, build, and install: +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --docdir=/usr/doc/$PKGNAM-$VERSION \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --disable-static \ + $GRAPHVIZ_SUPPORT \ + --build=$ARCH-slackware-linux || exit 1 +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +# Don't ship .la files: +rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la + +# Strip binaries: +( cd $PKG + find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +) + +# Compress manual pages: +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do + ln -s $( readlink $i ).gz $i.gz + rm $i +done + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +cp -a \ + AUTHORS* ChangeLog CHANGES COPYING* LICENSE* NEWS* README* THANKS* TODO* \ + $PKG/usr/doc/${PKGNAM}-$VERSION + +# If there's a ChangeLog, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r ChangeLog ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog + touch -r ChangeLog $DOCSDIR/ChangeLog +fi + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + |