summaryrefslogtreecommitdiff
path: root/dev-util/gnome-builder
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-util/gnome-builder
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-util/gnome-builder')
-rw-r--r--dev-util/gnome-builder/Manifest6
-rw-r--r--dev-util/gnome-builder/files/3.24.2-jedi-fixes-1.patch28
-rw-r--r--dev-util/gnome-builder/files/3.24.2-jedi-fixes-2.patch25
-rw-r--r--dev-util/gnome-builder/files/3.24.2-jedi-fixes-3.patch197
-rw-r--r--dev-util/gnome-builder/gnome-builder-3.24.2-r1.ebuild133
-rw-r--r--dev-util/gnome-builder/metadata.xml16
6 files changed, 405 insertions, 0 deletions
diff --git a/dev-util/gnome-builder/Manifest b/dev-util/gnome-builder/Manifest
new file mode 100644
index 000000000000..953c8dd871bf
--- /dev/null
+++ b/dev-util/gnome-builder/Manifest
@@ -0,0 +1,6 @@
+AUX 3.24.2-jedi-fixes-1.patch 1224 BLAKE2B 4e3ea7702ddc69f892522596c9ff33495556b2d3cf1bcc2f09db7773d6f833b39e3a65f26813b1c75255c60ea5b0f0477439d25e7897f9d45baa84e6166f8d11 SHA512 f46e3a2e5128873bf8dc2ece5bca060d4d2dc936ce21127ce023f606c4841f888b5acaedf5500c1a5e2af634f12d1594e7dbb3480726ac871ca73e47c6fd0639
+AUX 3.24.2-jedi-fixes-2.patch 928 BLAKE2B 8fb3e4bb34217309475431ea66f24c003e27a89314d1eafff37b11eb9f79c76b7bddb78899e9cf78215dd72e5da27e6f416757db40921f06904ec6a215ea1dd6 SHA512 e5b08a6ad2e182e9340d49876b0ee61f9a5e97abb8c31361ee5058647490894b741250c0850adfb18f93005ccebbbbff5c0ca6fe75f61d1895816f33e4801af0
+AUX 3.24.2-jedi-fixes-3.patch 8966 BLAKE2B 9dc40ddc73ae2ca5b0cbb6202391eb3aa550771dd65f7fac84e724d207c5867129c8607417279c78aa469234e62a3e1f62cb294701948b5741b06c4a0aecbf9d SHA512 5481e325a338cea5946a4515e8e532c8d516b0f05a2f3c7ad33dc3e9bbc83024bb8ceb2f0913b1795fdc57e856b37ccaf314e05b414d27669a4819b63747f255
+DIST gnome-builder-3.24.2.tar.xz 4342908 BLAKE2B 5dca80d2e948041bc096fa9a2a5d39322c6fedb0560e3e4f3c60c7b0657c7c62e89387a63f7d050c3df90d8c129485bc5495039802548b22ae268d94c14a37ae SHA512 dec133ad3c5ef96a036598ebbe684667dc44f73d8643e700f1e776cf8eb860b99c1d333f1fed5bc896cb7bdcf607eb51fedb7bb1f5b0cc662e4b2703d74140bf
+EBUILD gnome-builder-3.24.2-r1.ebuild 5195 BLAKE2B 2d9dbfd2abcf2261221ef5310853501d93f64db9e235a0b0b1b843a754306033dd26ebc239ef46ee05d8109f35f85055359fc2ce66ea6bf2007dea80f621b3de SHA512 ac2295cdc97874f921a65cf6cd5f766b9deb94dd1cd171e8d0568964c0d2f9e5aa8addeb6410af5174c2c6f636332cfacd171c3d2862bb586baaf0e0bd05e227
+MISC metadata.xml 1011 BLAKE2B d6099c6cd5ffaf091f2ee0e07e261caacf0283aa18dc6be22a617b95236131e831d24f36bbc73f86edc66a3e6fe74f5102d101c9736d5d992a80929a68ac2100 SHA512 b3519707a4023a6c9892827abaf6465e28dbad2f1a8c2760a3f2d9b34d4be384d10326870e0d7952b41cb725c955cc838092786543ff1867db4a3acf41cb404a
diff --git a/dev-util/gnome-builder/files/3.24.2-jedi-fixes-1.patch b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-1.patch
new file mode 100644
index 000000000000..399811bb0eac
--- /dev/null
+++ b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-1.patch
@@ -0,0 +1,28 @@
+From 294920f6b932992e9da8864ca96ae35fe2402406 Mon Sep 17 00:00:00 2001
+From: Christian Hergert <chergert@redhat.com>
+Date: Fri, 30 Jun 2017 21:19:41 -0700
+Subject: [PATCH] jedi: silence xml parser warning
+
+https://bugzilla.gnome.org/show_bug.cgi?id=784327
+---
+
+diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
+index 7be46f2..d257680 100644
+--- a/plugins/jedi/jedi_plugin.py
++++ b/plugins/jedi/jedi_plugin.py
+@@ -298,7 +298,11 @@ class DocumentationDB(object):
+ cursor.execute('UPDATE girfiles SET last_modified=? WHERE file=?', (mtime, filename))
+ parser = lxml.etree.XMLParser(recover=True)
+ tree = lxml.etree.parse(filename, parser=parser)
+- namespace = tree.find('core:namespace', namespaces=ns)
++ try:
++ namespace = tree.find('core:namespace', namespaces=ns)
++ except:
++ print("Failed to parse", filename)
++ continue
+ library_version = namespace.attrib['version']
+ for node in namespace.findall('core:class', namespaces=ns):
+ doc = node.find('core:doc', namespaces=ns)
+--
+libgit2 0.26.0
+
diff --git a/dev-util/gnome-builder/files/3.24.2-jedi-fixes-2.patch b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-2.patch
new file mode 100644
index 000000000000..de8397a57a00
--- /dev/null
+++ b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-2.patch
@@ -0,0 +1,25 @@
+From 1d7c6fa60faf9e81f2fa0f93898f8e1cc68da6d4 Mon Sep 17 00:00:00 2001
+From: Christian Hergert <chergert@redhat.com>
+Date: Thu, 6 Jul 2017 14:32:52 -0700
+Subject: [PATCH] jedi: ignore non-gir files
+
+The rnc file is now shipped here, so ignore that when going
+through the directory contents.
+---
+
+diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
+index d257680..25ade14 100644
+--- a/plugins/jedi/jedi_plugin.py
++++ b/plugins/jedi/jedi_plugin.py
+@@ -280,6 +280,8 @@ class DocumentationDB(object):
+ # I would use scandir for better performance, but it requires newer Python
+ for gir_path in GIR_PATH_LIST:
+ for gir_file in os.listdir(gir_path):
++ if not gir_file.endswith('.gir'):
++ continue
+ if gir_file in processed_gir_files:
+ continue
+ processed_gir_files[gir_file] = None
+--
+libgit2 0.26.0
+
diff --git a/dev-util/gnome-builder/files/3.24.2-jedi-fixes-3.patch b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-3.patch
new file mode 100644
index 000000000000..484341ad1155
--- /dev/null
+++ b/dev-util/gnome-builder/files/3.24.2-jedi-fixes-3.patch
@@ -0,0 +1,197 @@
+From 8bf74c787af082102958de7498a9b4f4248788cc Mon Sep 17 00:00:00 2001
+From: Elad Alfassa <elad@fedoraproject.org>
+Date: Wed, 9 Aug 2017 17:39:07 +0300
+Subject: [PATCH] jedi: adapt to jedi 0.10.0
+
+https://bugzilla.gnome.org/show_bug.cgi?id=778708
+---
+
+diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
+index 25ade14..8898b69 100644
+--- a/plugins/jedi/jedi_plugin.py
++++ b/plugins/jedi/jedi_plugin.py
+@@ -55,7 +55,6 @@ from gi.repository import GtkSource
+ from gi.repository import Ide
+ from gi.types import GObjectMeta
+ from gi.types import StructMeta
+-
+ _ = Ide.gettext
+
+ gi_importer = DynamicImporter('gi.repository')
+@@ -91,22 +90,31 @@ _ICONS = {
+ try:
+ import jedi
+ from jedi.evaluate.compiled import CompiledObject
++ from jedi.evaluate.compiled import get_special_object
+ from jedi.evaluate.compiled import _create_from_name
+- from jedi.evaluate.compiled import builtin
++ from jedi.evaluate.context import Context
+ from jedi.evaluate.docstrings import _evaluate_for_statement_string
+ from jedi.evaluate.imports import Importer
+
+ class PatchedJediCompiledObject(CompiledObject):
+ "A modified version of Jedi CompiledObject to work with GObject Introspection modules"
++
++ def __init__(self, evaluator, obj, parent_context=None, faked_class=None):
++ # we have to override __init__ to change super(CompiledObject, self)
++ # to Context, in order to prevent an infinite recursion
++ Context.__init__(self, evaluator, parent_context)
++ self.obj = obj
++ self.tree_node = faked_class
++
+ def _cls(self):
+ if self.obj.__class__ == IntrospectionModule:
+ return self
+ else:
+- return super()._cls()
++ return super()._cls(self)
+
+ @property
+ def py__call__(self):
+- def actual(evaluator, params):
++ def actual(params):
+ # Parse the docstring to find the return type:
+ ret_type = ''
+ if '->' in self.obj.__doc__:
+@@ -115,18 +123,21 @@ try:
+ if ret_type.startswith('iter:'):
+ ret_type = ret_type[len('iter:'):] # we don't care if it's an iterator
+
+- if ret_type in __builtins__:
++ if hasattr(__builtins__, ret_type):
+ # The function we're inspecting returns a builtin python type, that's easy
+- obj = _create_from_name(builtin, builtin, ret_type)
+- return evaluator.execute(obj, params)
++ # (see test/test_evaluate/test_compiled.py in the jedi source code for usage)
++ builtins = get_special_object(self.evaluator, 'BUILTINS')
++ builtin_obj = builtins.py__getattribute__(ret_type)
++ obj = _create_from_name(self.evaluator, builtins, builtin_obj, "")
++ return self.evaluator.execute(obj, params)
+ else:
+ # The function we're inspecting returns a GObject type
+- parent = self.parent.obj.__name__
++ parent = self.parent_context.obj.__name__
+ if parent.startswith('gi.repository'):
+ parent = parent[len('gi.repository.'):]
+ else:
+ # a module with overrides, such as Gtk, behaves differently
+- parent_module = self.parent.obj.__module__
++ parent_module = self.parent_context.obj.__module__
+ if parent_module.startswith('gi.overrides'):
+ parent_module = parent_module[len('gi.overrides.'):]
+ parent = '%s.%s' % (parent_module, parent)
+@@ -138,22 +149,28 @@ try:
+ # A pygobject type in a different module
+ return_type_parent = ret_type.split('.', 1)[0]
+ ret_type = 'from gi.repository import %s\n%s' % (return_type_parent, ret_type)
+- result = _evaluate_for_statement_string(evaluator, ret_type, self.parent)
+- return result
++ result = _evaluate_for_statement_string(self.parent_context, ret_type)
++ return set(result)
+ if type(self.obj) == FunctionInfo:
+ return actual
+ return super().py__call__
+
++ # we need to override CompiledBoundMethod without changing it much,
++ # just so it'll not get confused due to our overriden CompiledObject
++ class PatchedCompiledBoundMethod(PatchedJediCompiledObject):
++ def __init__(self, func):
++ super().__init__(func.evaluator, func.obj, func.parent_context, func.tree_node)
++
+ class PatchedJediImporter(Importer):
+ "A modified version of Jedi Importer to work with GObject Introspection modules"
+ def follow(self):
+ module_list = super().follow()
+- if module_list == []:
++ if not module_list:
+ import_path = '.'.join([str(i) for i in self.import_path])
+ if import_path.startswith('gi.repository'):
+ try:
+ module = gi_importer.load_module(import_path)
+- module_list = [PatchedJediCompiledObject(module)]
++ module_list = [PatchedJediCompiledObject(self._evaluator, module)]
+ except ImportError:
+ pass
+ return module_list
+@@ -169,9 +186,9 @@ try:
+ return original_jedi_get_module('gi._gobject')
+
+ jedi.evaluate.compiled.fake.get_module = patched_jedi_get_module
+-
+- jedi.evaluate.imports.Importer = PatchedJediImporter
+ jedi.evaluate.compiled.CompiledObject = PatchedJediCompiledObject
++ jedi.evaluate.instance.CompiledBoundMethod = PatchedCompiledBoundMethod
++ jedi.evaluate.imports.Importer = PatchedJediImporter
+ HAS_JEDI = True
+ except ImportError:
+ print("jedi not found, python auto-completion not possible.")
+@@ -331,7 +348,6 @@ def update_doc_db_on_startup():
+
+ update_doc_db_on_startup()
+
+-
+ class JediCompletionProvider(Ide.Object, GtkSource.CompletionProvider, Ide.CompletionProvider):
+ context = None
+ current_word = None
+@@ -600,6 +616,15 @@ class JediCompletionRequest:
+ script = jedi.Script(self.content, self.line + 1, self.column, self.filename)
+
+ db = DocumentationDB()
++
++ def get_gi_obj(info):
++ """ Get a GObject Introspection object from a jedi Completion, or None if the completion is not GObject Introspection related """
++ if (type(info._module) == PatchedJediCompiledObject and
++ info._module.obj.__class__ == IntrospectionModule):
++ return next(info._name.infer()).obj
++ else:
++ return None
++
+ for info in script.completions():
+ if self.cancelled:
+ return
+@@ -608,10 +633,9 @@ class JediCompletionRequest:
+
+ # we have to use custom names here because .type and .params can't
+ # be overridden (they are properties)
+- if type(info._definition) == PatchedJediCompiledObject and \
+- type(info._definition.obj) == FunctionInfo:
++ obj = get_gi_obj(info)
++ if type(obj) == FunctionInfo:
+ info.real_type = 'function'
+- obj = info._definition.obj
+ params = [arg_info.get_name() for arg_info in obj.get_arguments()]
+ else:
+ info.real_type = info.type
+@@ -626,8 +650,8 @@ class JediCompletionRequest:
+ params.append(param.name)
+
+ doc = info.docstring()
+- if hasattr(info._definition, 'obj'):
+- obj = info._definition.obj
++ if obj is not None:
++ # get documentation for this GObject Introspection object
+ symbol = None
+ namespace = None
+
+@@ -640,17 +664,7 @@ class JediCompletionRequest:
+ namespace = obj.get_namespace()
+
+ if symbol is not None:
+- # we need to walk down the path to find the module so we can get the version
+- parent = info._definition.parent
+- found = False
+- while not found:
+- new_parent = parent.parent
+- if new_parent is None:
+- found = True
+- else:
+- parent = new_parent
+- version = parent.obj._version
+- result = db.query(symbol, version)
++ result = db.query(symbol, info._module.obj._version)
+ if result is not None:
+ doc = result
+
+--
+libgit2 0.26.0
+
diff --git a/dev-util/gnome-builder/gnome-builder-3.24.2-r1.ebuild b/dev-util/gnome-builder/gnome-builder-3.24.2-r1.ebuild
new file mode 100644
index 000000000000..296e94b87677
--- /dev/null
+++ b/dev-util/gnome-builder/gnome-builder-3.24.2-r1.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python3_{4,5,6} )
+VALA_MIN_API_VERSION="0.30"
+VALA_USE_DEPEND="vapigen"
+DISABLE_AUTOFORMATTING=1
+FORCE_PRINT_ELOG=1
+
+inherit gnome2 python-single-r1 vala virtualx readme.gentoo-r1
+
+DESCRIPTION="Builder attempts to be an IDE for writing software for GNOME"
+HOMEPAGE="https://wiki.gnome.org/Apps/Builder"
+
+# FIXME: Review licenses at some point
+LICENSE="GPL-3+ GPL-2+ LGPL-3+ LGPL-2+ MIT CC-BY-SA-3.0 CC0-1.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="clang +git sysprof vala webkit"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# When bumping, pay attention to all the included plugins/*/configure.ac files and the requirements within.
+# Most have no extra requirements and default to enabled; we need to handle the ones with extra requirements, which tend to default to auto(magic).
+# Look at the last (fourth) argument given to AC_ARG_ENABLE to decide. We don't support any disabling of those that are default-enabled and have no extra deps beyond C/python/introspection.
+# FIXME: >=dev-util/devhelp-3.20.0 dependency is automagic for devhelp integration plugin
+# FIXME: vte could be optional via $(use_enable vte terminal-plugin) - but most/all people want this and have vte?
+# FIXME: flatpak-plugin needs flatpak.pc >=0.6.9, libgit2[threads] >=libgit2-glib-0.24.0[ssh] libsoup-2.4.pc
+# FIXME: --with-sanitizer configure option
+# FIXME: Enable rdtscp based high performance counter usage on suitable architectures for EGG_COUNTER?
+# Editorconfig needs pcre.h, with vte migrating away, might want it optional?
+# Python is always enabled - the core python plugin support checks are automagic and not worth crippling it by not supporting python plugins
+# Relatedly introspection is always required to not have broken python using plugins or have to enable/disable them based on it. This is a full IDE, not a place to be really minimal.
+# An introspection USE flag of a dep is required if any introspection based language plugin wants to use it. Last full check at 3.22.4
+RDEPEND="
+ >=x11-libs/gtk+-3.22.1:3[introspection]
+ >=dev-libs/glib-2.50.0:2[dbus]
+ >=x11-libs/gtksourceview-3.22.0:3.0[introspection]
+ >=dev-libs/gobject-introspection-1.48.0:=
+ >=dev-python/pygobject-3.22.0:3
+ >=dev-libs/libxml2-2.9.0
+ >=x11-libs/pango-1.38.0
+ >=dev-libs/libpeas-1.18.0[python,${PYTHON_USEDEP}]
+ >=dev-libs/json-glib-1.2.0
+ >=app-text/gspell-1.2.0
+ >=app-text/enchant-1.6.0
+ webkit? ( >=net-libs/webkit-gtk-2.12.0:4=[introspection] )
+ clang? ( sys-devel/clang:= )
+ git? (
+ dev-libs/libgit2[ssh,threads]
+ >=dev-libs/libgit2-glib-0.25.0[ssh] )
+ >=x11-libs/vte-0.46:2.91
+ sysprof? ( >=dev-util/sysprof-3.23.91[gtk] )
+ dev-libs/libpcre:3
+ ${PYTHON_DEPS}
+ vala? ( $(vala_depend) )
+"
+# desktop-file-utils for desktop-file-validate check in configure for 3.22.4
+DEPEND="${RDEPEND}
+ dev-libs/appstream-glib
+ dev-util/desktop-file-utils
+ >=sys-devel/gettext-0.19.8
+ virtual/pkgconfig
+ !<sys-apps/sandbox-2.10-r3
+"
+
+# Tests fail if all plugins aren't enabled (webkit, clang, devhelp, perhaps more)
+RESTRICT="test"
+
+DOC_CONTENTS='gnome-builder can use various other dependencies on runtime to provide
+extra capabilities beyond these expressed via USE flags. Some of these
+that are currently available with packages include:
+
+* dev-util/ctags with exuberant-ctags selected via "eselect ctags" for
+ C, C++, Python, JavaScript, CSS, HTML and Ruby autocompletion, semantic
+ highlighting and symbol resolving support.
+* dev-python/jedi-0.10.x and dev-python/lxml for more accurate Python
+ autocompletion support.
+* dev-util/valgrind for integration with valgrind.
+* dev-util/meson for integration with the Meson build system.
+* dev-util/cargo for integration with the Rust Cargo build system.
+'
+# FIXME: Package gnome-code-assistance and mention here, or maybe USE flag and default enable because it's rather important
+# eslint for additional diagnostics in JavaScript files
+# jhbuild support
+# rust language server via rls
+# autotools stuff for autotools plugin; gtkmm/autoconf-archive for C++ template
+# mono/PHPize stuff
+
+PATCHES=( "${FILESDIR}"/${PV}-jedi-fixes-{1,2,3}.patch ) # jedi-0.10+ compatibility from 3.25.9x; remove 0.10 specific mention from DOC_CONTENTS once compat with 0.11+
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ use vala && vala_src_prepare
+ gnome2_src_prepare
+}
+
+src_configure() {
+ gnome2_src_configure \
+ --with-channel=distro \
+ --enable-editorconfig \
+ --enable-introspection \
+ $(use_enable vala vala-pack-plugin) \
+ $(use_enable webkit) \
+ $(use_enable webkit html-preview-plugin) \
+ $(use_enable clang clang-plugin) \
+ $(use_enable git git-plugin) \
+ $(use_enable sysprof sysprof-plugin) \
+ --disable-flatpak-plugin \
+ --enable-terminal-plugin \
+ --enable-gettext-plugin \
+ --disable-static
+}
+
+src_install() {
+ gnome2_src_install
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ gnome2_pkg_postinst
+ readme.gentoo_print_elog
+}
+
+src_test() {
+ # FIXME: this should be handled at eclass level
+ "${EROOT}${GLIB_COMPILE_SCHEMAS}" --allow-any-name "${S}/data/gsettings" || die
+
+ GSETTINGS_SCHEMA_DIR="${S}/data/gsettings" virtx emake check
+}
diff --git a/dev-util/gnome-builder/metadata.xml b/dev-util/gnome-builder/metadata.xml
new file mode 100644
index 000000000000..78c212429a5c
--- /dev/null
+++ b/dev-util/gnome-builder/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>gnome@gentoo.org</email>
+ <name>Gentoo GNOME Desktop</name>
+</maintainer>
+<use>
+ <flag name="clang">Provide integration with <pkg>sys-devel/clang</pkg> for best possible C/C++ autocompletion, semantic highlighting, symbol resolving, and diagnostics support</flag>
+ <flag name="git">Provide support for the Git version control system via <pkg>dev-libs/libgit2-glib</pkg>
+ (such as setup of Git for New Project, direct cloning for Open Project and changed lines indicators in the editor gutter)</flag>
+ <flag name="sysprof">Provide an integrated profiler via <pkg>dev-util/sysprof</pkg></flag>
+ <flag name="vala">Provide an autoindenter, autocompletion, diagnostics, and symbol resolver for Vala</flag>
+ <flag name="webkit">Enable <pkg>net-libs/webkit-gtk</pkg> using plugins support and the HTML/Markdown previewer plugin</flag>
+</use>
+</pkgmetadata>