Sync from SUSE:SLFO:Main glib2 revision 70e7a700275748dc36937490dec781ea

This commit is contained in:
Adrian Schröter 2024-05-03 12:54:01 +02:00
commit e48dba8eb3
17 changed files with 10067 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,19 @@
Quoting the "Vendor overrides" section from [1]:
Default values are defined in the schemas that get installed by an application.
Sometimes, it is necessary for a vendor or distributor to adjust these
defaults. Since patching the XML source for the schema is inconvenient and
error-prone, glib-compile-schemas reads so-called 'vendor override' files.
These are keyfiles in the same directory as the XML schema sources which can
override default values. The schema id serves as the group name in the key
file, and the values are expected in serialized GVariant form, as in the
following example:
[org.gtk.Example]
key1='string'
key2=1.5
glib-compile-schemas expects schema files to have the extension
.gschema.override
[1] http://developer.gnome.org/gio/stable/GSettings.html

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>doc</package>
</multibuild>

19
baselibs.conf Normal file
View File

@ -0,0 +1,19 @@
glib2-devel
requires -glib2-<targettype>
requires "glib2-tools-<targettype> = <version>"
requires "libgio-2_0-0-<targettype> = <version>"
requires "libgmodule-2_0-0-<targettype> = <version>"
requires "libgobject-2_0-0-<targettype> = <version>"
requires "libgthread-2_0-0-<targettype> = <version>"
+^/usr/lib.*/glib-2.0/include/glibconfig.h
+^/usr/lib.*/pkgconfig/glib-2.0.pc
glib2-tools
+/usr/bin/gio-querymodules(-64)?
libglib-2_0-0
obsoletes "glib2-<targettype> <= <version>"
provides "glib2-<targettype> = <version>"
libgmodule-2_0-0
libgio-2_0-0
libgthread-2_0-0
libgobject-2_0-0

