Skip to content

Commit

Permalink
build: Use version suffix instead of name suffix
Browse files Browse the repository at this point in the history
Over the last cycles, apps added to GNOME core are not using the suffix in
their names for development versions. Instead, they are adding a suffix to
the app version following the running commit. Since it simplifies build
files a bit and translators work, let's go that route as well.

A critical is expected when opening about window in development versions as
they would never match with stable versions listed in metainfo.
  • Loading branch information
oscfdezdz committed Jan 30, 2024
1 parent 15de64f commit 61b4808
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion data/com.mattjakeman.ExtensionManager.desktop.in.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Desktop Entry]
Name=@app_title@
Name=Extension Manager
Exec=extension-manager %U
Icon=@app_id@
Terminal=false
Expand Down
2 changes: 1 addition & 1 deletion data/com.mattjakeman.ExtensionManager.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<id>@app_id@.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>@app_title@</name>
<name>Extension Manager</name>
<summary>Browse, install, and manage GNOME Shell Extensions</summary>
<content_rating type="oars-1.1" />
<developer_name translatable="no">Matthew Jakeman</developer_name>
Expand Down
3 changes: 0 additions & 3 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
desktop_file_in_config = configuration_data()
desktop_file_in_config.set('app_id', app_id)
desktop_file_in_config.set('app_title', app_title)
desktop_file_in_config.set('app_version', meson.project_version())
desktop_file_in = configure_file(
input: 'com.mattjakeman.ExtensionManager.desktop.in.in',
output: '@0@.desktop.in'.format(app_id),
Expand All @@ -26,7 +24,6 @@ endif

appconf = configuration_data()
appconf.set('app_id', app_id)
appconf.set('app_title', app_title)
appstream_file_in = configure_file(
input: 'com.mattjakeman.ExtensionManager.metainfo.xml.in.in',
output: 'com.mattjakeman.ExtensionManager.metainfo.xml.in',
Expand Down
12 changes: 8 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ project('extension-manager', 'c',
i18n = import('i18n')

if get_option('development')
app_title = 'Extension Manager (Development)'
app_id = 'com.mattjakeman.ExtensionManager.Devel'
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip()
if vcs_tag == ''
version_suffix = '-devel'
else
version_suffix = '-@0@'.format(vcs_tag)
endif
else
app_title = 'Extension Manager'
app_id = 'com.mattjakeman.ExtensionManager'
version_suffix = ''
endif

config_h = configuration_data()
config_h.set_quoted('APP_VERSION', meson.project_version())
config_h.set_quoted('APP_VERSION', meson.project_version() + version_suffix)
config_h.set_quoted('GETTEXT_PACKAGE', 'extension-manager')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
config_h.set_quoted('APP_ID', app_id)
config_h.set_quoted('PKG_NAME', get_option('package'))
config_h.set_quoted('PKG_DISTRIBUTOR', get_option('distributor'))
config_h.set10('IS_OFFICIAL', get_option('official'))
config_h.set10('IS_DEVEL', get_option('development'))
config_h.set10('WITH_BACKTRACE', get_option('backtrace'))
configure_file(
output: 'exm-config.h',
Expand Down
1 change: 1 addition & 0 deletions src/exm-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ exm_application_show_about (GSimpleAction *action,
gtk_window_set_modal (GTK_WINDOW (about_window), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (about_window), window);

adw_about_window_set_version (ADW_ABOUT_WINDOW (about_window), APP_VERSION);
adw_about_window_set_comments (ADW_ABOUT_WINDOW (about_window), _("Browse, install, and manage GNOME Shell Extensions."));
adw_about_window_set_developers (ADW_ABOUT_WINDOW (about_window), authors);
adw_about_window_set_translator_credits (ADW_ABOUT_WINDOW (about_window), _("translator-credits"));
Expand Down
1 change: 0 additions & 1 deletion src/exm-error-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ exm_error_dialog_set_property (GObject *object,
GString *string_builder = g_string_new ("Support Log\n");
g_string_append_printf (string_builder, "----\n");
g_string_append_printf (string_builder, "Version: %s\n", APP_VERSION);
g_string_append_printf (string_builder, "Development: %s\n", IS_DEVEL ? "Yes" : "No");
g_string_append_printf (string_builder, "Package Format: %s\n", PKG_NAME);
g_string_append_printf (string_builder, "Status: %s\n", IS_OFFICIAL ? "Official" : "Third Party");
g_string_append_printf (string_builder, "----\n");
Expand Down
2 changes: 2 additions & 0 deletions src/exm-window.blp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ template $ExmWindow : Adw.ApplicationWindow {
default-height: 600;
width-request: 360;
height-request: 294;
title: _("Extension Manager");

Adw.Breakpoint main_breakpoint {
condition ("max-width: 400sp")
Expand All @@ -20,6 +21,7 @@ template $ExmWindow : Adw.ApplicationWindow {

Adw.NavigationPage main_view {
can-pop: false;
title: bind template.title;

Adw.ToolbarView {

Expand Down
9 changes: 1 addition & 8 deletions src/exm-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,22 +454,15 @@ do_version_check (ExmWindow *self)
static void
exm_window_init (ExmWindow *self)
{
gchar *title;

gtk_widget_init_template (GTK_WIDGET (self));

if (IS_DEVEL) {
if (strstr (APP_ID, ".Devel") != NULL) {
gtk_widget_add_css_class (GTK_WIDGET (self), "devel");
}

self->manager = exm_manager_new ();
g_signal_connect (self->manager, "error-occurred", on_error, self);

title = IS_DEVEL ? _("Extension Manager (Development)") : _("Extension Manager");

gtk_window_set_title (GTK_WINDOW (self), title);
adw_navigation_page_set_title (self->main_view, title);

g_object_set (self->installed_page, "manager", self->manager, NULL);
g_object_set (self->browse_page, "manager", self->manager, NULL);
g_object_set (self->detail_view, "manager", self->manager, NULL);
Expand Down

0 comments on commit 61b4808

Please sign in to comment.