Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2023 Gentoo Authors |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
|
4 |
EAPI=8 |
5 |
PYTHON_COMPAT=( python3_{9..11} ) |
6 |
DISABLE_AUTOFORMATTING=1 |
7 |
FORCE_PRINT_ELOG=1 |
8 |
|
9 |
inherit gnome.org gnome2-utils llvm meson optfeature python-single-r1 readme.gentoo-r1 virtualx xdg |
10 |
|
11 |
DESCRIPTION="An IDE for writing GNOME-based software" |
12 |
HOMEPAGE="https://wiki.gnome.org/Apps/Builder https://gitlab.gnome.org/GNOME/gnome-builder" |
13 |
|
14 |
# FIXME: Review licenses at some point |
15 |
LICENSE="GPL-3+ GPL-2+ LGPL-3+ LGPL-2+ MIT CC-BY-SA-3.0 CC0-1.0" |
16 |
SLOT="0" |
17 |
KEYWORDS="amd64" |
18 |
IUSE="clang rust-analyzer doc +d-spy flatpak +git gtk-doc spell +sysprof test +webkit" |
19 |
REQUIRED_USE=" |
20 |
${PYTHON_REQUIRED_USE} |
21 |
flatpak? ( git ) |
22 |
" |
23 |
|
24 |
# When bumping, pay attention to all the included plugins/*/meson.build (and other) build files and the requirements within. |
25 |
# `grep -rI dependency * --include='meson.build'` can give a good initial idea for external deps and their double checking. |
26 |
# The listed RDEPEND order should roughly match that output as well, with toplevel one first then sorted by file path. |
27 |
# Most plugins have no extra requirements and default to enabled; we need to handle the ones with extra requirements. Many of |
28 |
# them have optional runtime dependencies, for which we try to at least notify the user via DOC_CONTENTS (but not all small |
29 |
# things); `grep -rI -e 'command-pattern.*=' -e 'push_arg'` can give a (spammy) idea, plus python imports in try/except. |
30 |
|
31 |
# Editorconfig needs old pcre, with vte migrating away, might want it optional or ported to pcre2? |
32 |
# An introspection USE flag of a dep is required if any introspection based language plugin wants to use it (grep for gi.repository). Last full check at 3.28.4 |
33 |
|
34 |
# TODO: Handle llvm slots via llvm.eclass; see plugins/clang/meson.build |
35 |
RDEPEND=" |
36 |
>=dev-libs/glib-2.75.0:2 |
37 |
>=gui-libs/gtk-4.10:4[introspection] |
38 |
>=gui-libs/libadwaita-1.4.0:1 |
39 |
>=gui-libs/libpanel-1.1.2:1 |
40 |
>=gui-libs/gtksourceview-5.7.2:5[introspection] |
41 |
>=dev-libs/json-glib-1.2.0 |
42 |
>=dev-libs/jsonrpc-glib-3.43.0:= |
43 |
>=dev-libs/libdex-0.2.0:= |
44 |
>=dev-libs/libpeas-1.99.0[python,${PYTHON_SINGLE_USEDEP}]:2 |
45 |
dev-libs/libportal:=[gtk,introspection] |
46 |
>=dev-libs/template-glib-3.36.1:=[introspection] |
47 |
>=gui-libs/vte-0.70.0:2.91-gtk4[introspection] |
48 |
>=dev-libs/libxml2-2.9.0 |
49 |
webkit? ( >=net-libs/webkit-gtk-2.38.0:6=[introspection] ) |
50 |
>=app-text/cmark-0.29.0:0= |
51 |
d-spy? ( >=dev-util/d-spy-1.4.0:1 ) |
52 |
app-text/editorconfig-core-c |
53 |
flatpak? ( |
54 |
dev-util/ostree |
55 |
>=net-libs/libsoup-3:3.0 |
56 |
>=sys-apps/flatpak-1.10.2 |
57 |
) |
58 |
git? ( |
59 |
dev-libs/libgit2:=[ssh,threads] |
60 |
>=dev-libs/libgit2-glib-1.1.0[ssh] |
61 |
) |
62 |
|
63 |
>=dev-libs/gobject-introspection-1.74.0:= |
64 |
$(python_gen_cond_dep ' |
65 |
>=dev-python/pygobject-3.22.0:3[${PYTHON_USEDEP}] |
66 |
') |
67 |
${PYTHON_DEPS} |
68 |
clang? ( sys-devel/clang:= ) |
69 |
rust-analyzer? ( || ( dev-lang/rust[rust-analyzer] dev-lang/rust-bin[rust-analyzer] ) ) |
70 |
spell? ( |
71 |
app-text/enchant:2 |
72 |
dev-libs/icu:= |
73 |
) |
74 |
sysprof? ( |
75 |
>=dev-util/sysprof-capture-3.46.0:4 |
76 |
>=dev-util/sysprof-3.46.0:0/4 |
77 |
) |
78 |
" |
79 |
DEPEND="${RDEPEND}" |
80 |
# TODO: runtime ctags path finding.. |
81 |
|
82 |
# desktop-file-utils required for tests, but we have it in deptree for xdg update-desktop-database anyway, so be explicit and unconditional |
83 |
# appstream-glib needed for validation with appstream-util with FEATURES=test |
84 |
BDEPEND=" |
85 |
doc? ( |
86 |
$(python_gen_cond_dep ' |
87 |
dev-python/sphinx[${PYTHON_USEDEP}] |
88 |
dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}] |
89 |
') |
90 |
) |
91 |
gtk-doc? ( |
92 |
dev-util/gi-docgen |
93 |
app-text/docbook-xml-dtd:4.3 |
94 |
) |
95 |
test? ( |
96 |
dev-libs/appstream-glib |
97 |
sys-apps/dbus |
98 |
) |
99 |
dev-util/desktop-file-utils |
100 |
dev-util/glib-utils |
101 |
>=sys-devel/gettext-0.19.8 |
102 |
virtual/pkgconfig |
103 |
" |
104 |
|
105 |
DOC_CONTENTS='gnome-builder can use various other dependencies on runtime to provide |
106 |
extra capabilities beyond these expressed via USE flags. Some of these |
107 |
that are currently available with packages include: |
108 |
|
109 |
* dev-util/ctags with exuberant-ctags selected via "eselect ctags" for |
110 |
C, C++, Python, JavaScript, CSS, HTML and Ruby autocompletion, semantic |
111 |
highlighting and symbol resolving support. |
112 |
* dev-python/python-lsp-server for more accurate Python |
113 |
autocompletion support. |
114 |
* dev-util/valgrind for integration with valgrind. |
115 |
* dev-util/meson for integration with the Meson build system. |
116 |
* virtual/rust for integration with the Rust Cargo build system. |
117 |
* dev-util/cmake for integration with the CMake build system. |
118 |
* net-libs/nodejs[npm] for integration with the NPM package system. |
119 |
' |
120 |
# FIXME: Package codespell and mention here |
121 |
# FIXME: Package gnome-code-assistance and mention here, or maybe USE flag and default enable because it's rather important |
122 |
# eslint for additional diagnostics in JavaScript files (what package has this? At least something via NPM..) |
123 |
# jhbuild support |
124 |
# rust support via rust-analyzer; Go via go-langserver |
125 |
# autotools stuff for autotools plugin; gtkmm/autoconf-archive for C++ template |
126 |
# gjs/gettext/mono/PHPize stuff, but most of these are probably installed for other reasons anyways, when needed inside IDE |
127 |
# stylelint for stylesheet (CSS and co) linting |
128 |
# gvls for vala language-server integration |
129 |
|
130 |
llvm_check_deps() { |
131 |
has_version "sys-devel/clang:${LLVM_SLOT}" |
132 |
} |
133 |
|
134 |
pkg_setup() { |
135 |
python-single-r1_pkg_setup |
136 |
use clang && llvm_pkg_setup |
137 |
} |
138 |
|
139 |
src_configure() { |
140 |
local emesonargs=( |
141 |
-Dchannel=other |
142 |
|
143 |
-Ddevelopment=false |
144 |
-Dtracing=false |
145 |
-Dprofiling=false # not passing -pg to CFLAGS |
146 |
-Dtcmalloc=false |
147 |
-Dwith_safe_path='' |
148 |
-Dgnome_sdk_version=master |
149 |
$(meson_use doc help) |
150 |
$(meson_use gtk-doc docs) |
151 |
-Dnetwork_tests=false |
152 |
-Dctags_path='' |
153 |
$(meson_feature webkit) |
154 |
|
155 |
-Dplugin_autotools=true |
156 |
-Dplugin_bash_language_server=true |
157 |
-Dplugin_blueprint=true |
158 |
-Dplugin_buildstream=true |
159 |
-Dplugin_c_pack=true |
160 |
-Dplugin_cargo=true |
161 |
$(meson_use clang plugin_clang) |
162 |
$(meson_use clang plugin_clangd) |
163 |
$(meson_use clang plugin_clang_format) |
164 |
-Dplugin_cmake=true |
165 |
-Dplugin_codesearch=true |
166 |
-Dplugin_codeshot=true |
167 |
-Dplugin_codespell=true |
168 |
-Dplugin_code_index=true |
169 |
-Dplugin_copyright=true |
170 |
-Dplugin_ctags=true |
171 |
-Dplugin_deviced=false # libdeviced not packaged? |
172 |
$(meson_use d-spy plugin_dspy) |
173 |
-Dplugin_dub=true |
174 |
-Dplugin_editorconfig=true |
175 |
-Dplugin_eslint=true |
176 |
-Dplugin_file_search=true |
177 |
$(meson_use flatpak plugin_flatpak) |
178 |
-Dplugin_gdb=true |
179 |
-Dplugin_gdiagnose=true |
180 |
-Dplugin_gettext=true |
181 |
$(meson_use git plugin_git) |
182 |
-Dplugin_glsl_language_server=true |
183 |
-Dplugin_golang=true |
184 |
-Dplugin_gopls=true |
185 |
-Dplugin_gradle=true |
186 |
-Dplugin_grep=true |
187 |
-Dplugin_hadolint=true |
188 |
-Dplugin_html_completion=true |
189 |
$(meson_use webkit plugin_html_preview) |
190 |
-Dplugin_intelephense=true |
191 |
-Dplugin_jdtls=true |
192 |
-Dplugin_jedi_language_server=false |
193 |
-Dplugin_jhbuild=true |
194 |
-Dplugin_lua_language_server=true |
195 |
-Dplugin_make=true |
196 |
-Dplugin_make_templates=true |
197 |
$(meson_use webkit plugin_markdown_preview) |
198 |
$(meson_use webkit plugin_markdown_indenter) |
199 |
-Dplugin_maven=true |
200 |
-Dplugin_meson=true |
201 |
-Dplugin_meson_templates=true |
202 |
-Dplugin_modelines=true |
203 |
-Dplugin_mono=true |
204 |
-Dplugin_newcomers=true |
205 |
-Dplugin_notification=true |
206 |
-Dplugin_npm=true |
207 |
-Dplugin_phpize=true |
208 |
-Dplugin_podman=true |
209 |
-Dplugin_pygi=true |
210 |
-Dplugin_python_lsp_server=true |
211 |
-Dplugin_qemu=true |
212 |
-Dplugin_quick_highlight=true |
213 |
-Dplugin_retab=true |
214 |
-Dplugin_rstcheck=true |
215 |
-Dplugin_rubocop=true |
216 |
$(meson_use rust-analyzer rust_analyzer) |
217 |
-Dplugin_serve_d=true |
218 |
-Dplugin_shellcheck=true |
219 |
-Dplugin_shellcmd=true |
220 |
-Dplugin_sourcekit_lsp=true |
221 |
$(meson_use spell plugin_spellcheck) |
222 |
$(meson_use webkit plugin_sphinx_preview) |
223 |
-Dplugin_stylelint=true |
224 |
-Dplugin_swift=true |
225 |
-Dplugin_swiftformat=true |
226 |
-Dplugin_swiftlint=true |
227 |
$(meson_use sysprof plugin_sysprof) |
228 |
-Dplugin_todo=true |
229 |
-Dplugin_ts_language_server=true |
230 |
-Dplugin_update_manager=true |
231 |
-Dplugin_valac=true |
232 |
-Dplugin_vala_indenter=true |
233 |
-Dplugin_vala_language_server=true |
234 |
-Dplugin_valgrind=true |
235 |
-Dplugin_waf=true |
236 |
-Dplugin_words=true |
237 |
-Dplugin_xml_pack=true |
238 |
-Dplugin_zls=true |
239 |
) |
240 |
meson_src_configure |
241 |
} |
242 |
|
243 |
src_install() { |
244 |
meson_src_install |
245 |
python_optimize |
246 |
if use doc; then |
247 |
rm "${ED}"/usr/share/doc/gnome-builder/en/.buildinfo || die |
248 |
rm "${ED}"/usr/share/doc/gnome-builder/en/objects.inv || die |
249 |
# custom docdir in build system, blocked by https://github.com/mesonbuild/meson/issues/825 |
250 |
mv "${ED}"/usr/share/doc/gnome-builder/en "${ED}"/usr/share/doc/${PF}/html || die |
251 |
# _sources subdir left in on purpose, as HTML links to the rst files as "View page source". Additionally default docompress exclusion of /html/ already ensures they aren't compressed, thus linkable as-is. |
252 |
rmdir "${ED}"/usr/share/doc/gnome-builder/ || die |
253 |
fi |
254 |
readme.gentoo_create_doc |
255 |
} |
256 |
|
257 |
pkg_postinst() { |
258 |
xdg_pkg_postinst |
259 |
gnome2_schemas_update |
260 |
readme.gentoo_print_elog |
261 |
|
262 |
optfeature_header "Language support" |
263 |
optfeature "Rust's Cargo build system" virtual/rust |
264 |
optfeature "CMake" dev-util/cmake |
265 |
optfeature "Java Maven build system" dev-java/maven-bin |
266 |
optfeature "Meson Build system" dev-util/meson |
267 |
} |
268 |
|
269 |
pkg_postrm() { |
270 |
xdg_pkg_postrm |
271 |
gnome2_schemas_update |
272 |
} |
273 |
|
274 |
src_test() { |
275 |
virtx dbus-run-session meson test -C "${BUILD_DIR}" |
276 |
} |