BIN
glib-2.76.2.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,142 @@
Index: glib-2.75.4/glib/gkeyfile.c
===================================================================
--- glib-2.75.4.orig/glib/gkeyfile.c
+++ glib-2.75.4/glib/gkeyfile.c
@@ -519,6 +519,7 @@ struct _GKeyFile
gboolean checked_locales; /* TRUE if @locales has been initialised */
gchar **locales; /* (nullable) */
+ gchar *gettext_domain;
gint ref_count; /* (atomic) */
};
@@ -645,6 +646,7 @@ g_key_file_init (GKeyFile *key_file)
key_file->parse_buffer = NULL;
key_file->list_separator = ';';
key_file->flags = 0;
+ key_file->gettext_domain = NULL;
}
static void
@@ -665,6 +667,12 @@ g_key_file_clear (GKeyFile *key_file)
key_file->parse_buffer = NULL;
}
+ if (key_file->gettext_domain)
+ {
+ g_free (key_file->gettext_domain);
+ key_file->gettext_domain = NULL;
+ }
+
tmp = key_file->groups;
while (tmp != NULL)
{
@@ -885,6 +893,11 @@ g_key_file_load_from_fd (GKeyFile
return FALSE;
}
+ key_file->gettext_domain = g_key_file_get_string (key_file,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
+ NULL);
+
return TRUE;
}
@@ -997,6 +1010,11 @@ g_key_file_load_from_data (GKeyFile
return FALSE;
}
+ key_file->gettext_domain = g_key_file_get_string (key_file,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
+ NULL);
+
return TRUE;
}
@@ -2246,6 +2264,8 @@ g_key_file_get_locale_string (GKeyFile
GError *key_file_error;
gchar **languages;
gboolean free_languages = FALSE;
+ gboolean try_gettext = FALSE;
+ const gchar *msg_locale;
gint i;
g_return_val_if_fail (key_file != NULL, NULL);
@@ -2267,6 +2287,23 @@ g_key_file_get_locale_string (GKeyFile
free_languages = FALSE;
}
+ /* we're only interested in gettext translation if we don't have a
+ * translation in the .desktop file itself and if the key is one of the keys
+ * we know we want to translate: Name, GenericName, Comment. Blindly doing
+ * this for all keys can give strange result for the icons, since the Icon is
+ * a locale string in the spec, eg. We also only get translation in the mo
+ * file if the requested locale is the LC_MESSAGES one. Ideally, we should do
+ * more and change LC_MESSAGES to use the requested locale, but there's no
+ * guarantee it's installed on the system and it might have some
+ * side-effects. Since this is a corner case, let's ignore it. */
+
+ msg_locale = setlocale (LC_MESSAGES, NULL);
+ try_gettext = msg_locale && key_file->gettext_domain &&
+ strcmp (group_name, G_KEY_FILE_DESKTOP_GROUP) == 0 &&
+ (strcmp (key, G_KEY_FILE_DESKTOP_KEY_NAME) == 0 ||
+ strcmp (key, G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME) == 0 ||
+ strcmp (key, G_KEY_FILE_DESKTOP_KEY_COMMENT) == 0);
+
for (i = 0; languages[i]; i++)
{
candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
@@ -2280,6 +2317,39 @@ g_key_file_get_locale_string (GKeyFile
break;
}
+ /* Fallback to gettext */
+ if (try_gettext && !translated_value)
+ {
+ gchar *orig_value = g_key_file_get_string (key_file, group_name, key, NULL);
+
+ if (orig_value)
+ {
+ gboolean codeset_set;
+ const gchar *translated;
+ gboolean has_gettext;
+
+ codeset_set = bind_textdomain_codeset (key_file->gettext_domain, "UTF-8") != NULL;
+ translated = NULL;
+
+ translated = g_dgettext (key_file->gettext_domain,
+ orig_value);
+ has_gettext = translated != orig_value;
+
+ g_free (orig_value);
+
+ if (has_gettext)
+ {
+ if (codeset_set)
+ translated_value = g_strdup (translated);
+ else
+ translated_value = g_locale_to_utf8 (translated,
+ -1, NULL, NULL, NULL);
+ }
+ else
+ translated_value = NULL;
+ }
+ }
+
/* Fallback to untranslated key
*/
if (!translated_value)
Index: glib-2.75.4/glib/gkeyfile.h
===================================================================
--- glib-2.75.4.orig/glib/gkeyfile.h
+++ glib-2.75.4/glib/gkeyfile.h
@@ -322,6 +322,7 @@ gboolean g_key_file_remove_group
#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"
+#define G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN "X-GNOME-Gettext-Domain"
#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION "Application"
#define G_KEY_FILE_DESKTOP_TYPE_LINK "Link"

View File

@ -0,0 +1,171 @@
Index: glib-2.75.4/glib/gkeyfile.c
===================================================================
--- glib-2.75.4.orig/glib/gkeyfile.c
+++ glib-2.75.4/glib/gkeyfile.c
@@ -520,6 +520,7 @@ struct _GKeyFile
gboolean checked_locales; /* TRUE if @locales has been initialised */
gchar **locales; /* (nullable) */
gchar *gettext_domain;
+ gchar *file_basename;
gint ref_count; /* (atomic) */
};
@@ -647,6 +648,7 @@ g_key_file_init (GKeyFile *key_file)
key_file->list_separator = ';';
key_file->flags = 0;
key_file->gettext_domain = NULL;
+ key_file->file_basename = NULL;
}
static void
@@ -673,6 +675,12 @@ g_key_file_clear (GKeyFile *key_file)
key_file->gettext_domain = NULL;
}
+ if (key_file->file_basename)
+ {
+ g_free (key_file->file_basename);
+ key_file->file_basename = NULL;
+ }
+
tmp = key_file->groups;
while (tmp != NULL)
{
@@ -817,6 +825,39 @@ find_file_in_data_dirs (const gchar *f
return fd;
}
+static int _g_key_file_default_textdomain_codeset_bound = 0;
+#define _G_KEY_FILE_DEFAULT_DOMAIN "desktop_translations"
+
+static char *
+_g_key_file_get_default_gettext_domain (void)
+{
+ if (!_g_key_file_default_textdomain_codeset_bound)
+ {
+ const char *codeset;
+
+ _g_key_file_default_textdomain_codeset_bound = 1;
+
+ codeset = bind_textdomain_codeset (_G_KEY_FILE_DEFAULT_DOMAIN, "UTF-8");
+
+ if (codeset)
+ _g_key_file_default_textdomain_codeset_bound |= 1 << 1;
+ }
+
+ return g_strdup (_G_KEY_FILE_DEFAULT_DOMAIN);
+}
+
+static inline gboolean
+_g_key_file_is_default_gettext_domain (const char *domain)
+{
+ return (domain && strcmp (domain, _G_KEY_FILE_DEFAULT_DOMAIN) == 0);
+}
+
+static inline gboolean
+_g_key_file_default_gettext_domain_is_bound (void)
+{
+ return _g_key_file_default_textdomain_codeset_bound & (1 << 1);
+}
+
static gboolean
g_key_file_load_from_fd (GKeyFile *key_file,
gint fd,
@@ -898,6 +939,9 @@ g_key_file_load_from_fd (GKeyFile
G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
NULL);
+ if (!key_file->gettext_domain)
+ key_file->gettext_domain = _g_key_file_get_default_gettext_domain ();
+
return TRUE;
}
@@ -954,6 +998,8 @@ g_key_file_load_from_file (GKeyFile
return FALSE;
}
+ key_file->file_basename = g_path_get_basename (file);
+
return TRUE;
}
@@ -1015,6 +1061,9 @@ g_key_file_load_from_data (GKeyFile
G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
NULL);
+ if (!key_file->gettext_domain)
+ key_file->gettext_domain = _g_key_file_get_default_gettext_domain ();
+
return TRUE;
}
@@ -1119,6 +1168,9 @@ g_key_file_load_from_dirs (GKeyFile
}
}
+ if (found_file)
+ key_file->file_basename = g_path_get_basename (output_path);
+
if (found_file && full_path)
*full_path = output_path;
else
@@ -2326,14 +2378,40 @@ g_key_file_get_locale_string (GKeyFile
{
gboolean codeset_set;
const gchar *translated;
- gboolean has_gettext;
+ gboolean has_gettext = FALSE;
- codeset_set = bind_textdomain_codeset (key_file->gettext_domain, "UTF-8") != NULL;
+ if (_g_key_file_is_default_gettext_domain (key_file->gettext_domain))
+ codeset_set = _g_key_file_default_gettext_domain_is_bound ();
+ else
+ codeset_set = bind_textdomain_codeset (key_file->gettext_domain, "UTF-8") != NULL;
translated = NULL;
- translated = g_dgettext (key_file->gettext_domain,
- orig_value);
- has_gettext = translated != orig_value;
+ /* first try to translate with the context */
+ if (key_file->file_basename)
+ {
+ gchar *context;
+ gchar *context_value;
+
+ context = g_strdup_printf ("%s(%s)", key,
+ key_file->file_basename);
+ context_value = g_strdup_printf ("%s%s%s",
+ context, ": ", orig_value);
+
+ translated = g_dgettext (key_file->gettext_domain,
+ context_value);
+ has_gettext = translated != context_value;
+
+ g_free (context_value);
+ g_free (context);
+ }
+
+ /* no translation with the context: try without context */
+ if (!has_gettext)
+ {
+ translated = g_dgettext (key_file->gettext_domain,
+ orig_value);
+ has_gettext = translated != orig_value;
+ }
g_free (orig_value);
Index: glib-2.75.4/glib/gkeyfile.h
===================================================================
--- glib-2.75.4.orig/glib/gkeyfile.h
+++ glib-2.75.4/glib/gkeyfile.h
@@ -322,7 +322,7 @@ gboolean g_key_file_remove_group
#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"
-#define G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN "X-GNOME-Gettext-Domain"
+#define G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN "X-SUSE-Gettext-Domain"
#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION "Application"
#define G_KEY_FILE_DESKTOP_TYPE_LINK "Link"

View File

@ -0,0 +1,44 @@
Index: glib-2.70.0/gio/gdbus-2.0/codegen/codegen.py
===================================================================
--- glib-2.70.0.orig/gio/gdbus-2.0/codegen/codegen.py
+++ glib-2.70.0/gio/gdbus-2.0/codegen/codegen.py
@@ -95,8 +95,7 @@ class HeaderCodeGenerator:
# ----------------------------------------------------------------------------------------------------
def generate_header_preamble(self):
- basenames = ", ".join(self.input_files_basenames)
- self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
+ self.outfile.write(LICENSE_STR)
self.outfile.write("\n")
if self.use_pragma:
@@ -1040,8 +1039,7 @@ class InterfaceInfoHeaderCodeGenerator:
# ----------------------------------------------------------------------------------------------------
def generate_header_preamble(self):
- basenames = ", ".join(self.input_files_basenames)
- self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
+ self.outfile.write(LICENSE_STR)
self.outfile.write("\n")
if self.use_pragma:
@@ -1112,8 +1110,7 @@ class InterfaceInfoBodyCodeGenerator:
# ----------------------------------------------------------------------------------------------------
def generate_body_preamble(self):
- basenames = ", ".join(self.input_files_basenames)
- self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
+ self.outfile.write(LICENSE_STR)
if self.symbol_decoration_define is not None:
self.outfile.write("\n")
@@ -1466,8 +1463,7 @@ class CodeGenerator:
# ----------------------------------------------------------------------------------------------------
def generate_body_preamble(self):
- basenames = ", ".join(self.input_files_basenames)
- self.outfile.write(LICENSE_STR.format(config.VERSION, basenames))
+ self.outfile.write(LICENSE_STR)
if self.symbol_decoration_define is not None:
self.outfile.write("\n")
self.outfile.write("#define %s\n" % self.symbol_decoration_define)

17
glib2-rpmlintrc Normal file
View File

@ -0,0 +1,17 @@
# Adding gio-branding for the following filter
addFilter(".*shlib-fixed-dependency.*[glib2|gio\-branding].*")
# Filter for non-conffile-in-etc warning for the following files
# under /etc/profile.d/ and /etc/rpm/ directories, respectively:
# zzz-glib2.csh and zzz-glib2.sh, and macros.glib2
addFilter("glib2.*non-conffile-in-etc.*[zzz\-glib2.*|macros\.glib2]")
# Filter for env-script-intepreter for the following files under
# /usr/bin directory: gdbus-codegen, glib-genmarshal and glib-mkenums
addFilter(".*env-script-interpreter.*/usr/bin/[gdbus\-codegen|glib\-.*].*")
# allow empty files and certificates in tests
#addFilter(".*: W: zero-length /usr/libexec/installed-tests/glib/.*")
#addFilter(".*: W: pem-certificate /usr/libexec/installed-tests/.*")
# disable bogus warnings, as instructed by upstream
#addFilter(".*: W: shared-lib-without-dependency-information .*")
# the maintainers prefer to keep the following internal SUSE naming conflicts
#addFilter(".*: W: no-dependency-on glib2.*")
#addFilter(".*: W: suse-branding-.*")

View File

@ -0,0 +1,20 @@
Index: glib-2.75.3/gio/glib-compile-schemas.c
===================================================================
--- glib-2.75.3.orig/gio/glib-compile-schemas.c
+++ glib-2.75.3/gio/glib-compile-schemas.c
@@ -1231,6 +1231,7 @@ parse_state_start_schema (ParseState *s
return;
}
+/*
if (path && (g_str_has_prefix (path, "/apps/") ||
g_str_has_prefix (path, "/desktop/") ||
g_str_has_prefix (path, "/system/")))
@@ -1243,6 +1244,7 @@ parse_state_start_schema (ParseState *s
g_printerr ("%s\n", message);
g_free (message);
}
+*/
state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);

View File

@ -0,0 +1,46 @@
# GNOME Default Applications Source
# /etc/gnome-defaults.conf
#
# WARNING: This is a dumb file, which provides only upstream GNOME
# packages as preferred defaults. You most probably don't want this
# package!
# You probably want to install distribution glib2-branding and prefer
# distribution wise GNOME defaults.
#
# After any change of this file run
# suse-update-mime-defaults
#
# This list is a source for defaults.list.
#
# If application in this list is installed, it is used as default in GNOME.
# It works in following way:
# 1. Read this file.
# 2. Collect all available desktop files.
# 3. Go through all declared MIME types and search for default application
# for defaults.list in following order:
# 3.1 Installed application listed here for certain MIME type.
# 3.2 Installed application listed here as preferred default.
# 3.3 Installed application listed here as default.
# 3.4 Installed application with GNOME in Categories.
# 3.5 Installed application with GTK in Categories.
# 3.6 Installed application.
# If there are more applications in the same order, it uses pseudo-randomly
# one of them (last in aplhabetical order).
#
# Syntax:
# Use xxx as default for all MIME types it declares (see 3.3):
# xxx.desktop
# Use xxx as preferred default for all MIME types it declares (see 3.2):
# !xxx.desktop
# Use xxx as default for mime/type (see 3.1):
# mime/type=xxx.desktop
# Upstream GNOME default applications
eog.desktop
evince.desktop
gedit.desktop
file-roller.desktop
epiphany.desktop
nautilus.desktop
# evince supports multi-page tiff, but most people will prefer eog:
image/tiff=eog.desktop

7890
glib2.changes Normal file

File diff suppressed because it is too large Load Diff

468
glib2.csh Normal file
View File

@ -0,0 +1,468 @@
# GLib filename encoding guesser.
# Author: Stanislav Brabec <sbrabec@suse.cz>
# Additions are welcome.
# This script must be executed after setting LANG variable.
# Try filenames which are invalid in UTF-8 as locale specific.
# For selected locales, G_FILENAME_ENCODING takes precedence.
setenv G_BROKEN_FILENAMES 1
# In West Europe there was used both ISO-8859-15 and ISO-8859-1.
# There is no chance to recognize it, so we must guess.
#set west_europe_legacy_encoding=ISO-8859-1
set west_europe_legacy_encoding=ISO-8859-15
# In Russia, "official" encoding is ISO-8859-5, but most GNOME users
# preferred KOI8-R. We must guess.
#set russian_legacy_encoding=ISO-8859-5
set russian_legacy_encoding=KOI8-R
# In former Yugoslavia sr_YU have covered two different alphabets -
# one Latin and on Cyrillic. No chance to guess.
set sr_YU_legacy_encoding=ISO-8859-2,CP1250
#set sr_YU_legacy_encoding=ISO-8859-5
# Japanese uses two legacy encodings. Guess sometimes fails, sometimes not.
# Defining preferred encoding increases chance for success.
set japanese_legacy_encoding=EUC-JP
#set japanese_legacy_encoding=SHIFT_JIS
if (! ${?LANG} ) goto skip
switch ( $LANG )
case aa_DJ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case af_ZA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case an_ES*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-15,CP1252
breaksw
case ar_AE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_BH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_DZ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_EG*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_IQ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_JO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_KW*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_LB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_LY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_MA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_OM*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_QA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_SA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_SD*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_SY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_TN*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case ar_YE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-6
breaksw
case be_BY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,CP1251
breaksw
case bg_BG*:
setenv G_FILENAME_ENCODING @locale,UTF-8,CP1251
breaksw
case br_FR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case bs_BA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case ca_ES*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case cs_CZ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case cy_GB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-14,CP1252
breaksw
case da_DK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case de_AT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case de_BE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case de_DE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case de_CH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case de_LU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case el_GR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-7
breaksw
case en_AU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_BE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case en_BW*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_CA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_DK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_GB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case en_HK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_IE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case en_NZ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_PH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_SG*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_US*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case en_ZA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case en_ZW*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_AR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_BO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_CL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_CO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_CR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_DO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_EC*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_ES*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case es_GT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_HN*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_MX*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_NI*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_PA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_PE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_PR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_PY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_SV*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_US*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_UY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case es_VE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case et_EE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case eu_ES*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case fa_IR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,CP1256
breaksw
case fi_FI*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case fo_FO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case fr_BE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case fr_CA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case fr_FR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case fr_CH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case fr_LU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case ga_IE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case gd_GB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-15,CP1252
breaksw
case gl_ES*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case gv_GB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case he_IL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-8
breaksw
case hr_HR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case hu_HU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case hy_AM*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ARMSCII-8
breaksw
case id_ID*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case is_IS*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case it_CH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case it_IT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case iw_IL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-8
breaksw
case ja_JP*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$japanese_legacy_encoding,EUC-JP,SHIFT_JIS,ISO-8859-1
breaksw
case ka_GE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,GEORGIAN-PS
breaksw
case kl_GL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case km_KH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,GB18030
breaksw
case ko_KR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,EUC-KR,ISO-8859-1
breaksw
case kw_GB*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case lg_UG*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-10,CP1252
breaksw
case lt_LT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-13,CP1252
breaksw
case lv_LV*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-13,CP1252
breaksw
case mi_NZ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-13,CP1252
breaksw
case mk_MK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-5,CP1251
breaksw
case ms_MY*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case mt_MT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-3
breaksw
case nb_NO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case nl_BE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case nl_NL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case nn_NO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case no_NO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case oc_FR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case om_KE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case pl_PL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case pt_BR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case pt_PT*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case ro_RO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case ru_RU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$russian_legacy_encoding,CP1251
breaksw
case ru_UA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,KOI8-U
breaksw
case sh_YU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case sk_SK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case sl_SI*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-2,CP1250
breaksw
case so_DJ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case so_KE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case so_SO*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case sq_AL*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case sr_YU*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$sr_YU_legacy_encoding
breaksw
case st_ZA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case sv_FI*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case sv_SE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case tg_TJ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,KOI8-T
breaksw
case th_TH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,TIS-620,ISO-8859-1
breaksw
case tl_PH*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case tr_TR*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-9
breaksw
case uk_UA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,KOI8-U
breaksw
case uz_UZ*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case vi_VN*:
setenv G_FILENAME_ENCODING @locale,UTF-8,TCVN5712-1,ISO-8859-1
breaksw
case wa_BE*:
setenv G_FILENAME_ENCODING @locale,UTF-8,$west_europe_legacy_encoding,CP1252
breaksw
case xh_ZA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
case yi_US*:
setenv G_FILENAME_ENCODING @locale,UTF-8,CP1255
breaksw
case zh_CN*:
setenv G_FILENAME_ENCODING @locale,UTF-8,GB2312,GB18030,GBK,ISO-8859-1
breaksw
case zh_HK*:
setenv G_FILENAME_ENCODING @locale,UTF-8,BIG5-HKSCS,ISO-8859-1
breaksw
case zh_SG*:
setenv G_FILENAME_ENCODING @locale,UTF-8,GB2312,GB18030,GBK,ISO-8859-1
breaksw
case zh_TW*:
setenv G_FILENAME_ENCODING @locale,UTF-8,BIG5,EUC-TW,ISO-8859-1
breaksw
case zu_ZA*:
setenv G_FILENAME_ENCODING @locale,UTF-8,ISO-8859-1,CP1252
breaksw
endsw
skip:
unset west_europe_legacy_encoding
unset russian_legacy_encoding
unset sr_YU_legacy_encoding

465
glib2.sh Normal file
View File

@ -0,0 +1,465 @@
# GLib filename encoding guesser.
# Author: Stanislav Brabec <sbrabec@suse.cz>
# Additions are welcome.
# This script must be executed after setting LANG variable.
# Try filenames which are invalid in UTF-8 as locale specific.
# For selected locales, G_FILENAME_ENCODING takes precedence.
export G_BROKEN_FILENAMES=1
# In West Europe there was used both ISO-8859-15 and ISO-8859-1.
# There is no chance to recognize it, so we must guess.
#west_europe_legacy_encoding=ISO-8859-1
west_europe_legacy_encoding=ISO-8859-15
# In Russia, "official" encoding is ISO-8859-5, but most GNOME users
# preferred KOI8-R. We must guess.
#russian_legacy_encoding=ISO-8859-5
russian_legacy_encoding=KOI8-R
# In former Yugoslavia sr_YU have covered two different alphabets -
# one Latin and on Cyrillic. No chance to guess.
sr_YU_legacy_encoding=ISO-8859-2,CP1250
#sr_YU_legacy_encoding=ISO-8859-5
# Japanese uses two legacy encodings. Guess sometimes fails, sometimes not.
# Defining preferred encoding increases chance for success.
japanese_legacy_encoding=EUC-JP
#japanese_legacy_encoding=SHIFT_JIS
case $LANG in
aa_DJ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
af_ZA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
an_ES* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
;;
ar_AE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_BH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_DZ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_EG* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_IQ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_JO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_KW* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_LB* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_LY* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_MA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_OM* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_QA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_SA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_SD* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_SY* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_TN* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
ar_YE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-6
;;
be_BY* )
G_FILENAME_ENCODING=@locale,UTF-8,CP1251
;;
bg_BG* )
G_FILENAME_ENCODING=@locale,UTF-8,CP1251
;;
br_FR* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
bs_BA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
ca_ES* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
cs_CZ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
cy_GB* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-14,CP1252
;;
da_DK* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
de_AT* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
de_BE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
de_DE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
de_CH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
de_LU* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
el_GR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-7
;;
en_AU* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_BE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
en_BW* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_CA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_DK* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_GB* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
en_HK* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_IE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
en_NZ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_PH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_SG* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_US* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
en_ZA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
en_ZW* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_AR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_BO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_CL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_CO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_CR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_DO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_EC* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_ES* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
es_GT* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_HN* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_MX* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_NI* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_PA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_PE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_PR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_PY* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_SV* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_US* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_UY* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
es_VE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
et_EE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
eu_ES* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
fa_IR* )
G_FILENAME_ENCODING=@locale,UTF-8,CP1256
;;
fi_FI* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
fo_FO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
fr_BE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
fr_CA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
fr_FR* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
fr_CH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
fr_LU* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
ga_IE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
gd_GB* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
;;
gl_ES* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
gv_GB* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
he_IL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-8
;;
hr_HR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
hu_HU* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
hy_AM* )
G_FILENAME_ENCODING=@locale,UTF-8,ARMSCII-8
;;
id_ID* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
is_IS* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
it_CH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
it_IT* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
iw_IL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-8
;;
ja_JP* )
G_FILENAME_ENCODING=@locale,UTF-8,$japanese_legacy_encoding,EUC-JP,SHIFT_JIS,ISO-8859-1
;;
ka_GE* )
G_FILENAME_ENCODING=@locale,UTF-8,GEORGIAN-PS
;;
kl_GL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
km_KH* )
G_FILENAME_ENCODING=@locale,UTF-8,GB18030
;;
ko_KR* )
G_FILENAME_ENCODING=@locale,UTF-8,EUC-KR,ISO-8859-1
;;
kw_GB* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
lg_UG* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-10,CP1252
;;
lt_LT* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-13,CP1252
;;
lv_LV* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-13,CP1252
;;
mi_NZ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-13,CP1252
;;
mk_MK* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-5,CP1251
;;
ms_MY* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
mt_MT* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-3
;;
nb_NO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
nl_BE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
nl_NL* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
nn_NO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
no_NO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
oc_FR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
om_KE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
pl_PL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
pt_BR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
pt_PT* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
ro_RO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
ru_RU* )
G_FILENAME_ENCODING=@locale,UTF-8,$russian_legacy_encoding,CP1251
;;
ru_UA* )
G_FILENAME_ENCODING=@locale,UTF-8,KOI8-U
;;
sh_YU* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
sk_SK* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
sl_SI* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-2,CP1250
;;
so_DJ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
so_KE* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
so_SO* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
sq_AL* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
sr_YU* )
G_FILENAME_ENCODING=@locale,UTF-8,$sr_YU_legacy_encoding
;;
st_ZA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
sv_FI* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
sv_SE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
tg_TJ* )
G_FILENAME_ENCODING=@locale,UTF-8,KOI8-T
;;
th_TH* )
G_FILENAME_ENCODING=@locale,UTF-8,TIS-620,ISO-8859-1
;;
tl_PH* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
tr_TR* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-9
;;
uk_UA* )
G_FILENAME_ENCODING=@locale,UTF-8,KOI8-U
;;
uz_UZ* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
vi_VN* )
G_FILENAME_ENCODING=@locale,UTF-8,TCVN5712-1,ISO-8859-1
;;
wa_BE* )
G_FILENAME_ENCODING=@locale,UTF-8,$west_europe_legacy_encoding,CP1252
;;
xh_ZA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
yi_US* )
G_FILENAME_ENCODING=@locale,UTF-8,CP1255
;;
zh_CN* )
G_FILENAME_ENCODING=@locale,UTF-8,GB2312,GB18030,GBK,ISO-8859-1
;;
zh_HK* )
G_FILENAME_ENCODING=@locale,UTF-8,BIG5-HKSCS,ISO-8859-1
;;
zh_SG* )
G_FILENAME_ENCODING=@locale,UTF-8,GB2312,GB18030,GBK,ISO-8859-1
;;
zh_TW* )
G_FILENAME_ENCODING=@locale,UTF-8,BIG5,EUC-TW,ISO-8859-1
;;
zu_ZA* )
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-1,CP1252
;;
esac
export G_FILENAME_ENCODING
unset west_europe_legacy_encoding
unset russian_legacy_encoding
unset sr_YU_legacy_encoding

