summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2020-08-31 09:54:10 +0300
committerMart Raudsepp <leio@gentoo.org>2020-08-31 09:54:22 +0300
commit06334c394e4dc5827778387e5086813af9527b39 (patch)
treed81e30f8ad2fa3caf19f86c1471f4b76edee6f89 /x11-libs
parentdev-perl/File-Remove: Bump to version 1.580.0 (diff)
downloadgentoo-06334c394e4dc5827778387e5086813af9527b39.tar.gz
gentoo-06334c394e4dc5827778387e5086813af9527b39.tar.bz2
gentoo-06334c394e4dc5827778387e5086813af9527b39.zip
x11-libs/gtksourceview: quick-fix gentoo syntax highlighting
This makes it not error and restore some basic highlighting for ebuild and eclass files, though still does not update to all the other changes in gtksourceview - for example not all built-in commands might be updated, as the bare minimum was done, while a full recheck against upstream sh.lang is really needed. Bug: https://bugs.gentoo.org/730766 Package-Manager: Portage-2.3.103, Repoman-2.3.20 Signed-off-by: Mart Raudsepp <leio@gentoo.org>
Diffstat (limited to 'x11-libs')
-rw-r--r--x11-libs/gtksourceview/files/4.6-gentoo.lang111
-rw-r--r--x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild68
2 files changed, 179 insertions, 0 deletions
diff --git a/x11-libs/gtksourceview/files/4.6-gentoo.lang b/x11-libs/gtksourceview/files/4.6-gentoo.lang
new file mode 100644
index 000000000000..8d539a8a9f3c
--- /dev/null
+++ b/x11-libs/gtksourceview/files/4.6-gentoo.lang
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ GtkSourceView syntax highlight for Gentoo-specific files
+
+ Originally written for gtksourceview-1.x by:
+ Leonardo Ferreira Fontenelle <leo.fontenelle@gmail.com>, 2006.
+ Rewritten for gtksourceview-2 by:
+ Rene 'Necoro' Neumann <necoro@necoro.net>, 2007
+
+ Distributed under the same license(s) as gtksourceview.
+
+ TODO:
+ - do not highlight "enable" in the configure options
+ - perhaps highlight portage variables and portage functions different
+
+-->
+
+<language name="gentoo" id="gentoo" version="2.0" _section="Scripts">
+ <metadata>
+ <property name="globs">*.ebuild;*.eclass</property>
+ <property name="line-comment-start">#</property>
+ </metadata>
+
+ <styles>
+ <style id="variable" _name="Portage variables" map-to="def:builtin" />
+ <style id="command" _name="Portage command" map-to="def:type" />
+ <style id="function" _name="Portage function" map-to="def:function" />
+ <style id="string" _name="String" map-to="def:string" />
+ </styles>
+
+ <definitions>
+
+ <!-- rewrite shell string to show highlighted variables -->
+ <context id="string" style-ref="def:string">
+ <start>"</start>
+ <end>"</end>
+ <include>
+ <context ref="def:escape"/>
+ <context ref="def:line-continue"/>
+ <context ref="sh:variable"/>
+ </include>
+ </context>
+
+ <context id="string-2" style-ref="def:string">
+ <start>'</start>
+ <end>'</end>
+ <include>
+ <context ref="def:escape"/>
+ <context ref="def:line-continue"/>
+ <context ref="sh:variable"/>
+ </include>
+ </context>
+
+ <!-- subprograms:
+ - $(..) is not supported currently in the normal sh.lang
+ - `...` is interpreted as string - I think the subshell behavior is more acurate -->
+ <context id="subprogram">
+ <start>\$\(</start>
+ <end>\)</end>
+ <include>
+ <context sub-pattern="0" where="start" style-ref="sh:keyword"/>
+ <context sub-pattern="0" where="end" style-ref="sh:keyword"/>
+ <context ref="gentoo"/>
+ </include>
+ </context>
+
+ <context id="subprogram-2">
+ <start>`</start>
+ <end>`</end>
+ <include>
+ <context sub-pattern="0" where="start" style-ref="sh:keyword"/>
+ <context sub-pattern="0" where="end" style-ref="sh:keyword"/>
+ <context ref="gentoo"/>
+ </include>
+ </context>
+
+ <!-- portage variables - currently unused -->
+ <context id="portvars" style-ref="variable">
+ <match>\b((ARCH|HOMEPAGE|DESCRIPTION|IUSE|SRC_URI|LICENSE|SLOT|KEYWORDS|FILESDIR|WORKDIR|(P|R)?DEPEND|PROVIDE|DISTDIR|RESTRICT|USERLAND)|(S|D|T|PV|PF|P|PN|A)|C(XX)?FLAGS|LDFLAGS|C(HOST|TARGET|BUILD))\b</match>
+ </context>
+
+ <!-- portage functions - currently unused -->
+ <context id="portfuncs" style-ref="function">
+ <match>^(src_(unpack|compile|install|test)|pkg_(config|nofetch|setup|(pre|post)(inst|rm)))</match>
+ </context>
+
+ <!-- extra portage commands -->
+ <context id="portcmds" style-ref="command">
+ <match>\b(e(begin|end|conf|install|make|warn|infon?|error|patch)|die|use(_(with|enable))?|inherit|has|(has|best)_version|unpack|(do|new)(ins|s?bin|doc|lib(|\.so|\.a)|man|info|exe|initd|confd|envd|pam|menu|icon)|do(python|sed|dir|hard|sym|html|jar|mo)|keepdir|prepall(|docs|info|man|strip)|prep(info|lib|lib\.(so|a)|man|strip)|(|doc|ins|exe)into|f(owners|perms)|(exe|ins|dir)opts)\b</match>
+ </context>
+
+ <context id="built-in-command">
+ <include> <!-- do not include "sh:built-in-command" as it is replaced down there - which would lead to an endless loop -->
+ <context ref="sh:reserved-word" />
+ <context ref="sh:let-command" />
+ <context ref="portcmds" />
+ </include>
+ </context>
+
+ <!-- gentoo is just a shell with the replacements -->
+ <replace id="sh:built-in-command" ref="built-in-command" />
+ <replace id="sh:backtick-subshell" ref="subprogram-2" />
+ <context id="gentoo">
+ <include>
+ <context ref="subprogram"/>
+ <context ref="sh:sh"/>
+ </include>
+ </context>
+ </definitions>
+</language>
diff --git a/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild b/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild
new file mode 100644
index 000000000000..7c079aebd962
--- /dev/null
+++ b/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit gnome.org meson vala virtualx xdg
+
+DESCRIPTION="A text widget implementing syntax highlighting and other features"
+HOMEPAGE="https://wiki.gnome.org/Projects/GtkSourceView"
+
+LICENSE="LGPL-2.1+"
+SLOT="4"
+
+IUSE="glade gtk-doc +introspection +vala"
+REQUIRED_USE="vala? ( introspection )"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
+
+RDEPEND="
+ >=dev-libs/glib-2.48:2
+ >=x11-libs/gtk+-3.22:3[introspection?]
+ >=dev-libs/libxml2-2.6:2
+ glade? ( >=dev-util/glade-3.9:3.10 )
+ introspection? ( >=dev-libs/gobject-introspection-1.42.0:= )
+ >=dev-libs/fribidi-0.19.7
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-util/glib-utils
+ gtk-doc? ( >=dev-util/gtk-doc-1.25
+ app-text/docbook-xml-dtd:4.3 )
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+ vala? ( $(vala_depend) )
+"
+
+src_prepare() {
+ use vala && vala_src_prepare
+ xdg_src_prepare
+}
+
+src_configure() {
+ local emesonargs=(
+ $(meson_use glade glade_catalog)
+ -Dinstall_tests=false
+ $(meson_use introspection gir)
+ $(meson_use vala vapi)
+ $(meson_use gtk-doc gtk_doc)
+ )
+ meson_src_configure
+}
+
+src_test() {
+ virtx meson_src_test
+}
+
+src_install() {
+ meson_src_install
+
+ insinto /usr/share/${PN}-4/language-specs
+ newins "${FILESDIR}"/4.6-gentoo.lang gentoo.lang
+
+ # Avoid conflict with gtksourceview:3.0 glade-catalog
+ # TODO: glade doesn't actually show multiple GtkSourceView widget collections, so with both installed, can't really be sure which ones are used
+ if use glade; then
+ mv "${ED}"/usr/share/glade/catalogs/gtksourceview.xml "${ED}"/usr/share/glade/catalogs/gtksourceview-${SLOT}.xml || die
+ fi
+}