commit:     dfb4d312a3f25f78aa2502f915d9c995d952d68d
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 16 17:10:49 2022 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Wed Mar 16 21:38:10 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfb4d312

gui-libs/gtksourceview: Initial version for gtk4 SLOT=5

Just like gui-libs/gtk was made for SLOT=5, the new gtk4 supporting
gtksourceview SLOT is made into gui-libs, with the rest kept in
x11-libs to avoid old packages churn.

Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 gui-libs/gtksourceview/Manifest                   |   1 +
 gui-libs/gtksourceview/files/5-gentoo.lang        | 111 ++++++++++++++++++++++
 gui-libs/gtksourceview/gtksourceview-5.3.2.ebuild |  71 ++++++++++++++
 gui-libs/gtksourceview/metadata.xml               |  11 +++
 profiles/package.mask                             |   3 +-
 5 files changed, 196 insertions(+), 1 deletion(-)

diff --git a/gui-libs/gtksourceview/Manifest b/gui-libs/gtksourceview/Manifest
new file mode 100644
index 000000000000..d92adeed13f9
--- /dev/null
+++ b/gui-libs/gtksourceview/Manifest
@@ -0,0 +1 @@
+DIST gtksourceview-5.3.2.tar.xz 1255296 BLAKE2B 
03f11cf0dde09266a441f5c6d66381b4eba0f2f0197a156a7e21a7a0d08f5a179cf3d6c42cf01f56c56785986fa18966f02820274b5c010e1f604baefb6cab86
 SHA512 
b64e0af95aff17bbee814fd7e8738d7e4cba9bc53ceb17243ad5fde01efd39a106377b5ae00ff7fdcf61cfc087d24dd9b222eb7cc48aba8485eb6f96e30c8563

diff --git a/gui-libs/gtksourceview/files/5-gentoo.lang 
b/gui-libs/gtksourceview/files/5-gentoo.lang
new file mode 100644
index 000000000000..8d539a8a9f3c
--- /dev/null
+++ b/gui-libs/gtksourceview/files/5-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.fontene...@gmail.com>, 2006.
+       Rewritten for gtksourceview-2 by:
+               Rene 'Necoro' Neumann <nec...@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/gui-libs/gtksourceview/gtksourceview-5.3.2.ebuild 
b/gui-libs/gtksourceview/gtksourceview-5.3.2.ebuild
new file mode 100644
index 000000000000..55caf6f4c13a
--- /dev/null
+++ b/gui-libs/gtksourceview/gtksourceview-5.3.2.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2022 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="5"
+
+IUSE="gtk-doc +introspection sysprof +vala"
+REQUIRED_USE="vala? ( introspection ) gtk-doc? ( introspection )"
+
+KEYWORDS="~amd64"
+
+RDEPEND="
+       >=dev-libs/glib-2.70:2
+       >=gui-libs/gtk-4.4:4[introspection?]
+       >=dev-libs/libxml2-2.6:2
+       introspection? ( >=dev-libs/gobject-introspection-1.70.0:= )
+       >=dev-libs/fribidi-0.19.7
+       media-libs/fontconfig
+       x11-libs/pango[introspection?]
+       >=dev-libs/libpcre2-10.21:=[-recursion-limit(-)]
+       sysprof? ( dev-util/sysprof-capture:4 )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-util/glib-utils
+       gtk-doc? ( dev-util/gi-docgen )
+       >=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=(
+               -Dinstall_tests=false
+               $(meson_feature introspection)
+               $(meson_use vala vapi)
+               $(meson_use gtk-doc gtk_doc)
+               $(meson_use sysprof)
+       )
+       meson_src_configure
+}
+
+src_test() {
+       # Tests fail in test-regex with libpcre2[recursion-limit] - 
https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/255
+       # Ensured OK via USE dep, as it would mean issues in real usage for 
syntax highlighting as well
+       virtx meson_src_test
+}
+
+src_install() {
+       meson_src_install
+
+       insinto /usr/share/${PN}-5/language-specs
+       newins "${FILESDIR}"/5-gentoo.lang gentoo.lang
+
+       if use gtk-doc ; then
+               mkdir -p "${ED}"/usr/share/gtk-doc/html/ || die
+               mv "${ED}"/usr/share/doc/${PN}${SLOT} 
"${ED}"/usr/share/gtk-doc/html/ || die
+       fi
+}

diff --git a/gui-libs/gtksourceview/metadata.xml 
b/gui-libs/gtksourceview/metadata.xml
new file mode 100644
index 000000000000..12d732e2c1cf
--- /dev/null
+++ b/gui-libs/gtksourceview/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="project">
+       <email>gn...@gentoo.org</email>
+       <name>Gentoo GNOME Desktop</name>
+</maintainer>
+<use>
+       <flag name="sysprof">Enable profiling data capture support using 
<pkg>dev-util/sysprof-capture</pkg></flag>
+</use>
+</pkgmetadata>

diff --git a/profiles/package.mask b/profiles/package.mask
index c9a65388f096..1d331ecb372c 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -408,8 +408,9 @@ app-misc/emelfm2
 <dev-util/nvidia-cuda-toolkit-11
 
 # Mart Raudsepp <l...@gentoo.org> (2021-12-18)
-# GNOME 42 mask
+# GNOME 42 mask, bug #835448
 >=gui-libs/libhandy-1.5.0
+>=gui-libs/gtksourceview-5.3
 
 # Michał Górny <mgo...@gentoo.org> (2021-12-18)
 # EOL kernel with known vulnerabilities.  Please move to one of the LTS

Reply via email to