517
glib2.spec Normal file
View File

@ -0,0 +1,517 @@
#
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "doc"
%global psuffix -doc
%else
%global psuffix %{nil}
%endif
%define libver 2_0-0
%define libgio libgio-%{libver}
%define libglib libglib-%{libver}
%define libgmodule libgmodule-%{libver}
%define libgobject libgobject-%{libver}
%define libgthread libgthread-%{libver}
%bcond_without systemtap
Name: glib2%{psuffix}
Version: 2.76.2
Release: 0
Summary: General-Purpose Utility Library
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://wiki.gnome.org/Projects/GLib
Source0: https://download.gnome.org/sources/glib/2.76/glib-%{version}.tar.xz
Source1: glib2.sh
Source2: glib2.csh
# Not upstream file. Only proposes upstream packages:
Source4: glib2-upstream-gnome_defaults.conf
# Some documentation for people writing branding packages, shipped in the branding-upstream package
Source5: README.Gsettings-overrides
Source6: macros.glib2
# zsh completion from https://github.com/jmatsuzawa/zsh-comp-gsettings
Source8: gsettings.zsh
Source98: glib2-rpmlintrc
Source99: baselibs.conf
# PATCH-FEATURE-UPSTREAM glib2-bgo569829-gettext-gkeyfile.patch fate300461 bgo569829 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that we share with Ubuntu and try to push upstream
Patch0: glib2-bgo569829-gettext-gkeyfile.patch
# PATCH-FEATURE-OPENSUSE glib2-fate300461-gettext-gkeyfile-suse.patch fate300461 vuntz@novell.com -- Look for translation of desktop entry strings via gettext, part that deals with the openSUSE specific infrastructure (with desktop_translations)
Patch1: glib2-fate300461-gettext-gkeyfile-suse.patch
# PATCH-FIX-OPENSUSE glib2-suppress-schema-deprecated-path-warning.patch rh#814053 badshah400@gmail.com -- Suppress the deprecated path warning since it fills up screen unnecessarily during package installations/upgrade.
Patch2: glib2-suppress-schema-deprecated-path-warning.patch
# PATCH-FIX-OPENSUSE glib2-gdbus-codegen-version.patch olaf@aepfle.de -- Remove version string from files generated by gdbus-codegen
Patch4: glib2-gdbus-codegen-version.patch
BuildRequires: docbook-xsl-stylesheets
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libselinux-devel
BuildRequires: m4
BuildRequires: meson >= 0.60.0
BuildRequires: pkgconfig
BuildRequires: python3-base >= 3.5
# gdbus-codegen is run during the build, so we need python3-xml
BuildRequires: python3-xml
BuildRequires: xsltproc
# Needed for gresource
BuildRequires: pkgconfig(libelf) >= 0.8.12
BuildRequires: pkgconfig(libffi) >= 3.0.0
BuildRequires: pkgconfig(libpcre2-8) >= 10.32
BuildRequires: pkgconfig(mount) >= 2.28
BuildRequires: pkgconfig(zlib)
%if "%{flavor}" == "doc"
# Split-provides
Provides: glib2-devel:%{_datadir}/gtk-doc/html/gobject/index.html
%endif
%if "%{flavor}" == "doc"
BuildRequires: glib2-devel
BuildRequires: gtk-doc >= 1.32
%endif
%if %{with systemtap}
BuildRequires: systemtap-dtrace
BuildRequires: systemtap-headers
%endif
%description
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%if %{with doc}
This package provides the documentation for the GLib library.
%endif
%package tools
Summary: Tools from glib2, a general-purpose utility library
# ensure libgio-2_0-0 is updated before glib2-tools' ensures glib-compile-schema to
# be functional when the file trigger fires (boo#1178713)
Group: Development/Libraries/C and C++
Requires(post): %{libgio} = %{version}
%description tools
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%package -n gio-branding-upstream
Summary: Upstream definitions of default settings and applications
Group: System/Libraries
Requires: %{libgio} = %{version}
Supplements: (%{libgio} and branding-upstream)
Conflicts: gio-branding
Provides: %{name}-branding-upstream = %{version}
Obsoletes: %{name}-branding-upstream < %{version}
Provides: gio-branding = %{version}
BuildArch: noarch
#BRAND: The /etc/gnome_defaults.conf allows to define arbitrary
#BRAND: applications as preferred defaults.
#BRAND: A /usr/share/glib-2.0/schemas/$NAME.gschema.override file can
#BRAND: be used to override the default value for GSettings keys. See
#BRAND: README.Gsettings-overrides for more details. The branding
#BRAND: package should then have proper Requires for features changed
#BRAND: with such an override file.
# NOTE: gnome_defaults is not an upstream feature, but a SuSE
# enhancement, but to conform branding conventions, the package is named
# as gio-branding-upstream.
%description -n gio-branding-upstream
This package provides upstream defaults for settings stored with
GSettings and applications used by the MIME system.
%package devel
Summary: Development files for glib, a general-purpose utility library
# Now require the subpackages too
Group: Development/Libraries/C and C++
Requires: %{libgio} = %{version}
Requires: %{libglib} = %{version}
Requires: %{libgmodule} = %{version}
Requires: %{libgobject} = %{version}
Requires: %{libgthread} = %{version}
Requires: glib2-tools = %{version}
Requires: glibc-devel
Requires: pkgconfig
# Required by gdbus-codegen
Requires: python3-xml
#
%description devel
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
This package contains the development files for GLib.
%package devel-static
Summary: Static libraries for glib, a general-purpose utility library
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
%description devel-static
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
This package contains static versions of the GLib libraries.
%package -n %{libglib}
Summary: General-Purpose Utility Library
Group: System/Libraries
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
#
%description -n %{libglib}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
%package -n %{libgmodule}
Summary: General-Purpose Utility Library -- Library for Modules
Group: System/Libraries
%description -n %{libgmodule}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The libgmodule library provides a portable way to dynamically load
object files (commonly known as 'plug-ins').
%package -n %{libgio}
Summary: A virtual file system library API
Group: System/Libraries
# The tools are useful for people having libgio
# bnc#555605: shared-mime-info is required by libgio to properly detect mime types, but not during build
#!BuildIgnore: shared-mime-info
Requires: %{name}-tools
# bnc#678518: libgio interacts with others by means of dbus-launch
Requires: dbus-launch
Requires: gio-branding = %{version}
Requires: shared-mime-info
# Needed for branding packages
Provides: gio = %{version}
# Temporarily disable this, pending further discussion
# Recommends: gvfs
%description -n %{libgio}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
GIO provides a modern, easy-to-use VFS API.
%package -n %{libgthread}
Summary: Portable API from glib wrapping system threads
Group: System/Libraries
%description -n %{libgthread}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The libgthread library provides a portable way to write multi-threaded
software.
%package -n %{libgobject}
Summary: Object-Oriented Framework for C
Group: System/Libraries
%description -n %{libgobject}
GLib is a general-purpose utility library, which provides many useful
data types, macros, type conversions, string utilities, file utilities,
a main loop abstraction, and so on.
The GObject library provides an object-oriented framework for C.
%package tests-devel
Summary: Tests for the glib2 package
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
Requires: %{name}-tests = %{version}-%{release}
Provides: %{name}-tests = %{version}-%{release}
Obsoletes: %{name}-tests < %{version}-%{release}