You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-editors/gedit/files/3.38-make-gspell-optional.p...

60 lines
1.9 KiB

From 4f32833325a6c95ec451adf1a8d9691cceb14dd8 Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sun, 16 Aug 2020 23:20:31 +0300
Subject: [PATCH 1/2] build: Make gspell optional
---
meson.build | 3 ++-
meson_options.txt | 4 ++++
plugins/spell/meson.build | 4 ++++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index acaad0dad..2c5dccb82 100644
--- a/meson.build
+++ b/meson.build
@@ -54,7 +54,7 @@ deps_basic_list = [
dependency('gobject-introspection-1.0'),
]
-gspell_dep = dependency('gspell-1', version: '>= 1.0')
+gspell_dep = dependency('gspell-1', version: '>= 1.0', required: get_option('spell'))
python3 = python.find_installation('python3')
# Configurations
@@ -94,3 +94,4 @@ summary('Prefix', get_option('prefix'))
summary('API documentation', get_option('gtk_doc'))
summary('User documentation', get_option('user_documentation'))
summary('Require all tests', get_option('require_all_tests'))
+summary('Spell checker plugin', get_option('spell').enabled().to_string())
diff --git a/meson_options.txt b/meson_options.txt
index 4e842d1ea..bb3923dd1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -14,6 +14,10 @@ option(
description: 'Require that all tests can be run, even those that depend on third party programs'
)
+option('spell',
+ type: 'feature', value: 'enabled',
+ description: 'Build spell checking plugin')
+
# This option exists for the developers, to speed up the install.
option(
'user_documentation',
diff --git a/plugins/spell/meson.build b/plugins/spell/meson.build
index 8ce7634b7..cccb42fc1 100644
--- a/plugins/spell/meson.build
+++ b/plugins/spell/meson.build
@@ -1,3 +1,7 @@
+if not gspell_dep.found()
+ subdir_done()
+endif
+
libspell_sources = files(
'gedit-spell-app-activatable.c',
'gedit-spell-plugin.c',
--
2.26.2