[tracker-miners/sam/libav-ffmpeg: 2/2] build: Remove charset_detection=auto build time option
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/libav-ffmpeg: 2/2] build: Remove charset_detection=auto build time option
- Date: Tue, 30 Aug 2022 17:19:36 +0000 (UTC)
commit 72088eecdfec28a42cc907bd2419a3e63b75459a
Author: Sam Thursfield <sam thursfield codethink co uk>
Date: Tue Aug 30 19:02:02 2022 +0200
build: Remove charset_detection=auto build time option
Our preferred backend is libicu, this is now the default. Systems where
libicu is not available can opt into enca explicitly.
For rationale: https://blogs.gnome.org/mcatanzaro/2022/07/15/best-practices-for-build-options/
meson.build | 55 ++++++++++++++++++++-----------------------------------
meson_options.txt | 2 +-
2 files changed, 21 insertions(+), 36 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4bf2983e6..3fcbbb106 100644
--- a/meson.build
+++ b/meson.build
@@ -64,8 +64,6 @@ gstreamer_audio = dependency('gstreamer-audio-1.0', required: false)
gstreamer_tag = dependency('gstreamer-tag-1.0', required: false)
gupnp_dlna = dependency('gupnp-dlna-2.0', version: '>= 0.9.4', required: false)
gupnp_dlna_gst = dependency('gupnp-dlna-gst-2.0', version: '>= 0.9.4', required: false)
-icu_i18n = dependency('icu-i18n', version: '>= 4.8.1.1', required: false)
-icu_uc = dependency('icu-uc', version: '>= 4.8.1.1', required: false)
libcue = dependency('libcue', version: '>= 2.0.0', required: get_option('cue'))
libexif = dependency('libexif', version: '>= 0.6', required: get_option('exif'))
libgsf = dependency('libgsf-1', version: '>= 1.14.24', required: get_option('gsf'))
@@ -185,41 +183,28 @@ endif
##########################################################################
# Check for tracker-extract: icu or enca for detecting Cyrillic in MP3s
-#
-# By default, AUTO with this order of preference:
-# 1) icu
-# 2) enca
##########################################################################
-charset_library_name = 'none'
-have_libicu = false
-
-if icu_i18n.found() and icu_uc.found()
- have_libicu = true
-endif
-
-if have_libicu
- if get_option('charset_detection') == 'auto' or get_option('charset_detection') == 'icu'
- charset_library = declare_dependency(
- dependencies: [icu_uc, icu_i18n]
- )
- charset_library_name = 'icu'
- endif
-else
- if get_option('charset_detection') == 'icu'
- error('libicu requested for character set detection, but it was not found')
- endif
-endif
-
-if charset_library_name == 'none' and get_option('charset_detection') != 'none'
- enca = dependency('enca', version: '>= 1.9', required: false)
-
- if enca.found()
- charset_library = enca
- charset_library_name = 'enca'
- elif get_option('enca') == 'yes'
- error('enca support explicitly requested, but enca couldn\'t be found')
- endif
+charset_library_help = 'You can use the "charset_detection" config option to select a different backend or
set `-Dcharset_detection=none` to disable this feature.'
+charset_library_name = get_option('charset_detection')
+
+if charset_library_name == 'icu'
+ icu_i18n = dependency('icu-i18n',
+ version: '>= 4.8.1.1',
+ not_found_message: charset_library_help)
+ icu_uc = dependency('icu-uc',
+ version: '>= 4.8.1.1',
+ not_found_message: charset_library_help)
+
+ charset_library = declare_dependency(
+ dependencies: [icu_uc, icu_i18n]
+ )
+elif charset_library_name == 'enca'
+ enca = dependency('enca',
+ version: '>= 1.9',
+ not_found_message: charset_library_help)
+
+ charset_library = enca
endif
####################################################################
diff --git a/meson_options.txt b/meson_options.txt
index c59ee7ee9..9bd367f50 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -76,7 +76,7 @@ option('xps', type: 'feature', value: 'auto',
option('battery_detection', type: 'combo', choices: ['upower', 'hal', 'none'], value: 'upower',
description: 'Enable upower or HAL for battery/mains power detection')
-option('charset_detection', type: 'combo', choices: ['auto', 'enca', 'icu', 'none'], value: 'auto',
+option('charset_detection', type: 'combo', choices: ['icu', 'enca', 'none'], value: 'icu',
description: 'Enable enca or libicu for charset detection in MP3s')
option('generic_media_extractor', type: 'combo', choices: ['gstreamer', 'libav', 'none'], value: 'gstreamer',
description: 'Enables one of the (gstreamer, libav) generic media extractor backends')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]