1 |
commit: 06334c394e4dc5827778387e5086813af9527b39 |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 31 06:54:10 2020 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Aug 31 06:54:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06334c39 |
7 |
|
8 |
x11-libs/gtksourceview: quick-fix gentoo syntax highlighting |
9 |
|
10 |
This makes it not error and restore some basic highlighting for |
11 |
ebuild and eclass files, though still does not update to all the |
12 |
other changes in gtksourceview - for example not all built-in |
13 |
commands might be updated, as the bare minimum was done, while |
14 |
a full recheck against upstream sh.lang is really needed. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/730766 |
17 |
Package-Manager: Portage-2.3.103, Repoman-2.3.20 |
18 |
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org> |
19 |
|
20 |
x11-libs/gtksourceview/files/4.6-gentoo.lang | 111 +++++++++++++++++++++ |
21 |
.../gtksourceview/gtksourceview-4.6.1-r1.ebuild | 68 +++++++++++++ |
22 |
2 files changed, 179 insertions(+) |
23 |
|
24 |
diff --git a/x11-libs/gtksourceview/files/4.6-gentoo.lang b/x11-libs/gtksourceview/files/4.6-gentoo.lang |
25 |
new file mode 100644 |
26 |
index 00000000000..8d539a8a9f3 |
27 |
--- /dev/null |
28 |
+++ b/x11-libs/gtksourceview/files/4.6-gentoo.lang |
29 |
@@ -0,0 +1,111 @@ |
30 |
+<?xml version="1.0" encoding="UTF-8"?> |
31 |
+ |
32 |
+<!-- |
33 |
+ GtkSourceView syntax highlight for Gentoo-specific files |
34 |
+ |
35 |
+ Originally written for gtksourceview-1.x by: |
36 |
+ Leonardo Ferreira Fontenelle <leo.fontenelle@×××××.com>, 2006. |
37 |
+ Rewritten for gtksourceview-2 by: |
38 |
+ Rene 'Necoro' Neumann <necoro@××××××.net>, 2007 |
39 |
+ |
40 |
+ Distributed under the same license(s) as gtksourceview. |
41 |
+ |
42 |
+ TODO: |
43 |
+ - do not highlight "enable" in the configure options |
44 |
+ - perhaps highlight portage variables and portage functions different |
45 |
+ |
46 |
+--> |
47 |
+ |
48 |
+<language name="gentoo" id="gentoo" version="2.0" _section="Scripts"> |
49 |
+ <metadata> |
50 |
+ <property name="globs">*.ebuild;*.eclass</property> |
51 |
+ <property name="line-comment-start">#</property> |
52 |
+ </metadata> |
53 |
+ |
54 |
+ <styles> |
55 |
+ <style id="variable" _name="Portage variables" map-to="def:builtin" /> |
56 |
+ <style id="command" _name="Portage command" map-to="def:type" /> |
57 |
+ <style id="function" _name="Portage function" map-to="def:function" /> |
58 |
+ <style id="string" _name="String" map-to="def:string" /> |
59 |
+ </styles> |
60 |
+ |
61 |
+ <definitions> |
62 |
+ |
63 |
+ <!-- rewrite shell string to show highlighted variables --> |
64 |
+ <context id="string" style-ref="def:string"> |
65 |
+ <start>"</start> |
66 |
+ <end>"</end> |
67 |
+ <include> |
68 |
+ <context ref="def:escape"/> |
69 |
+ <context ref="def:line-continue"/> |
70 |
+ <context ref="sh:variable"/> |
71 |
+ </include> |
72 |
+ </context> |
73 |
+ |
74 |
+ <context id="string-2" style-ref="def:string"> |
75 |
+ <start>'</start> |
76 |
+ <end>'</end> |
77 |
+ <include> |
78 |
+ <context ref="def:escape"/> |
79 |
+ <context ref="def:line-continue"/> |
80 |
+ <context ref="sh:variable"/> |
81 |
+ </include> |
82 |
+ </context> |
83 |
+ |
84 |
+ <!-- subprograms: |
85 |
+ - $(..) is not supported currently in the normal sh.lang |
86 |
+ - `...` is interpreted as string - I think the subshell behavior is more acurate --> |
87 |
+ <context id="subprogram"> |
88 |
+ <start>\$\(</start> |
89 |
+ <end>\)</end> |
90 |
+ <include> |
91 |
+ <context sub-pattern="0" where="start" style-ref="sh:keyword"/> |
92 |
+ <context sub-pattern="0" where="end" style-ref="sh:keyword"/> |
93 |
+ <context ref="gentoo"/> |
94 |
+ </include> |
95 |
+ </context> |
96 |
+ |
97 |
+ <context id="subprogram-2"> |
98 |
+ <start>`</start> |
99 |
+ <end>`</end> |
100 |
+ <include> |
101 |
+ <context sub-pattern="0" where="start" style-ref="sh:keyword"/> |
102 |
+ <context sub-pattern="0" where="end" style-ref="sh:keyword"/> |
103 |
+ <context ref="gentoo"/> |
104 |
+ </include> |
105 |
+ </context> |
106 |
+ |
107 |
+ <!-- portage variables - currently unused --> |
108 |
+ <context id="portvars" style-ref="variable"> |
109 |
+ <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> |
110 |
+ </context> |
111 |
+ |
112 |
+ <!-- portage functions - currently unused --> |
113 |
+ <context id="portfuncs" style-ref="function"> |
114 |
+ <match>^(src_(unpack|compile|install|test)|pkg_(config|nofetch|setup|(pre|post)(inst|rm)))</match> |
115 |
+ </context> |
116 |
+ |
117 |
+ <!-- extra portage commands --> |
118 |
+ <context id="portcmds" style-ref="command"> |
119 |
+ <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> |
120 |
+ </context> |
121 |
+ |
122 |
+ <context id="built-in-command"> |
123 |
+ <include> <!-- do not include "sh:built-in-command" as it is replaced down there - which would lead to an endless loop --> |
124 |
+ <context ref="sh:reserved-word" /> |
125 |
+ <context ref="sh:let-command" /> |
126 |
+ <context ref="portcmds" /> |
127 |
+ </include> |
128 |
+ </context> |
129 |
+ |
130 |
+ <!-- gentoo is just a shell with the replacements --> |
131 |
+ <replace id="sh:built-in-command" ref="built-in-command" /> |
132 |
+ <replace id="sh:backtick-subshell" ref="subprogram-2" /> |
133 |
+ <context id="gentoo"> |
134 |
+ <include> |
135 |
+ <context ref="subprogram"/> |
136 |
+ <context ref="sh:sh"/> |
137 |
+ </include> |
138 |
+ </context> |
139 |
+ </definitions> |
140 |
+</language> |
141 |
|
142 |
diff --git a/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild b/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild |
143 |
new file mode 100644 |
144 |
index 00000000000..7c079aebd96 |
145 |
--- /dev/null |
146 |
+++ b/x11-libs/gtksourceview/gtksourceview-4.6.1-r1.ebuild |
147 |
@@ -0,0 +1,68 @@ |
148 |
+# Copyright 1999-2020 Gentoo Authors |
149 |
+# Distributed under the terms of the GNU General Public License v2 |
150 |
+ |
151 |
+EAPI=7 |
152 |
+ |
153 |
+inherit gnome.org meson vala virtualx xdg |
154 |
+ |
155 |
+DESCRIPTION="A text widget implementing syntax highlighting and other features" |
156 |
+HOMEPAGE="https://wiki.gnome.org/Projects/GtkSourceView" |
157 |
+ |
158 |
+LICENSE="LGPL-2.1+" |
159 |
+SLOT="4" |
160 |
+ |
161 |
+IUSE="glade gtk-doc +introspection +vala" |
162 |
+REQUIRED_USE="vala? ( introspection )" |
163 |
+ |
164 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris" |
165 |
+ |
166 |
+RDEPEND=" |
167 |
+ >=dev-libs/glib-2.48:2 |
168 |
+ >=x11-libs/gtk+-3.22:3[introspection?] |
169 |
+ >=dev-libs/libxml2-2.6:2 |
170 |
+ glade? ( >=dev-util/glade-3.9:3.10 ) |
171 |
+ introspection? ( >=dev-libs/gobject-introspection-1.42.0:= ) |
172 |
+ >=dev-libs/fribidi-0.19.7 |
173 |
+" |
174 |
+DEPEND="${RDEPEND}" |
175 |
+BDEPEND=" |
176 |
+ dev-util/glib-utils |
177 |
+ gtk-doc? ( >=dev-util/gtk-doc-1.25 |
178 |
+ app-text/docbook-xml-dtd:4.3 ) |
179 |
+ >=sys-devel/gettext-0.19.8 |
180 |
+ virtual/pkgconfig |
181 |
+ vala? ( $(vala_depend) ) |
182 |
+" |
183 |
+ |
184 |
+src_prepare() { |
185 |
+ use vala && vala_src_prepare |
186 |
+ xdg_src_prepare |
187 |
+} |
188 |
+ |
189 |
+src_configure() { |
190 |
+ local emesonargs=( |
191 |
+ $(meson_use glade glade_catalog) |
192 |
+ -Dinstall_tests=false |
193 |
+ $(meson_use introspection gir) |
194 |
+ $(meson_use vala vapi) |
195 |
+ $(meson_use gtk-doc gtk_doc) |
196 |
+ ) |
197 |
+ meson_src_configure |
198 |
+} |
199 |
+ |
200 |
+src_test() { |
201 |
+ virtx meson_src_test |
202 |
+} |
203 |
+ |
204 |
+src_install() { |
205 |
+ meson_src_install |
206 |
+ |
207 |
+ insinto /usr/share/${PN}-4/language-specs |
208 |
+ newins "${FILESDIR}"/4.6-gentoo.lang gentoo.lang |
209 |
+ |
210 |
+ # Avoid conflict with gtksourceview:3.0 glade-catalog |
211 |
+ # TODO: glade doesn't actually show multiple GtkSourceView widget collections, so with both installed, can't really be sure which ones are used |
212 |
+ if use glade; then |
213 |
+ mv "${ED}"/usr/share/glade/catalogs/gtksourceview.xml "${ED}"/usr/share/glade/catalogs/gtksourceview-${SLOT}.xml || die |
214 |
+ fi |
215 |
+} |