Compare commits

...

No commits in common. 'c9' and 'cs10' have entirely different histories.
c9 ... cs10

2
.gitignore vendored

@ -1 +1 @@
SOURCES/gnome-desktop-40.4.tar.xz
SOURCES/gnome-desktop-44.0.tar.xz

@ -1 +1 @@
57a003aa0e4f68fbfb18a56f2b807e145e1f643c SOURCES/gnome-desktop-40.4.tar.xz
2b845227730824c503251c418f2b275283721211 SOURCES/gnome-desktop-44.0.tar.xz

@ -0,0 +1,141 @@
From a7322f90defc31abeee242ad984d5b3debb86f68 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 25 Aug 2023 09:47:47 -0400
Subject: [PATCH 1/4] meson: Add python3 to build scripts
We're going to need to use python3 in a future commit to
query langtable for a list of non-latin input sources.
As prep work for that, add the basic goo needed to get
python3 available from the build system.
---
.gitlab-ci.yml | 2 +-
meson.build | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6d6c7bbc..56962b1c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,49 +1,49 @@
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
image: fedora:latest
variables:
LAST_ABI_BREAK: 0da1fcac914ad4c67f016bda7864c4b153cbfbaa
DEPENDENCIES: gtk3-devel gtk4-devel gsettings-desktop-schemas-devel gettext
gtk-doc libxkbcommon-devel xkeyboard-config-devel itstool
gobject-introspection-devel systemd-devel iso-codes-devel
libseccomp-devel gcc gcc-c++ glibc-devel
- meson redhat-rpm-config
+ meson redhat-rpm-config python3-langtable
TEST_DEPENDENCIES: gnome-desktop-testing xorg-x11-server-Xvfb glibc-langpack-en glibc-langpack-he glibc-langpack-ja abattis-cantarell-fonts libabigail git
build_stable:
before_script:
# Undo delangification present in the Fedora Docker images
- rm -f /etc/rpm/macros.image-language-conf
- echo "reinstall glib2" >> translist.txt
# Work-around https://bugzilla.redhat.com/show_bug.cgi?id=1607172#c4
- echo "update dnf gdbm" >> translist.txt
- echo "remove python3-modulemd" >> translist.txt
- dnf shell -y --nogpgcheck translist.txt
- dnf update -y --nogpgcheck
- dnf install -y --nogpgcheck $DEPENDENCIES
- dnf install -y --nogpgcheck $TEST_DEPENDENCIES
script:
- meson --prefix=/usr -Dinstalled_tests=true build
- pushd build
- ninja
- ninja install
- ninja dist
- G_MESSAGES_DEBUG=all xvfb-run -a -s "-screen 0 1024x768x24" ninja test
- G_MESSAGES_DEBUG=all xvfb-run -a -s "-screen 0 1024x768x24"
gnome-desktop-testing-runner --report-directory=test-results gnome-desktop
- popd
- .ci/check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD)
artifacts:
paths:
- build/meson-logs/
- build/test-results/
when: on_failure
diff --git a/meson.build b/meson.build
index 51a59e33..0419aa3c 100644
--- a/meson.build
+++ b/meson.build
@@ -9,60 +9,63 @@ project('gnome-desktop', 'c',
# Before making a release, the libversion string should be modified.
#
# * Bump the first component if binary compatibility has been broken; or
# * Bump the second component if new APIs are added; or
# * Bump the third component otherwise.
#
# When bumping the first component version, set the second and third components
# to 0. When bumping the second version, set the third one to zero.
#
# A lot easier than libtool, right?
libversion = '2.1.0'
soversion = libversion.split('.')[0]
# Compatibility versions for libgnome-desktop-3
compat_libversion = '20.0.0'
compat_soversion = compat_libversion.split('.')[0]
gdk_pixbuf_req = '>= 2.36.5'
gtk3_req = '>= 3.3.6'
gtk4_req = '>= 4.4.0'
glib_req = '>= 2.53.0'
xrandr_req = '>= 1.3'
schemas_req = '>= 3.27.0'
xext_req = '>= 1.1'
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
+python = import('python')
+python3 = python.find_installation('python3', modules : ['langtable'])
+
prefix = get_option('prefix')
datadir = prefix / get_option('datadir')
libexecdir = prefix / get_option('libexecdir')
liblocaledir = get_option('prefix') / 'lib/locale'
localedir = datadir / 'locale'
test_metadir = datadir / 'installed-tests' / meson.project_name()
test_execdir = libexecdir / 'installed-tests' / meson.project_name()
versiondir = datadir / 'gnome'
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
gtk3_dep = dependency('gtk+-3.0', version: gtk3_req, required: get_option('legacy_library'))
gtk4_dep = dependency('gtk4', version: gtk4_req, required: get_option('build_gtk4'))
glib_dep = dependency('glib-2.0', version: glib_req)
gio_dep = dependency('gio-2.0', version: glib_req)
gio_unix_dep = dependency('gio-unix-2.0', version: glib_req)
schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
fontconfig_dep = dependency('fontconfig')
xkb_config_dep = dependency('xkeyboard-config')
xkbregistry_dep = dependency('xkbregistry', required: false)
iso_codes_dep = dependency('iso-codes')
libsystemd_dep = dependency('libsystemd', required: get_option('systemd'))
udev_dep = dependency('libudev', required: get_option('udev'))
# Check for bubblewrap compatible platform
host_os = host_machine.system()
host_cpu = host_machine.cpu()
supported_os = ['linux']
unsupported_cpus = ['alpha', 'ia64', 'm68k', 'sh4', 'sparc', 'sparc64']
--
2.41.0

@ -0,0 +1,428 @@
From 242308344cceca729148507d787f130151b44ea0 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 24 Aug 2023 17:37:37 -0400
Subject: [PATCH 2/4] gnome-languages: Add function to detect non-latin layouts
If user chooses "Russian" we need to add "us" as well so they have
a way to input latin characters.
This commit adds a function to detect layouts that need supplemental
layouts to tag along.
---
.../generate-non-latin-input-sources.py | 44 +++++++++++++++++++
libgnome-desktop/gnome-languages.c | 30 +++++++++++++
libgnome-desktop/gnome-languages.h | 2 +
libgnome-desktop/meson.build | 7 +++
4 files changed, 83 insertions(+)
create mode 100644 libgnome-desktop/generate-non-latin-input-sources.py
diff --git a/libgnome-desktop/generate-non-latin-input-sources.py b/libgnome-desktop/generate-non-latin-input-sources.py
new file mode 100644
index 00000000..d2b84f08
--- /dev/null
+++ b/libgnome-desktop/generate-non-latin-input-sources.py
@@ -0,0 +1,44 @@
+import langtable
+
+import locale
+import re
+
+if hasattr(langtable, 'list_all_keyboards'):
+ keyboards = langtable.list_all_keyboards()
+else:
+ from langtable.langtable import _keyboards_db
+ keyboards = _keyboards_db.keys()
+
+non_latin_keyboards = {}
+
+for keyboard in keyboards:
+ # Check if the keyboard supports ASCII
+ if not langtable.supports_ascii(keyboardId=keyboard):
+ input_source = re.sub(r'\((.*?)\)', r'+\1', keyboard)
+ non_latin_keyboards[input_source] = 'xkb'
+
+sorted_non_latin_keyboards = sorted(non_latin_keyboards.items(), key=lambda x: x[0])
+
+header_prolog = '''
+typedef struct
+{
+ char *type;
+ char *id;
+} InputSource;
+
+static InputSource non_latin_input_sources[] =
+{
+'''
+
+header_epilog = '''
+};
+'''
+
+with open('non-latin-input-sources.h', 'w') as file:
+ file.write(header_prolog)
+
+ for keyboard, type in sorted_non_latin_keyboards:
+ file.write(f' {{ "{type}", "{keyboard}" }},\n')
+ file.write(" { NULL, NULL },")
+
+ file.write(header_epilog)
diff --git a/libgnome-desktop/gnome-languages.c b/libgnome-desktop/gnome-languages.c
index 8a0485c8..3bd4823f 100644
--- a/libgnome-desktop/gnome-languages.c
+++ b/libgnome-desktop/gnome-languages.c
@@ -26,60 +26,61 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <langinfo.h>
#include <sys/stat.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#ifdef HAVE_XLOCALE
#include <xlocale.h>
#endif
#include "gnome-gettext-portable.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include "gnome-languages.h"
#include <langinfo.h>
#ifndef __LC_LAST
#define __LC_LAST 13
#endif
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
#include "default-input-sources.h"
+#include "non-latin-input-sources.h"
typedef struct _GnomeLocale {
char *id;
char *name;
char *language_code;
char *territory_code;
char *codeset;
char *modifier;
} GnomeLocale;
static GHashTable *gnome_languages_map;
static GHashTable *gnome_territories_map;
static GHashTable *gnome_available_locales_map;
static GHashTable *gnome_language_count_map;
static GHashTable *gnome_territory_count_map;
static char * construct_language_name (const char *language,
const char *territory,
const char *codeset,
const char *modifier);
static gboolean language_name_is_valid (const char *language_name);
static void
gnome_locale_free (GnomeLocale *locale)
{
if (locale == NULL) {
return;
}
@@ -1417,30 +1418,59 @@ gnome_get_input_source_from_locale (const char *locale,
DefaultInputSource *dis;
g_autofree gchar *l_code = NULL;
g_autofree gchar *c_code = NULL;
g_autofree gchar *key = NULL;
gint i;
g_return_val_if_fail (locale != NULL, FALSE);
g_return_val_if_fail (type != NULL, FALSE);
g_return_val_if_fail (id != NULL, FALSE);
if (!table) {
table = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; default_input_sources[i].id; ++i) {
dis = &default_input_sources[i];
g_hash_table_insert (table, (gpointer) dis->locale, dis);
}
}
if (!gnome_parse_locale (locale, &l_code, &c_code, NULL, NULL))
return FALSE;
key = g_strconcat (l_code, "_", c_code, NULL);
dis = g_hash_table_lookup (table, key);
if (dis) {
*type = dis->type;
*id = dis->id;
}
return dis != NULL;
}
+
+/**
+ * gnome_input_source_is_non_latin:
+ * @type: an input source type (e.g., "xkb" or "ibus")
+ * @id: an input source id (e.g., "us+dvorak" or "anthy")
+ *
+ * Returns whether or not the input source has the ability to enter latin characters.
+ *
+ * Return value: %TRUE if it can't enter latin characters
+ *
+ * Since: 46
+ */
+gboolean
+gnome_input_source_is_non_latin (const char *type,
+ const char *id)
+{
+ size_t i;
+
+ for (i = 0; non_latin_input_sources[i].type != NULL; i++) {
+ if (g_strcmp0 (type, non_latin_input_sources[i].type) != 0)
+ continue;
+
+ if (g_strcmp0 (id, non_latin_input_sources[i].id) != 0)
+ continue;
+
+ return TRUE;
+ }
+ return FALSE;
+}
diff --git a/libgnome-desktop/gnome-languages.h b/libgnome-desktop/gnome-languages.h
index ed0935c8..ed9242e7 100644
--- a/libgnome-desktop/gnome-languages.h
+++ b/libgnome-desktop/gnome-languages.h
@@ -27,33 +27,35 @@
#error This is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API before including gnome-languages.h
#endif
#include <glib.h>
#include <libgnome-desktop/gnome-desktop-version.h>
G_BEGIN_DECLS
char * gnome_get_language_from_locale (const char *locale,
const char *translation);
char * gnome_get_country_from_locale (const char *locale,
const char *translation);
char ** gnome_get_all_locales (void);
gboolean gnome_parse_locale (const char *locale,
char **language_codep,
char **country_codep,
char **codesetp,
char **modifierp);
char * gnome_normalize_locale (const char *locale);
gboolean gnome_language_has_translations (const char *code);
char * gnome_get_language_from_code (const char *code,
const char *translation);
char * gnome_get_country_from_code (const char *code,
const char *translation);
char * gnome_get_translated_modifier (const char *modifier,
const char *translation);
gboolean gnome_get_input_source_from_locale (const char *locale,
const char **type,
const char **id);
+gboolean gnome_input_source_is_non_latin (const char *type,
+ const char *id);
G_END_DECLS
#endif /* __GNOME_LANGUAGES_H */
diff --git a/libgnome-desktop/meson.build b/libgnome-desktop/meson.build
index 708a4ae8..d41e0cc0 100644
--- a/libgnome-desktop/meson.build
+++ b/libgnome-desktop/meson.build
@@ -28,118 +28,124 @@ conf.set('HAVE_USELOCALE', cc.has_function('uselocale'))
conf.set('HAVE_XLOCALE', cc.has_header('xlocale.h'))
configure_file(
output: 'config.h',
configuration: conf,
)
version_conf = configuration_data()
version_array = meson.project_version().split('.')
version_conf.set('GNOME_PLATFORM', version_array[0])
gnome_desktop_header_file = configure_file(
input: 'gnome-desktop-version.h.in',
output: 'gnome-desktop-version.h',
configuration: version_conf,
)
dbus_xrandr_built_sources = gnome.gdbus_codegen('meta-dbus-xrandr',
'xrandr.xml',
namespace: 'MetaDBus',
interface_prefix: 'org.gnome.Mutter'
)
dbus_idle_built_sources = gnome.gdbus_codegen('meta-dbus-idle-monitor',
'idle-monitor.xml',
namespace: 'MetaDBus',
interface_prefix: 'org.gnome.Mutter',
object_manager: true
)
+non_latin_input_sources = custom_target('generate_non_latin_input_sources_header',
+ output : 'non-latin-input-sources.h',
+ command : [python3, files ('generate-non-latin-input-sources.py')]
+)
+
base_ldflags = []
base_symbol_map = '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'base-symbol.map')
if cc.has_link_argument(base_symbol_map)
base_ldflags += base_symbol_map
endif
### gnome-desktop-base
libgnome_desktop_base_sources = [
'gnome-desktop-version.c',
'gnome-desktop-thumbnail.c',
'gnome-idle-monitor.c',
'gnome-languages.c',
'gnome-pnp-ids.c',
'gnome-systemd.c',
'gnome-wall-clock.c',
'gnome-xkb-info.c',
]
libgnome_desktop_base_private_sources = [
'gnome-datetime-source.c',
'gnome-desktop-thumbnail-script.c',
'gnome-gettext-portable.c',
]
libgnome_desktop_base_headers = [
gnome_desktop_header_file,
'gnome-desktop-thumbnail.h',
'gnome-idle-monitor.h',
'gnome-languages.h',
'gnome-pnp-ids.h',
'gnome-systemd.h',
'gnome-wall-clock.h',
'gnome-xkb-info.h',
]
if get_option('build_gtk4')
install_headers(libgnome_desktop_base_headers,
subdir: 'gnome-desktop-4.0/libgnome-desktop'
)
base_deps = [
gdk_pixbuf_dep,
glib_dep,
gio_dep,
gio_unix_dep,
libsystemd_dep,
schemas_dep,
xkb_config_dep,
xkbregistry_dep,
iso_codes_dep,
udev_dep,
seccomp_dep,
m_dep,
rt_dep,
]
libgnome_desktop_base = library('gnome-desktop-4',
sources: [
+ non_latin_input_sources,
libgnome_desktop_base_sources,
libgnome_desktop_base_private_sources,
dbus_idle_built_sources,
],
dependencies: base_deps,
soversion: soversion,
version: libversion,
c_args: libargs,
link_args: base_ldflags,
install: true,
include_directories: [
include_directories('.'),
include_directories('..'),
],
)
if get_option('introspection')
libgnome_desktop_base_gir = gnome.generate_gir(libgnome_desktop_base,
sources: [libgnome_desktop_base_headers, libgnome_desktop_base_sources],
export_packages: 'gnome-desktop-4',
namespace: 'GnomeDesktop',
nsversion: '4.0',
includes: ['GObject-2.0', 'Gio-2.0', 'GDesktopEnums-3.0', 'GdkPixbuf-2.0'],
extra_args: ['-DGNOME_DESKTOP_USE_UNSTABLE_API', '--quiet', '--warn-all'],
identifier_prefix: 'Gnome',
symbol_prefix: 'gnome',
install: true,
)
endif
@@ -162,60 +168,61 @@ if get_option('build_gtk4')
include_directories: [
include_directories('.'),
include_directories('..'),
],
)
subdir('gnome-bg')
subdir('gnome-rr')
endif
### Legacy ###
if get_option('legacy_library')
introspection_sources = [
'gnome-desktop-version.c',
'gnome-desktop-thumbnail.c',
'gnome-bg.c',
'gnome-bg-slide-show.c',
'gnome-bg-crossfade.c',
'gnome-rr.c',
'gnome-rr-config.c',
'gnome-rr-output-info.c',
'gnome-systemd.c',
'gnome-pnp-ids.c',
'gnome-wall-clock.c',
'gnome-xkb-info.c',
'gnome-idle-monitor.c',
'gnome-languages.c',
]
libgnome_desktop_sources = [
+ non_latin_input_sources,
introspection_sources,
dbus_xrandr_built_sources,
dbus_idle_built_sources,
'gnome-datetime-source.c',
'gnome-desktop-thumbnail-script.c',
'gnome-gettext-portable.c',
]
libgnome_desktop_headers = [
gnome_desktop_header_file,
'gnome-bg.h',
'gnome-bg-crossfade.h',
'gnome-bg-slide-show.h',
'gnome-desktop-thumbnail.h',
'gnome-rr.h',
'gnome-rr-config.h',
'gnome-systemd.h',
'gnome-pnp-ids.h',
'gnome-wall-clock.h',
'gnome-xkb-info.h',
'gnome-idle-monitor.h',
'gnome-languages.h',
]
install_headers(libgnome_desktop_headers,
subdir: 'gnome-desktop-3.0/libgnome-desktop'
)
gnome_desktop_deps = [
gdk_pixbuf_dep,
--
2.41.0

@ -0,0 +1,257 @@
From 185c1f7541ee44095ec5d9348298510e28e37f2c Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 24 Aug 2023 17:43:00 -0400
Subject: [PATCH 3/4] meson: Add codegen for localed
We're going to need to be querying localed for input source information.
This commit paves the way for that by generating proxy glue code for
talking to localed.
---
libgnome-desktop/meson.build | 8 +++++
libgnome-desktop/org.freedesktop.locale1.xml | 38 ++++++++++++++++++++
2 files changed, 46 insertions(+)
create mode 100644 libgnome-desktop/org.freedesktop.locale1.xml
diff --git a/libgnome-desktop/meson.build b/libgnome-desktop/meson.build
index d41e0cc0..164fd2ff 100644
--- a/libgnome-desktop/meson.build
+++ b/libgnome-desktop/meson.build
@@ -28,60 +28,66 @@ conf.set('HAVE_USELOCALE', cc.has_function('uselocale'))
conf.set('HAVE_XLOCALE', cc.has_header('xlocale.h'))
configure_file(
output: 'config.h',
configuration: conf,
)
version_conf = configuration_data()
version_array = meson.project_version().split('.')
version_conf.set('GNOME_PLATFORM', version_array[0])
gnome_desktop_header_file = configure_file(
input: 'gnome-desktop-version.h.in',
output: 'gnome-desktop-version.h',
configuration: version_conf,
)
dbus_xrandr_built_sources = gnome.gdbus_codegen('meta-dbus-xrandr',
'xrandr.xml',
namespace: 'MetaDBus',
interface_prefix: 'org.gnome.Mutter'
)
dbus_idle_built_sources = gnome.gdbus_codegen('meta-dbus-idle-monitor',
'idle-monitor.xml',
namespace: 'MetaDBus',
interface_prefix: 'org.gnome.Mutter',
object_manager: true
)
+dbus_localed_built_sources = gnome.gdbus_codegen('sd-locale1',
+ 'org.freedesktop.locale1.xml',
+ namespace: 'SdDBus',
+ interface_prefix: 'org.freedesktop',
+)
+
non_latin_input_sources = custom_target('generate_non_latin_input_sources_header',
output : 'non-latin-input-sources.h',
command : [python3, files ('generate-non-latin-input-sources.py')]
)
base_ldflags = []
base_symbol_map = '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'base-symbol.map')
if cc.has_link_argument(base_symbol_map)
base_ldflags += base_symbol_map
endif
### gnome-desktop-base
libgnome_desktop_base_sources = [
'gnome-desktop-version.c',
'gnome-desktop-thumbnail.c',
'gnome-idle-monitor.c',
'gnome-languages.c',
'gnome-pnp-ids.c',
'gnome-systemd.c',
'gnome-wall-clock.c',
'gnome-xkb-info.c',
]
libgnome_desktop_base_private_sources = [
'gnome-datetime-source.c',
'gnome-desktop-thumbnail-script.c',
'gnome-gettext-portable.c',
]
libgnome_desktop_base_headers = [
@@ -95,60 +101,61 @@ libgnome_desktop_base_headers = [
'gnome-xkb-info.h',
]
if get_option('build_gtk4')
install_headers(libgnome_desktop_base_headers,
subdir: 'gnome-desktop-4.0/libgnome-desktop'
)
base_deps = [
gdk_pixbuf_dep,
glib_dep,
gio_dep,
gio_unix_dep,
libsystemd_dep,
schemas_dep,
xkb_config_dep,
xkbregistry_dep,
iso_codes_dep,
udev_dep,
seccomp_dep,
m_dep,
rt_dep,
]
libgnome_desktop_base = library('gnome-desktop-4',
sources: [
non_latin_input_sources,
libgnome_desktop_base_sources,
libgnome_desktop_base_private_sources,
dbus_idle_built_sources,
+ dbus_localed_built_sources,
],
dependencies: base_deps,
soversion: soversion,
version: libversion,
c_args: libargs,
link_args: base_ldflags,
install: true,
include_directories: [
include_directories('.'),
include_directories('..'),
],
)
if get_option('introspection')
libgnome_desktop_base_gir = gnome.generate_gir(libgnome_desktop_base,
sources: [libgnome_desktop_base_headers, libgnome_desktop_base_sources],
export_packages: 'gnome-desktop-4',
namespace: 'GnomeDesktop',
nsversion: '4.0',
includes: ['GObject-2.0', 'Gio-2.0', 'GDesktopEnums-3.0', 'GdkPixbuf-2.0'],
extra_args: ['-DGNOME_DESKTOP_USE_UNSTABLE_API', '--quiet', '--warn-all'],
identifier_prefix: 'Gnome',
symbol_prefix: 'gnome',
install: true,
)
endif
pkg.generate(
libgnome_desktop_base,
requires: ['gsettings-desktop-schemas'],
@@ -172,60 +179,61 @@ if get_option('build_gtk4')
)
subdir('gnome-bg')
subdir('gnome-rr')
endif
### Legacy ###
if get_option('legacy_library')
introspection_sources = [
'gnome-desktop-version.c',
'gnome-desktop-thumbnail.c',
'gnome-bg.c',
'gnome-bg-slide-show.c',
'gnome-bg-crossfade.c',
'gnome-rr.c',
'gnome-rr-config.c',
'gnome-rr-output-info.c',
'gnome-systemd.c',
'gnome-pnp-ids.c',
'gnome-wall-clock.c',
'gnome-xkb-info.c',
'gnome-idle-monitor.c',
'gnome-languages.c',
]
libgnome_desktop_sources = [
non_latin_input_sources,
introspection_sources,
dbus_xrandr_built_sources,
dbus_idle_built_sources,
+ dbus_localed_built_sources,
'gnome-datetime-source.c',
'gnome-desktop-thumbnail-script.c',
'gnome-gettext-portable.c',
]
libgnome_desktop_headers = [
gnome_desktop_header_file,
'gnome-bg.h',
'gnome-bg-crossfade.h',
'gnome-bg-slide-show.h',
'gnome-desktop-thumbnail.h',
'gnome-rr.h',
'gnome-rr-config.h',
'gnome-systemd.h',
'gnome-pnp-ids.h',
'gnome-wall-clock.h',
'gnome-xkb-info.h',
'gnome-idle-monitor.h',
'gnome-languages.h',
]
install_headers(libgnome_desktop_headers,
subdir: 'gnome-desktop-3.0/libgnome-desktop'
)
gnome_desktop_deps = [
gdk_pixbuf_dep,
gtk3_dep,
glib_dep,
gio_dep,
diff --git a/libgnome-desktop/org.freedesktop.locale1.xml b/libgnome-desktop/org.freedesktop.locale1.xml
new file mode 100644
index 00000000..bc23d3a1
--- /dev/null
+++ b/libgnome-desktop/org.freedesktop.locale1.xml
@@ -0,0 +1,38 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
+"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.locale1">
+ <property name="Locale" type="as" access="read">
+ </property>
+ <property name="X11Layout" type="s" access="read">
+ </property>
+ <property name="X11Model" type="s" access="read">
+ </property>
+ <property name="X11Variant" type="s" access="read">
+ </property>
+ <property name="X11Options" type="s" access="read">
+ </property>
+ <property name="VConsoleKeymap" type="s" access="read">
+ </property>
+ <property name="VConsoleKeymapToggle" type="s" access="read">
+ </property>
+ <method name="SetLocale">
+ <arg type="as" direction="in"/>
+ <arg type="b" direction="in"/>
+ </method>
+ <method name="SetVConsoleKeyboard">
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="b" direction="in"/>
+ <arg type="b" direction="in"/>
+ </method>
+ <method name="SetX11Keyboard">
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="s" direction="in"/>
+ <arg type="b" direction="in"/>
+ <arg type="b" direction="in"/>
+ </method>
+ </interface>
+</node>
--
2.41.0

@ -0,0 +1,561 @@
From f9dc0fefa8abfe37ea2029fefb6e49c2f3a0a696 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Thu, 24 Aug 2023 19:58:17 -0400
Subject: [PATCH 4/4] languages: Add functions for getting default input
sources
The code to get the default input sources would otherwise need
to be duplicated across control-center, gnome-shell and
gnome-initial-setup.
This commit avoids some of that redundancy by consolidating the
logic into two new functions:
gnome_get_default_input_sources and
gnome_get_default_input_sources_finish
Note, these functions don't provide change notification, so there
is still some redundancy needed by callers.
---
libgnome-desktop/gnome-languages.c | 341 +++++++++++++++++++++++++++++
libgnome-desktop/gnome-languages.h | 11 +
2 files changed, 352 insertions(+)
diff --git a/libgnome-desktop/gnome-languages.c b/libgnome-desktop/gnome-languages.c
index 3bd4823f..5d6c8b94 100644
--- a/libgnome-desktop/gnome-languages.c
+++ b/libgnome-desktop/gnome-languages.c
@@ -16,81 +16,89 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Written by : William Jon McCann <mccann@jhu.edu>
* Ray Strode <rstrode@redhat.com>
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <langinfo.h>
#include <sys/stat.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#ifdef HAVE_XLOCALE
#include <xlocale.h>
#endif
#include "gnome-gettext-portable.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include "gnome-languages.h"
+#include "gnome-xkb-info.h"
+
+#include "sd-locale1.h"
#include <langinfo.h>
#ifndef __LC_LAST
#define __LC_LAST 13
#endif
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
#include "default-input-sources.h"
#include "non-latin-input-sources.h"
typedef struct _GnomeLocale {
char *id;
char *name;
char *language_code;
char *territory_code;
char *codeset;
char *modifier;
} GnomeLocale;
+typedef struct _GnomeInputSourceDefaults {
+ InputSource **input_sources;
+ char **options;
+} GnomeInputSourceDefaults;
+
static GHashTable *gnome_languages_map;
static GHashTable *gnome_territories_map;
static GHashTable *gnome_available_locales_map;
static GHashTable *gnome_language_count_map;
static GHashTable *gnome_territory_count_map;
static char * construct_language_name (const char *language,
const char *territory,
const char *codeset,
const char *modifier);
static gboolean language_name_is_valid (const char *language_name);
static void
gnome_locale_free (GnomeLocale *locale)
{
if (locale == NULL) {
return;
}
g_free (locale->id);
g_free (locale->name);
g_free (locale->codeset);
g_free (locale->modifier);
g_free (locale->language_code);
g_free (locale->territory_code);
g_free (locale);
}
static char *
@@ -1447,30 +1455,363 @@ gnome_get_input_source_from_locale (const char *locale,
}
/**
* gnome_input_source_is_non_latin:
* @type: an input source type (e.g., "xkb" or "ibus")
* @id: an input source id (e.g., "us+dvorak" or "anthy")
*
* Returns whether or not the input source has the ability to enter latin characters.
*
* Return value: %TRUE if it can't enter latin characters
*
* Since: 46
*/
gboolean
gnome_input_source_is_non_latin (const char *type,
const char *id)
{
size_t i;
for (i = 0; non_latin_input_sources[i].type != NULL; i++) {
if (g_strcmp0 (type, non_latin_input_sources[i].type) != 0)
continue;
if (g_strcmp0 (id, non_latin_input_sources[i].id) != 0)
continue;
return TRUE;
}
return FALSE;
}
+
+static void
+on_got_localed_proxy (GObject *object,
+ GAsyncResult *result,
+ GTask *sub_task)
+{
+ g_autoptr(SdDBusLocale1) proxy = NULL;
+ g_autoptr(GError) error = NULL;
+
+ proxy = sd_dbus_locale1_proxy_new_finish (result, &error);
+
+ if (error != NULL) {
+ g_task_return_error (sub_task, g_steal_pointer (&error));
+ } else {
+ g_task_return_pointer (sub_task, g_steal_pointer (&proxy), (GDestroyNotify) g_object_unref);
+ }
+}
+
+static void
+get_localed_proxy (GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ GTask *main_task)
+{
+ g_autoptr(GTask) sub_task = NULL;
+
+ sub_task = g_task_new (NULL,
+ cancellable,
+ callback,
+ main_task);
+
+ sd_dbus_locale1_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ "org.freedesktop.locale1",
+ "/org/freedesktop/locale1",
+ cancellable,
+ (GAsyncReadyCallback)
+ on_got_localed_proxy,
+ sub_task);
+
+ g_object_set_data_full (G_OBJECT (main_task),
+ "gnome-desktop-get-localed-proxy",
+ g_steal_pointer (&sub_task),
+ g_object_unref);
+}
+
+static gboolean
+input_source_equal (const InputSource *a,
+ const InputSource *b)
+{
+ return g_str_equal (a->type, b->type) && g_str_equal (a->id, b->id);
+}
+
+static void
+gnome_input_source_defaults_free (GnomeInputSourceDefaults *defaults)
+{
+ size_t i;
+
+ for (i = 0; defaults->input_sources[i] != NULL; i++) {
+ g_free (defaults->input_sources[i]->type);
+ g_free (defaults->input_sources[i]->id);
+ g_free (defaults->input_sources[i]);
+ }
+ g_free (defaults->input_sources);
+ g_strfreev (defaults->options);
+ g_free (defaults);
+}
+
+static int
+sort_input_sources (InputSource *a,
+ InputSource *b)
+{
+ gboolean a_is_input_method, b_is_input_method;
+ gboolean a_is_latin, b_is_latin;
+
+ /* Make sure NULL gets put at the end */
+ if (a == NULL) {
+ return 1;
+ }
+
+ if (b == NULL) {
+ return -1;
+ }
+
+ /* Make sure latin get put at the front */
+ a_is_input_method = g_str_equal (a->type, "ibus");
+ b_is_input_method = g_str_equal (b->type, "ibus");
+ a_is_latin = !gnome_input_source_is_non_latin (a->type, a->id);
+ b_is_latin = !gnome_input_source_is_non_latin (b->type, b->id);
+
+ if (a_is_latin && !b_is_latin) {
+ return -1;
+ }
+
+ if (b_is_latin && !a_is_latin) {
+ return 1;
+ }
+
+ /* and input methods get put before raw keyboard layouts */
+ if (a_is_input_method && !b_is_input_method) {
+ return -1;
+ }
+
+ if (b_is_input_method && !a_is_input_method) {
+ return 1;
+ }
+
+ return 0;
+}
+
+static void
+on_got_localed_proxy_for_getting_default_input_sources (GObject *object,
+ GAsyncResult *result,
+ GTask *main_task)
+{
+ g_autoptr(SdDBusLocale1) proxy = NULL;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GPtrArray) input_sources = NULL;
+ g_autofree InputSource *locale_input_source = NULL;
+ g_autofree char *input_method_language = NULL;
+ const char * const *locale_data;
+ g_autofree char *system_locale = NULL;
+ g_autofree char *layouts_string = NULL;
+ g_autofree char *variants_string = NULL;
+ g_autofree char *options_string = NULL;
+ g_auto(GStrv) layouts = NULL;
+ size_t number_of_layouts = 0;
+ g_auto(GStrv) variants = NULL;
+ size_t number_of_variants = 0;
+ g_auto(GStrv) options = NULL;
+ const char *type = NULL, *id = NULL;
+ size_t i;
+ GnomeInputSourceDefaults *defaults;
+
+ proxy = g_task_propagate_pointer (G_TASK (result), &error);
+
+ if (proxy == NULL) {
+ g_task_return_error (main_task, g_steal_pointer (&error));
+ return;
+ }
+
+ input_sources = g_ptr_array_new ();
+
+ locale_data = sd_dbus_locale1_get_locale (proxy);
+ for (i = 0; locale_data[i] != NULL; i++) {
+ if (g_str_has_prefix (locale_data[i], "LANG=")) {
+ system_locale = g_strdup (locale_data[i] + strlen("LANG="));
+ break;
+ }
+ }
+
+ if (gnome_get_input_source_from_locale (system_locale, &type, &id)) {
+ locale_input_source = g_new0 (InputSource, 1);
+ locale_input_source->type = g_strdup (type);
+ locale_input_source->id = g_strdup (id);
+
+ /* We add locale derived input source first if it's an input method
+ * and last if it's xkb based.
+ */
+ if (g_strcmp0 (type, "ibus") == 0) {
+ g_ptr_array_add (input_sources, g_steal_pointer (&locale_input_source));
+ input_method_language = gnome_get_language_from_locale (system_locale, NULL);
+ }
+ }
+
+ layouts_string = sd_dbus_locale1_dup_x11_layout (proxy);
+ variants_string = sd_dbus_locale1_dup_x11_variant (proxy);
+ options_string = sd_dbus_locale1_dup_x11_options (proxy);
+
+ layouts = g_strsplit (layouts_string, ",", -1);
+
+ if (variants_string[0] != '\0') {
+ variants = g_strsplit (variants_string, ",", -1);
+ } else {
+ variants = g_strdupv ((char *[]) { "", NULL });
+ }
+
+ options = g_strsplit (options_string, ",", -1);
+
+ number_of_layouts = g_strv_length (layouts);
+ number_of_variants = g_strv_length (variants);
+
+ if (number_of_layouts == number_of_variants) {
+ g_autoptr(GnomeXkbInfo) xkb_info = gnome_xkb_info_new ();
+ g_autofree char *system_language = NULL;
+
+ gnome_parse_locale (system_locale, &system_language, NULL, NULL, NULL);
+
+ for (i = 0; layouts[i] != NULL; i++) {
+ g_autofree InputSource *input_source = g_new0 (InputSource, 1);
+
+ input_source->type = g_strdup ("xkb");
+ input_source->id = g_strdup_printf ("%s%s%s",
+ layouts[i],
+ variants[i][0] != '\0'? "+" : "",
+ variants[i]);
+
+ if (g_ptr_array_find_with_equal_func (input_sources, input_source, (GEqualFunc) input_source_equal, NULL))
+ continue;
+
+ if (input_method_language != NULL) {
+ const char *layout_language = NULL;
+
+ gnome_xkb_info_get_layout_info (xkb_info, input_source->id, &layout_language, NULL, NULL, NULL);
+
+ if (g_strcmp0 (input_method_language, layout_language) == 0)
+ continue;
+ } else if (system_language != NULL) {
+ GList *languages = NULL, *node = NULL;
+ const char *system_language_name = get_language (system_language);
+
+ languages = gnome_xkb_info_get_languages_for_layout (xkb_info, layouts[i]);
+ for (node = languages; node != NULL; node = node->next) {
+ const char *language_name = get_language (node->data);
+
+ if (g_strcmp0 (system_language_name, language_name) == 0) {
+ g_clear_pointer (&locale_input_source, g_free);
+ break;
+ }
+ }
+ g_list_free (languages);
+ }
+
+ g_ptr_array_add (input_sources, g_steal_pointer (&input_source));
+ }
+ }
+
+ if (locale_input_source != NULL) {
+ if (!g_ptr_array_find_with_equal_func (input_sources, locale_input_source, (GEqualFunc) input_source_equal, NULL)) {
+ g_ptr_array_add (input_sources, g_steal_pointer (&locale_input_source));
+ }
+ }
+
+ if (input_sources->len == 0) {
+ InputSource *input_source = g_new0 (InputSource, 1);
+ input_source->type = g_strdup ("xkb");
+ input_source->id = g_strdup ("us");
+ g_ptr_array_add (input_sources, g_steal_pointer (&input_source));
+ }
+ g_ptr_array_add (input_sources, NULL);
+
+ g_ptr_array_sort_values (input_sources, (GCompareFunc) sort_input_sources);
+
+ defaults = g_new0 (GnomeInputSourceDefaults, 1);
+ defaults->input_sources = (InputSource **) g_ptr_array_steal (input_sources, NULL);
+ defaults->options = g_steal_pointer (&options);
+
+ g_task_return_pointer (main_task, defaults, (GDestroyNotify) gnome_input_source_defaults_free);
+}
+
+/**
+ * gnome_get_default_input_sources:
+ * @cancellable: a #GCancellable
+ * @callback: a #GAsyncReadyCallback
+ * @user_data: user data for @callback
+ *
+ * Asynchronously fetches a list of of default input sources based on locale and system
+ * configuration. This is for when a user has no input sources configured
+ * in GSettings.
+ *
+ * Since: 46
+ */
+void
+gnome_get_default_input_sources (GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+
+ languages_init ();
+
+ task = g_task_new (NULL,
+ cancellable,
+ callback,
+ user_data);
+
+ get_localed_proxy (cancellable,
+ (GAsyncReadyCallback)
+ on_got_localed_proxy_for_getting_default_input_sources,
+ task);
+}
+
+/**
+ * gnome_get_default_input_sources_finish:
+ * @ids: (out) (transfer full): an array of input sources (eg. "us+dvorak" or "anthy")
+ * @types: (out) (transfer full): an array of types (either "xkb" or "ibus")
+ * @options: (out) (transfer full): an options string to use with all input sources
+ * @error: a #GError
+ *
+ * Returns a whether or not a list of default input sources based on locale and system
+ * configuration could be retrieved. This is for when a user has no input sources configured
+ * in GSettings.
+ *
+ * Since: 46
+ */
+gboolean
+gnome_get_default_input_sources_finish (GAsyncResult *result,
+ GStrv *ids,
+ GStrv *types,
+ GStrv *options,
+ GError **error)
+{
+ GnomeInputSourceDefaults *defaults = NULL;
+ size_t i;
+ g_autoptr (GStrvBuilder) ids_builder = NULL;
+ g_autoptr (GStrvBuilder) types_builder = NULL;
+
+ defaults = g_task_propagate_pointer (G_TASK (result), error);
+
+ if (defaults == NULL) {
+ return FALSE;
+ }
+
+ ids_builder = g_strv_builder_new ();
+ types_builder = g_strv_builder_new ();
+
+ for (i = 0; defaults->input_sources[i] != NULL; i++) {
+ g_strv_builder_add (ids_builder, defaults->input_sources[i]->id);
+ g_strv_builder_add (types_builder, defaults->input_sources[i]->type);
+ }
+
+ if (ids != NULL)
+ *ids = g_strv_builder_end (ids_builder);
+
+ if (types != NULL)
+ *types = g_strv_builder_end (types_builder);
+
+ if (options != NULL)
+ *options = g_steal_pointer (&defaults->options);
+
+ gnome_input_source_defaults_free (defaults);
+
+ return TRUE;
+}
diff --git a/libgnome-desktop/gnome-languages.h b/libgnome-desktop/gnome-languages.h
index ed9242e7..3e261c28 100644
--- a/libgnome-desktop/gnome-languages.h
+++ b/libgnome-desktop/gnome-languages.h
@@ -1,61 +1,72 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright 2008 Red Hat, Inc.
* Copyright 2007 William Jon McCann <mccann@jhu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Written by: Ray Strode
* William Jon McCann
*/
#ifndef __GNOME_LANGUAGES_H
#define __GNOME_LANGUAGES_H
#ifndef GNOME_DESKTOP_USE_UNSTABLE_API
#error This is unstable API. You must define GNOME_DESKTOP_USE_UNSTABLE_API before including gnome-languages.h
#endif
#include <glib.h>
+#include <gio/gio.h>
#include <libgnome-desktop/gnome-desktop-version.h>
G_BEGIN_DECLS
char * gnome_get_language_from_locale (const char *locale,
const char *translation);
char * gnome_get_country_from_locale (const char *locale,
const char *translation);
char ** gnome_get_all_locales (void);
gboolean gnome_parse_locale (const char *locale,
char **language_codep,
char **country_codep,
char **codesetp,
char **modifierp);
char * gnome_normalize_locale (const char *locale);
gboolean gnome_language_has_translations (const char *code);
char * gnome_get_language_from_code (const char *code,
const char *translation);
char * gnome_get_country_from_code (const char *code,
const char *translation);
char * gnome_get_translated_modifier (const char *modifier,
const char *translation);
gboolean gnome_get_input_source_from_locale (const char *locale,
const char **type,
const char **id);
gboolean gnome_input_source_is_non_latin (const char *type,
const char *id);
+
+void gnome_get_default_input_sources (GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+gboolean gnome_get_default_input_sources_finish (GAsyncResult *result,
+ GStrv *ids,
+ GStrv *types,
+ GStrv *options,
+ GError **error);
G_END_DECLS
#endif /* __GNOME_LANGUAGES_H */
--
2.41.0

@ -1,23 +0,0 @@
image/bmp=org.gnome.eog.desktop;
image/gif=org.gnome.eog.desktop;
image/jpeg=org.gnome.eog.desktop;
image/jpg=org.gnome.eog.desktop;
image/pjpeg=org.gnome.eog.desktop;
image/png=org.gnome.eog.desktop;
image/tiff=org.gnome.eog.desktop;
image/x-bmp=org.gnome.eog.desktop;
image/x-gray=org.gnome.eog.desktop;
image/x-icb=org.gnome.eog.desktop;
image/x-ico=org.gnome.eog.desktop;
image/x-png=org.gnome.eog.desktop;
image/x-portable-anymap=org.gnome.eog.desktop;
image/x-portable-bitmap=org.gnome.eog.desktop;
image/x-portable-graymap=org.gnome.eog.desktop;
image/x-portable-pixmap=org.gnome.eog.desktop;
image/x-xbitmap=org.gnome.eog.desktop;
image/x-xpixmap=org.gnome.eog.desktop;
image/x-pcx=org.gnome.eog.desktop;
image/svg+xml=org.gnome.eog.desktop;
image/svg+xml-compressed=org.gnome.eog.desktop;
image/vnd.wap.wbmp=org.gnome.eog.desktop;
image/x-icns=org.gnome.eog.desktop;

@ -58,7 +58,7 @@ application/x-abiword=abiword.desktop
application/x-catalog=gpk-install-catalog.desktop
application/x-rpm=gpk-install-local-file.desktop
text/csv=libreoffice-calc.desktop
text/plain=org.gnome.gedit.desktop
text/plain=org.gnome.TextEditor.desktop
text/html=firefox.desktop
application/xhtml+xml=firefox.desktop
inode/directory=org.gnome.Nautilus.desktop

@ -0,0 +1,22 @@
image/jpeg=org.gnome.Loupe.desktop;
image/png=org.gnome.Loupe.desktop;
image/gif=org.gnome.Loupe.desktop;
image/webp=org.gnome.Loupe.desktop;
image/tiff=org.gnome.Loupe.desktop;
image/x-tga=org.gnome.Loupe.desktop;
image/vnd-ms.dds=org.gnome.Loupe.desktop;
image/x-dds=org.gnome.Loupe.desktop;
image/bmp=org.gnome.Loupe.desktop;
image/vnd.microsoft.icon=org.gnome.Loupe.desktop;
image/vnd.radiance=org.gnome.Loupe.desktop;
image/x-exr=org.gnome.Loupe.desktop;
image/x-portable-bitmap=org.gnome.Loupe.desktop;
image/x-portable-graymap=org.gnome.Loupe.desktop;
image/x-portable-pixmap=org.gnome.Loupe.desktop;
image/x-portable-anymap=org.gnome.Loupe.desktop;
image/x-qoi=org.gnome.Loupe.desktop;
image/svg+xml=org.gnome.Loupe.desktop;
image/svg+xml-compressed=org.gnome.Loupe.desktop;
image/avif=org.gnome.Loupe.desktop;
image/heic=org.gnome.Loupe.desktop;
image/jxl=org.gnome.Loupe.desktop;

@ -0,0 +1,72 @@
From 334dd1e558ecced106f6c5ecacae687279904b54 Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Fri, 18 Feb 2022 09:52:46 +0000
Subject: [PATCH] Use inscript as default Indic IM
https://src.fedoraproject.org/rpms/gnome-desktop3/pull-request/6
---
libgnome-desktop/default-input-sources.h | 26 ++++++++++++------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/libgnome-desktop/default-input-sources.h b/libgnome-desktop/default-input-sources.h
index 1e02bce1..00072687 100644
--- a/libgnome-desktop/default-input-sources.h
+++ b/libgnome-desktop/default-input-sources.h
@@ -8,12 +8,12 @@ typedef struct
static DefaultInputSource default_input_sources[] =
{
{ "ar_DZ", "xkb", "ara+azerty" },
- { "as_IN", "ibus", "m17n:as:phonetic" },
+ { "as_IN", "ibus", "m17n:as:inscript2" },
{ "ast_ES", "xkb", "es+ast" },
{ "az_AZ", "xkb", "az" },
{ "be_BY", "xkb", "by" },
{ "bg_BG", "xkb", "bg+phonetic" },
- { "bn_IN", "ibus", "m17n:bn:inscript" },
+ { "bn_IN", "ibus", "m17n:bn:inscript2" },
{ "cat_ES", "xkb", "es+cat" },
{ "cs_CZ", "xkb", "cz" },
{ "de_CH", "xkb", "ch" },
@@ -31,28 +31,28 @@ static DefaultInputSource default_input_sources[] =
{ "fr_CH", "xkb", "ch+fr" },
{ "fr_FR", "xkb", "fr+oss" },
{ "gl_ES", "xkb", "es" },
- { "gu_IN", "ibus", "m17n:gu:inscript" },
+ { "gu_IN", "ibus", "m17n:gu:inscript2" },
{ "he_IL", "xkb", "il" },
- { "hi_IN", "ibus", "m17n:hi:inscript" },
+ { "hi_IN", "ibus", "m17n:hi:inscript2" },
{ "id_ID", "xkb", "us" },
{ "it_IT", "xkb", "it" },
{ "ja_JP", "ibus", "anthy" },
- { "kn_IN", "ibus", "m17n:kn:kgp" },
+ { "kn_IN", "ibus", "m17n:kn:inscript2" },
{ "ko_KR", "ibus", "hangul" },
- { "mai_IN", "ibus", "m17n:mai:inscript" },
- { "ml_IN", "ibus", "m17n:ml:inscript" },
- { "mr_IN", "ibus", "m17n:mr:inscript" },
+ { "mai_IN", "ibus", "m17n:mai:inscript2" },
+ { "ml_IN", "ibus", "m17n:ml:inscript2" },
+ { "mr_IN", "ibus", "m17n:mr:inscript2" },
{ "nl_NL", "xkb", "us+altgr-intl" },
- { "or_IN", "ibus", "m17n:or:inscript" },
- { "pa_IN", "ibus", "m17n:pa:inscript" },
+ { "or_IN", "ibus", "m17n:or:inscript2" },
+ { "pa_IN", "ibus", "m17n:pa:inscript2-guru" },
{ "pl_PL", "xkb", "pl" },
{ "pt_BR", "xkb", "br" },
{ "pt_PT", "xkb", "pt" },
{ "ru_RU", "xkb", "ru" },
- { "sd_IN", "ibus", "m17n:sd:inscript" },
+ { "sd_IN", "ibus", "m17n:sd:inscript2-deva" },
{ "sk_SK", "xkb", "sk" },
- { "ta_IN", "ibus", "m17n:ta:tamil99" },
- { "te_IN", "ibus", "m17n:te:inscript" },
+ { "ta_IN", "ibus", "m17n:ta:inscript2" },
+ { "te_IN", "ibus", "m17n:te:inscript2" },
{ "tr_TR", "xkb", "tr" },
{ "ur_IN", "ibus", "m17n:ur:phonetic" },
{ "zh_CN", "ibus", "libpinyin" },
--
2.40.0

@ -1,19 +1,30 @@
## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 17;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
%global gdk_pixbuf2_version 2.36.5
%global gtk3_version 3.3.6
%global gtk4_version 4.4.0
%global glib2_version 2.53.0
%global gsettings_desktop_schemas_version 3.27.0
%global po_package gnome-desktop-3.0
%global tarball_version %%(echo %{version} | tr '~' '.')
Name: gnome-desktop3
Version: 40.4
Release: 1%{?dist}
Name: gnome-desktop3
Version: 44.0
Release: %autorelease
Summary: Library with common API for various GNOME modules
License: GPLv2+ and LGPLv2+
URL: http://www.gnome.org
Source0: http://download.gnome.org/sources/gnome-desktop/40/gnome-desktop-%{tarball_version}.tar.xz
License: GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.1-or-later
URL: https://gitlab.gnome.org/GNOME/gnome-desktop
Source0: https://download.gnome.org/sources/gnome-desktop/44/gnome-desktop-%{tarball_version}.tar.xz
Source1: gnome-mimeapps.list
# Generated with:
@ -23,12 +34,22 @@ Source2: totem-defaults.list
# for i in `cat /home/hadess/Projects/jhbuild/file-roller/data/supported-mime-types | sed 's/;//g'` application/x-source-rpm ; do if grep MimeType /usr/share/applications/org.gnome.Nautilus.desktop | grep -q "$i;" ; then echo "$i=org.gnome.Nautilus.desktop;org.gnome.FileRoller.desktop;" >> file-roller-defaults.list ; elif ! `grep -q $i gnome-mimeapps.list` ; then echo $i=org.gnome.FileRoller.desktop\; >> file-roller-defaults.list ; fi ; done && for i in `grep MimeType= /usr/share/applications/org.gnome.Nautilus.desktop | sed 's/MimeType=//' | sed 's/;/ /g'` ; do if ! `grep -q $i file-roller-defaults.list || grep -q $i gnome-mimeapps.list` ; then echo "missing handler $i" ; fi ; done
Source3: file-roller-defaults.list
# Generated with:
# for i in `grep MimeType= /usr/share/applications/org.gnome.eog.desktop | sed 's/MimeType=//' | sed 's/;/ /g'` ; do echo $i=org.gnome.eog.desktop\; >> eog-defaults.list ; done
Source4: eog-defaults.list
# for i in `grep MimeType= /usr/share/applications/org.gnome.Loupe.desktop | sed 's/MimeType=//' | sed 's/;/ /g'` ; do echo $i=org.gnome.Loupe.desktop\; >> loupe-defaults.list ; done
Source4: loupe-defaults.list
# Generated with:
# for i in `grep MimeType= /usr/share/applications/org.gnome.Evince.desktop | sed 's/MimeType=//' | sed 's/;/ /g'` ; do echo $i=org.gnome.Evince.desktop\; >> evince-defaults.list ; done
Source5: evince-defaults.list
# https://fedoraproject.org/wiki/Changes/Enhanced_Inscript_as_default_Indic_IM
Patch: make-inscript2-default-for-indic-languages.patch
# https://pagure.io/fedora-workstation/issue/362
Patch: 0001-meson-Add-python3-to-build-scripts.patch
Patch: 0002-gnome-languages-Add-function-to-detect-non-latin-lay.patch
Patch: 0003-meson-Add-codegen-for-localed.patch
Patch: 0004-languages-Add-functions-for-getting-default-input-so.patch
BuildRequires: gcc
BuildRequires: gettext
BuildRequires: gtk-doc
@ -40,10 +61,13 @@ BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(gsettings-desktop-schemas) >= %{gsettings_desktop_schemas_version}
BuildRequires: pkgconfig(gtk+-3.0) >= %{gtk3_version}
BuildRequires: pkgconfig(gtk4) >= %{gtk4_version}
BuildRequires: pkgconfig(iso-codes)
BuildRequires: pkgconfig(libseccomp)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(xkeyboard-config)
BuildRequires: python3
BuildRequires: python3dist(langtable)
Conflicts: shared-mime-info < 2.0-4
Requires: shared-mime-info
@ -60,7 +84,7 @@ Requires: gsettings-desktop-schemas >= %{gsettings_desktop_schemas_version}
Conflicts: gnome-shell < 3.33.4
%description
gnome-desktop contains the libgnome-desktop library as well as a data
gnome-desktop3 contains the libgnome-desktop library as well as a data
file that exports the "GNOME" version to the Settings Details panel.
The libgnome-desktop library provides API shared by several applications
@ -71,13 +95,36 @@ gtk-doc.
%package devel
Summary: Libraries and headers for %{name}
License: LGPLv2+
License: LGPL-2.0-or-later
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n gnome-desktop4
Summary: Library with common API for various GNOME modules
License: GPL-2.0-or-later AND LGPL-2.0-or-later
# Depend on base package for translations, help, version and mimeapps.
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n gnome-desktop4
gnome-desktop4 contains the libgnome-desktop library.
The libgnome-desktop library provides API shared by several applications
on the desktop, but that cannot live in the platform for various
reasons. There is no API or ABI guarantee, although we are doing our
best to provide stability.
%package -n gnome-desktop4-devel
Summary: Libraries and headers for gnome-desktop4
License: LGPL-2.0-or-later
Requires: gnome-desktop4%{?_isa} = %{version}-%{release}
%description -n gnome-desktop4-devel
The gnome-desktop4-devel package contains libraries and header files for
developing applications that use gnome-desktop4.
%package tests
Summary: Tests for the %{name} package
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -108,39 +155,196 @@ cat %SOURCE5 >> $RPM_BUILD_ROOT/%{_datadir}/applications/gnome-mimeapps.list
%files -f %{po_package}.lang
%doc AUTHORS NEWS README.md
%license COPYING COPYING.LIB
%{_datadir}/gnome/gnome-version.xml
%{_datadir}/applications/gnome-mimeapps.list
# LGPL
%{_libdir}/libgnome-desktop-3.so.19{,.*}
%{_libdir}/libgnome-desktop-3.so.20{,.*}
%{_libdir}/girepository-1.0/GnomeDesktop-3.0.typelib
%{_libexecdir}/gnome-desktop-debug/
%files devel
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
%{_includedir}/*
%{_libdir}/libgnome-desktop-3.so
%{_libdir}/pkgconfig/gnome-desktop-3.0.pc
%{_includedir}/gnome-desktop-3.0
%{_datadir}/gir-1.0/GnomeDesktop-3.0.gir
%dir %{_datadir}/gtk-doc/
%dir %{_datadir}/gtk-doc/html/
%doc %{_datadir}/gtk-doc/html/gnome-desktop3/
%files -n gnome-desktop4
%doc AUTHORS NEWS README.md
%license COPYING COPYING.LIB
# LGPL
%{_libdir}/libgnome-bg-4.so.2{,.*}
%{_libdir}/libgnome-desktop-4.so.2{,.*}
%{_libdir}/libgnome-rr-4.so.2{,.*}
%{_libdir}/girepository-1.0/Gnome*-4.0.typelib
%files -n gnome-desktop4-devel
%{_libdir}/libgnome-*-4.so
%{_libdir}/pkgconfig/gnome-*-4.pc
%{_includedir}/gnome-desktop-4.0
%{_datadir}/gir-1.0/Gnome*-4.0.gir
%files tests
%{_libexecdir}/installed-tests/gnome-desktop
%{_datadir}/installed-tests
%changelog
* Thu Aug 19 2021 Kalev Lember <klember@redhat.com> - 40.4-1
- Update to 40.4
## START: Generated by rpmautospec
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 44.0-17
- Bump release for October 2024 mass rebuild:
* Wed Jul 10 2024 Tomas Popela <tpopela@redhat.com> - 44.0-16
- Convert subpackages to SPDX license format
* Wed Jul 10 2024 Tomas Popela <tpopela@redhat.com> - 44.0-15
- Fix license tag so its validated by license-validate
* Tue Jun 25 2024 Tomas Pelka <tpelka@redhat.com> - 44.0-14
- Add gating.yaml via API
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 44.0-13
- Bump release for June 2024 mass rebuild
* Fri Feb 09 2024 Tomas Popela <tpopela@redhat.com> - 44.0-12
- License migrated to SPDX format
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 44.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 44.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Sep 20 2023 Ray Strode <rstrode@redhat.com> - 44.0-9
- Address niche edge case with certain bulgarian layouts
* Sat Sep 09 2023 Ray Strode <rstrode@redhat.com> - 44.0-8
- Sort the input sources list
* Mon Aug 28 2023 Ray Strode <rstrode@redhat.com> - 44.0-7
- Still twiddling with the default input sources api
* Sat Aug 26 2023 Ray Strode <rstrode@redhat.com> - 44.0-6
- Improve APIs for finding default input sources
* Sat Aug 26 2023 Ray Strode <rstrode@redhat.com> - 44.0-5
- Fix typo (s/langtool/langtable/)
* Sat Aug 26 2023 Ray Strode <rstrode@redhat.com> - 44.0-4
- Add APIs for finding default input sources
* Tue Aug 22 2023 Kalev Lember <klember@redhat.com> - 44.0-3
- Replace eog with Loupe in mimeapps defaults list
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 44.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 40.1-2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Sun Mar 19 2023 David King <amigadave@amigadave.com> - 44.0-1
- Update to 44.0
* Wed Feb 15 2023 David King <amigadave@amigadave.com> - 44~beta-1
- Update to 44.beta
* Fri Jan 20 2023 David King <amigadave@amigadave.com> - 43.1-1
- Update to 43.1
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 43-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Sep 19 2022 Kalev Lember <klember@redhat.com> - 43-1
- Update to 43
* Wed Sep 07 2022 Kalev Lember <klember@redhat.com> - 43~rc-1
- Update to 43.rc
* Wed Aug 03 2022 Kalev Lember <klember@redhat.com> - 43~alpha-6
- Remove gnome-desktop3 ABI compat libraries
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 43~alpha-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jul 20 2022 Kalev Lember <klember@redhat.com> - 43~alpha-4
- Remove gnome-desktop4 ABI compat libraries
* Mon Jul 18 2022 Kalev Lember <klember@redhat.com> - 43~alpha-3
- Rebuild
* Mon Jul 18 2022 Kalev Lember <klember@redhat.com> - 43~alpha-2
- Install previous soname as well for temporary ABI compat
* Fri Jul 15 2022 Kalev Lember <klember@redhat.com> - 43~alpha-1
- Update to 43.alpha
* Thu Jun 02 2022 David King <amigadave@amigadave.com> - 42.2-1
- Update to 42.2
* Thu Apr 28 2022 David King <amigadave@amigadave.com> - 42.1-1
- Update to 42.1
* Sun Mar 20 2022 David King <amigadave@amigadave.com> - 42.0-1
- Update to 42.0
* Mon Mar 14 2022 David King <amigadave@amigadave.com> - 42~rc-1
- Update to 42.rc
* Wed Mar 02 2022 Michael Catanzaro <mcatanzaro@redhat.com> - 42~beta-3
- Change default text/plain handler to Text Editor
* Fri Feb 18 2022 David King <amigadave@amigadave.com> - 42~beta-1
- Update to 42.beta
* Tue Feb 01 2022 Mike FABIAN <mfabian@redhat.com> - 42~alpha-1-3
- Add patch for https://fedoraproject.org/wiki/Changes/Ibus_table_cangjie_default_for_zh_hk
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 42~alpha.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 12 2022 David King <amigadave@amigadave.com> - 42~alpha.1-1
- Update to 42.alpha.1
* Tue Jan 11 2022 David King <amigadave@amigadave.com> - 42~alpha-1
- Update to 42.alpha
* Tue Jan 11 2022 David King <amigadave@amigadave.com> - 41.3-1
- Update to 41.3
* Tue Dec 07 2021 Kalev Lember <klember@redhat.com> - 41.2-1
- Update to 41.2
* Tue Nov 02 2021 Kalev Lember <klember@redhat.com> - 41.1-1
- Update to 41.1
* Mon Sep 20 2021 Kalev Lember <klember@redhat.com> - 41.0-1
- Update to 41.0
* Wed Sep 08 2021 Kalev Lember <klember@redhat.com> - 41~rc-1
- Update to 41.rc
* Mon Aug 23 2021 Parag Nemade <pnemade@fedoraproject.org> - 41~beta-2
- Update Enhanced Inscript Change patch to include script name
for pa and sd languages
* Wed Aug 18 2021 Kalev Lember <klember@redhat.com> - 41~beta-1
- Update to 41.beta
* Wed Aug 04 2021 Parag Nemade <pnemade@fedoraproject.org> - 41~alpha-2
- Add patch for https://fedoraproject.org/wiki/Changes/Enhanced_Inscript_as_default_Indic_IM
* Tue Aug 03 2021 Kalev Lember <klember@redhat.com> - 41~alpha-1
- Update to 41.alpha
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 40.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Jun 21 2021 Kalev Lember <klember@redhat.com> - 40.2-1
- Update to 40.2
* Wed May 05 2021 Kalev Lember <klember@redhat.com> - 40.1-1
- Update to 40.1
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 40.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Thu Apr 22 2021 Bastien Nocera <bnocera@redhat.com> - 40.0-3
+ gnome-desktop3-40.0-3
- Fix crash opening keyboard layouts dialogue
* Thu Apr 01 2021 Bastien Nocera <bnocera@redhat.com> - 40.0-2
+ gnome-desktop3-40.0-2
@ -878,3 +1082,5 @@ cat %SOURCE5 >> $RPM_BUILD_ROOT/%{_datadir}/applications/gnome-mimeapps.list
* Thu Jun 17 2010 Richard Hughes <richard@hughsie.com> 2.90.1-1
- Initial build for review.
## END: Generated by rpmautospec

Loading…
Cancel
Save