diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-10-13 12:35:34 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-10-13 13:03:52 +0100 |
commit | c4c161445d95c0a9e48b59f893988ef1f043e16a (patch) | |
tree | 10160179e75f8ee53e64cba4795551601d6687e9 | |
parent | 7610e26c3b1a2ce9bc5d686a05e223a8f6d089b1 (diff) | |
download | libgweather-c4c161445d95c0a9e48b59f893988ef1f043e16a.tar.gz |
Bump up the API version of libgweather
We're now at 4.0. The version bump requires some additional changes:
- the project version is 3.90, while we are in a development cycle
- the main gettext domain has been changed to libgweather-4.0
- the gettext domain for the locations has been changed to
libgweather-4.0-locations
- the settings schemas have been changed to org.gnome.GWeather4
- the soname of the shared library has been changed to match the
versioning scheme used by GLib and GTK
-rw-r--r-- | .gitlab-ci.yml | 2 | ||||
-rw-r--r-- | doc/meson.build | 2 | ||||
-rw-r--r-- | libgweather/gweather-location.c | 5 | ||||
-rw-r--r-- | libgweather/gweather-timezone.c | 4 | ||||
-rw-r--r-- | libgweather/gweather-weather.c | 6 | ||||
-rw-r--r-- | libgweather/meson.build | 39 | ||||
-rw-r--r-- | libgweather/tests/test_libgweather.c | 12 | ||||
-rw-r--r-- | meson.build | 26 | ||||
-rw-r--r-- | po-locations/meson.build | 3 | ||||
-rw-r--r-- | po/meson.build | 3 | ||||
-rw-r--r-- | schemas/meson.build | 6 | ||||
-rw-r--r-- | schemas/org.gnome.GWeather4.gschema.xml (renamed from schemas/org.gnome.GWeather.gschema.xml) | 12 |
12 files changed, 56 insertions, 64 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1d706f..b1b10dc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -232,7 +232,7 @@ reference: vala MESON_VERSION: "0.55.3" DOCS_FLAGS: -Dgtk_doc=true - DOCS_PATH: doc/libgweather-3.0 + DOCS_PATH: doc/libgweather-4.0 pages: stage: deploy diff --git a/doc/meson.build b/doc/meson.build index 7e18715..7ee4cd0 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -21,7 +21,7 @@ if get_option('gtk_doc') and get_option('introspection') custom_target('libgweather-doc', input: gweather_gir[0], - output: 'libgweather-3.0', + output: libgweather_full_version, command: [ gidocgen, 'generate', diff --git a/libgweather/gweather-location.c b/libgweather/gweather-location.c index f999050..760f1ec 100644 --- a/libgweather/gweather-location.c +++ b/libgweather/gweather-location.c @@ -289,10 +289,11 @@ gweather_location_get_name (GWeatherLocation *loc) msgctxt = EMPTY_TO_NULL (db_i18n_get_msgctxt (db_location_get_name (loc->ref))); if (msgctxt) { - loc->_local_name = g_strdup (g_dpgettext2 ("libgweather-locations", + loc->_local_name = g_strdup (g_dpgettext2 (LOCATIONS_GETTEXT_PACKAGE, msgctxt, english_name)); } else { - loc->_local_name = g_strdup (g_dgettext ("libgweather-locations", english_name)); + loc->_local_name = g_strdup (g_dgettext (LOCATIONS_GETTEXT_PACKAGE, + english_name)); } return loc->_local_name; } else { diff --git a/libgweather/gweather-timezone.c b/libgweather/gweather-timezone.c index 7b4327c..87d2100 100644 --- a/libgweather/gweather-timezone.c +++ b/libgweather/gweather-timezone.c @@ -304,9 +304,9 @@ gweather_timezone_get_name (GWeatherTimezone *zone) return NULL; if (msgctxt) - zone->_name = g_strdup (g_dpgettext2 ("libgweather-locations", msgctxt, name)); + zone->_name = g_strdup (g_dpgettext2 (LOCATIONS_GETTEXT_PACKAGE, msgctxt, name)); else - zone->_name = g_strdup (g_dgettext ("libgweather-locations", name)); + zone->_name = g_strdup (g_dgettext (LOCATIONS_GETTEXT_PACKAGE, name)); return zone->_name; } diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c index 3e8b60a..98b3998 100644 --- a/libgweather/gweather-weather.c +++ b/libgweather/gweather-weather.c @@ -75,9 +75,9 @@ _gweather_gettext_init (void) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif - bindtextdomain ("libgweather-locations", GNOMELOCALEDIR); + bindtextdomain (LOCATIONS_GETTEXT_PACKAGE, GNOMELOCALEDIR); #ifdef HAVE_BIND_TEXTDOMAIN_CODESET - bind_textdomain_codeset ("libgweather-locations", "UTF-8"); + bind_textdomain_codeset (LOCATIONS_GETTEXT_PACKAGE, "UTF-8"); #endif g_once_init_leave (&gweather_gettext_initialized, TRUE); @@ -563,7 +563,7 @@ void gweather_info_init (GWeatherInfo *info) { info->providers = GWEATHER_PROVIDER_METAR | GWEATHER_PROVIDER_IWIN; - info->settings = g_settings_new ("org.gnome.GWeather"); + info->settings = g_settings_new ("org.gnome.GWeather4"); g_signal_connect_object (info->settings, "changed", G_CALLBACK (settings_changed_cb), info, 0); diff --git a/libgweather/meson.build b/libgweather/meson.build index a534bfd..ccd8995 100644 --- a/libgweather/meson.build +++ b/libgweather/meson.build @@ -22,16 +22,17 @@ add_project_arguments(c_compiler.get_supported_arguments([ '-Werror=missing-include-dirs', ]), language: 'c') -header_subdir = 'libgweather-3.0/libgweather' - -# convert to soname -current = libgweather_lt_c - libgweather_lt_a -interface_age = libgweather_lt_r -libgweather_so_version = '@0@.@1@.@2@'.format( - current, - libgweather_lt_a, - interface_age, -) +header_subdir = libgweather_full_version / 'libgweather' + +libgweather_major = libgweather_version[0].to_int() +libgweather_minor = libgweather_version[1].to_int() +libgweather_micro = libgweather_version[2].to_int() +interface_age = libgweather_minor.is_odd() ? 0 : libgweather_micro +binary_age = libgweather_minor * 100 + libgweather_micro +current = binary_age - interface_age + +libgweather_soversion = 0 +libgweather_library_version = '@0@.@1@.@2@'.format(libgweather_soversion, current, interface_age) libgweather_darwin_versions = [ current + 1, @@ -40,6 +41,7 @@ libgweather_darwin_versions = [ config_h = configuration_data() config_h.set_quoted('GETTEXT_PACKAGE', GETTEXT_PACKAGE) +config_h.set_quoted('LOCATIONS_GETTEXT_PACKAGE', LOCATIONS_GETTEXT_PACKAGE) config_h.set_quoted('LOCALEDIR', datadir / 'locale') config_h.set_quoted('GNOMELOCALEDIR', datadir / 'locale') config_h.set_quoted('G_LOG_DOMAIN', 'GWeather') @@ -80,9 +82,9 @@ configure_file( ) versionconf = configuration_data() -versionconf.set('GWEATHER_MAJOR_VERSION', libgweather_version[0]) -versionconf.set('GWEATHER_MINOR_VERSION', libgweather_version[1]) -versionconf.set('GWEATHER_MICRO_VERSION', libgweather_version[2]) +versionconf.set('GWEATHER_MAJOR_VERSION', libgweather_major) +versionconf.set('GWEATHER_MINOR_VERSION', libgweather_minor) +versionconf.set('GWEATHER_MICRO_VERSION', libgweather_micro) versionconf.set_quoted('GWEATHER_VERSION', meson.project_version()) configure_file( input: 'gweather-version.h.in', @@ -164,10 +166,11 @@ libgweather_static_dep = declare_dependency(sources: gweather_c_sources, link_with: libgweather_static, ) -lib_libgweather = shared_library('gweather-3', +lib_libgweather = shared_library('gweather-4', dependencies: deps_libgweather, link_whole: libgweather_static, - version: libgweather_so_version, + soversion: libgweather_soversion, + version: libgweather_library_version, gnu_symbol_visibility: 'hidden', darwin_versions: libgweather_darwin_versions, include_directories: [ @@ -191,12 +194,12 @@ if build_gir gweather_gir = gnome.generate_gir(lib_libgweather, sources: introspection_sources, dependencies: deps_libgweather, - nsversion: '3.0', + nsversion: libgweather_api_version, namespace: 'GWeather', includes: ['GObject-2.0', 'Gtk-3.0'], symbol_prefix: 'gweather', identifier_prefix: 'GWeather', - export_packages: 'gweather-3.0', + export_packages: 'gweather-' + libgweather_api_version, header: 'libgweather/gweather.h', extra_args: [ '--warn-all', @@ -220,7 +223,7 @@ libgweather_dep = declare_dependency( ) if build_vapi and build_gir - gnome.generate_vapi('gweather-3.0', + gnome.generate_vapi('gweather-' + libgweather_api_version, sources: gweather_gir[0], packages: ['gobject-2.0', 'gtk+-3.0'], metadata_dirs: '.', diff --git a/libgweather/tests/test_libgweather.c b/libgweather/tests/test_libgweather.c index d00159d..1cc8a49 100644 --- a/libgweather/tests/test_libgweather.c +++ b/libgweather/tests/test_libgweather.c @@ -457,22 +457,22 @@ set_gsettings (void) g_assert_nonnull (tmpdir); /* Copy the schemas files */ - g_assert_true (g_file_get_contents (SCHEMAS_BUILDDIR "/org.gnome.GWeather.enums.xml", &schema_text, NULL, NULL)); - dest = g_strdup_printf ("%s/org.gnome.GWeather.enums.xml", tmpdir); + g_assert_true (g_file_get_contents (SCHEMAS_BUILDDIR "/org.gnome.GWeather4.enums.xml", &schema_text, NULL, NULL)); + dest = g_build_filename (tmpdir, "org.gnome.GWeather4.enums.xml", NULL); g_assert_true (g_file_set_contents (dest, schema_text, -1, NULL)); g_free (dest); g_free (schema_text); - g_assert_true (g_file_get_contents (SCHEMASDIR "/org.gnome.GWeather.gschema.xml", &schema_text, NULL, NULL)); - dest = g_strdup_printf ("%s/org.gnome.GWeather.gschema.xml", tmpdir); + g_assert_true (g_file_get_contents (SCHEMASDIR "/org.gnome.GWeather4.gschema.xml", &schema_text, NULL, NULL)); + dest = g_build_filename (tmpdir, "org.gnome.GWeather4.gschema.xml", NULL); g_assert_true (g_file_set_contents (dest, schema_text, -1, NULL)); g_free (dest); g_free (schema_text); /* Compile the schemas */ cmdline = g_strdup_printf ("glib-compile-schemas --targetdir=%s " - "--schema-file=%s/org.gnome.GWeather.enums.xml " - "--schema-file=%s/org.gnome.GWeather.gschema.xml", + "--schema-file=%s/org.gnome.GWeather4.enums.xml " + "--schema-file=%s/org.gnome.GWeather4.gschema.xml", tmpdir, SCHEMAS_BUILDDIR, SCHEMASDIR); g_assert_true (g_spawn_command_line_sync (cmdline, NULL, NULL, &result, NULL)); g_assert_cmpint (result, ==, 0); diff --git a/meson.build b/meson.build index 136dcdc..774342d 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('libgweather', 'c', - version: '40.0', + version: '3.90.0', license: 'GPL-2.0-or-later', meson_version: '>= 0.55.0', default_options: [ @@ -9,20 +9,9 @@ project('libgweather', 'c', ], ) -# Add another 0, so that we can release without a suffix -libgweather_version = meson.project_version().split('.') + [0] - -# We use libtool-version numbers because it's easier to understand. -# Before making a release, the libgweather_so_* -# numbers should be modified. The components are of the form C:R:A. -# a) If binary compatibility has been broken (eg removed or changed interfaces) -# change to C+1:0:0. -# b) If interfaces have been changed or added, but binary compatibility has -# been preserved, change to C+1:0:A+1 -# c) If the interface is the same as the previous version, change to C:R+1:A -libgweather_lt_c=16 -libgweather_lt_r=0 -libgweather_lt_a=0 +libgweather_version = meson.project_version().split('.') +libgweather_api_version = '4.0' +libgweather_full_version = '@0@-@1@'.format(meson.project_name(), libgweather_api_version) pkgconfig = import('pkgconfig') gnome = import('gnome') @@ -45,7 +34,8 @@ gtk_req_version = '>= 3.13.5' libsoup_req_version = '>= 2.44.0' libxml_req_version = '>= 2.6.0' -GETTEXT_PACKAGE = 'libgweather-3.0' +GETTEXT_PACKAGE = libgweather_full_version +LOCATIONS_GETTEXT_PACKAGE = libgweather_full_version + '-locations' pylint = find_program('pylint-3', 'pylint3', 'pylint', required: false) pylint_flags = [ @@ -77,12 +67,12 @@ subdir('po-locations') meson.add_install_script('build-aux/meson/meson_post_install.py') pkgconfig.generate( - filebase: 'gweather-3.0', + filebase: 'gweather-' + libgweather_api_version, name: 'GWeather', description: 'GWeather shared library', version: meson.project_version(), libraries: lib_libgweather, - subdirs: 'libgweather-3.0', + subdirs: libgweather_full_version, requires: [ 'gtk+-3.0', ], diff --git a/po-locations/meson.build b/po-locations/meson.build index 7aa587d..ed14742 100644 --- a/po-locations/meson.build +++ b/po-locations/meson.build @@ -1,5 +1,4 @@ # XXX: This should be a files() object in data/ but i18n.gettext() does not # like that with Meson 0.43 locations_its = join_paths(meson.current_source_dir(), '../data/locations.its') -i18n.gettext('libgweather-locations', - args: ['--its', locations_its]) +i18n.gettext(LOCATIONS_GETTEXT_PACKAGE, args: ['--its', locations_its]) diff --git a/po/meson.build b/po/meson.build index 0136c4c..a9e1d3e 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,2 +1 @@ -i18n.gettext('libgweather-3.0', - preset: 'glib') +i18n.gettext(GETTEXT_PACKAGE, preset: 'glib') diff --git a/schemas/meson.build b/schemas/meson.build index 677e4ef..3226aef 100644 --- a/schemas/meson.build +++ b/schemas/meson.build @@ -1,12 +1,12 @@ gsettingsdir = datadir / 'glib-2.0/schemas' -install_data('org.gnome.GWeather.gschema.xml', +install_data('org.gnome.GWeather4.gschema.xml', install_dir: gsettingsdir, ) -gnome.mkenums('org.gnome.GWeather.enums.xml', +gnome.mkenums('org.gnome.GWeather4.enums.xml', comments: '<!-- @comment@ -->', fhead: '<schemalist>', - vhead: '<@type@ id="org.gnome.GWeather.@EnumName@">', + vhead: '<@type@ id="org.gnome.GWeather4.@EnumName@">', vprod: '<value nick="@valuenick@" value="@valuenum@"/>', vtail: '</@type@>', ftail: '</schemalist>', diff --git a/schemas/org.gnome.GWeather.gschema.xml b/schemas/org.gnome.GWeather4.gschema.xml index 1481842..43de236 100644 --- a/schemas/org.gnome.GWeather.gschema.xml +++ b/schemas/org.gnome.GWeather4.gschema.xml @@ -1,5 +1,5 @@ -<schemalist gettext-domain="libgweather-3.0"> - <schema id="org.gnome.GWeather" path="/org/gnome/GWeather/"> +<schemalist gettext-domain="libgweather-4.0"> + <schema id="org.gnome.GWeather4" path="/org/gnome/GWeather4/"> <key name="radar" type="s"> <default>''</default> <summary>URL for the radar map</summary> @@ -8,7 +8,7 @@ for disabling radar maps. </description> </key> - <key name="temperature-unit" enum="org.gnome.GWeather.GWeatherTemperatureUnit"> + <key name="temperature-unit" enum="org.gnome.GWeather4.GWeatherTemperatureUnit"> <default>'default'</default> <summary>Temperature unit</summary> <description> @@ -16,7 +16,7 @@ “centigrade” and “fahrenheit”. </description> </key> - <key name="distance-unit" enum="org.gnome.GWeather.GWeatherDistanceUnit"> + <key name="distance-unit" enum="org.gnome.GWeather4.GWeatherDistanceUnit"> <default>'default'</default> <summary>Distance unit</summary> <description> @@ -24,7 +24,7 @@ distance of important events). Valid values are “meters”, “km” and “miles”. </description> </key> - <key name="speed-unit" enum="org.gnome.GWeather.GWeatherSpeedUnit"> + <key name="speed-unit" enum="org.gnome.GWeather4.GWeatherSpeedUnit"> <default>'default'</default> <summary>Speed unit</summary> <description> @@ -33,7 +33,7 @@ per hour), “knots” and “bft” (Beaufort scale). </description> </key> - <key name="pressure-unit" enum="org.gnome.GWeather.GWeatherPressureUnit"> + <key name="pressure-unit" enum="org.gnome.GWeather4.GWeatherPressureUnit"> <default>'default'</default> <summary>Pressure unit</summary> <description> |