Commit ba2344dc authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

build: Allow parallel installation of development builds

Adds '-Dprofile=development' build option that changes application id to
'org.gnome.GamesDevel' and name to 'GNOME Games (Development)'.
parent ed48a4c8
......@@ -6,12 +6,14 @@ foreach icon_size: icon_sizes
install_data(
join_paths(hicolor_dir, 'org.gnome.Games.png'),
install_dir: join_paths(datadir, 'icons', hicolor_dir)
install_dir: join_paths(datadir, 'icons', hicolor_dir),
rename: '@0@.png'.format(application_id)
)
install_data(
join_paths(highcontrast_dir, 'org.gnome.Games.png'),
install_dir: join_paths(datadir, 'icons', highcontrast_dir)
install_dir: join_paths(datadir, 'icons', highcontrast_dir),
rename: '@0@.png'.format(application_id)
)
endforeach
......@@ -19,5 +21,6 @@ hicolor_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(hicolor_dir, 'org.gnome.Games-symbolic.svg'),
install_dir: join_paths(datadir, 'icons', hicolor_dir)
install_dir: join_paths(datadir, 'icons', hicolor_dir),
rename: '@0@-symbolic.svg'.format(application_id)
)
......@@ -4,18 +4,30 @@ resources = gnome.compile_resources(
c_name: 'resources'
)
desktop_conf = configuration_data()
desktop_conf.set('icon', application_id)
i18n.merge_file ('desktop-file',
type: 'desktop',
input: 'org.gnome.Games.desktop.in',
output: 'org.gnome.Games.desktop',
input: configure_file(
input: files('org.gnome.Games.desktop.in.in'),
output: 'org.gnome.Games.desktop.in',
configuration: desktop_conf
),
output: '@0@.desktop'.format(application_id),
po_dir: podir,
install: true,
install_dir: join_paths (datadir, 'applications')
)
appdata_conf = configuration_data()
appdata_conf.set('appid', application_id)
i18n.merge_file ('appdata-file',
input: 'org.gnome.Games.appdata.xml.in',
output: 'org.gnome.Games.appdata.xml',
input: configure_file(
input: files('org.gnome.Games.appdata.xml.in.in'),
output: 'org.gnome.Games.appdata.xml.in',
configuration: appdata_conf
),
output: '@0@.appdata.xml'.format(application_id),
po_dir: podir,
install: true,
install_dir: join_paths (datadir, 'metainfo')
......
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.gnome.Games.desktop</id>
<id>@appid@.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Games</name>
......
......@@ -6,7 +6,7 @@ Comment=View and play your video games collection
Keywords=game;videogame;video game;player;
Exec=gnome-games %U
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Games
Icon=@icon@
Terminal=false
Type=Application
StartupNotify=true
......
......@@ -13,7 +13,6 @@
<property name="can_focus">False</property>
<property name="valign">center</property>
<property name="pixel_size">128</property>
<property name="icon_name">org.gnome.Games-symbolic</property>
<property name="icon-size">0</property>
<property name="margin-bottom">18</property>
<style>
......
......@@ -5,6 +5,16 @@ project('gnome-games',
meson_version: '>= 0.46.1'
)
if get_option('profile') == 'development'
profile = 'Devel'
name_suffix = ' (Development)'
else
profile = ''
name_suffix = ''
endif
application_id = 'org.gnome.Games@0@'.format(profile)
gnome = import ('gnome')
i18n = import('i18n')
......@@ -38,10 +48,13 @@ options_dir = join_paths (datadir, meson.project_name(), 'options')
plugins_dir = join_paths (libdir, meson.project_name(), 'plugins')
config_h = configuration_data ()
config_h.set_quoted ('APPLICATION_ID', application_id)
config_h.set_quoted ('GETTEXT_PACKAGE', meson.project_name ())
config_h.set_quoted ('GNOMELOCALEDIR', localedir)
config_h.set_quoted ('NAME_SUFFIX', name_suffix)
config_h.set_quoted ('OPTIONS_DIR', options_dir)
config_h.set_quoted ('PLUGINS_DIR', plugins_dir)
config_h.set_quoted ('PROFILE', profile)
config_h.set_quoted ('VERSION', meson.project_version ())
configure_file (output: 'config.h', configuration: config_h)
......
option (
'profile',
type: 'combo',
choices: [
'default',
'development'
],
value: 'default'
)
# Plugins
# This must mirror the list in plugins/meson.build
option ('desktop-plugin', description: 'Support for desktop games', type: 'boolean')
......
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Config {
public const string APPLICATION_ID;
public const string GETTEXT_PACKAGE;
public const string GNOMELOCALEDIR;
public const string NAME_SUFFIX;
public const string OPTIONS_DIR;
public const string PLUGINS_DIR;
public const string PROFILE;
public const string VERSION;
}
......@@ -13,16 +13,16 @@ public class Games.Application : Gtk.Application {
private GameCollection game_collection;
internal Application () {
Object (application_id: "org.gnome.Games",
Object (application_id: Config.APPLICATION_ID,
flags: ApplicationFlags.HANDLES_OPEN);
}
construct {
Environment.set_prgname ("gnome-games");
Environment.set_application_name (_("Games"));
Gtk.Window.set_default_icon_name ("org.gnome.Games");
Gtk.Window.set_default_icon_name (Config.APPLICATION_ID);
Environment.set_variable ("PULSE_PROP_media.role", "game", true);
Environment.set_variable ("PULSE_PROP_application.icon_name", "org.gnome.Games", true);
Environment.set_variable ("PULSE_PROP_application.icon_name", Config.APPLICATION_ID, true);
add_actions ();
add_signal_handlers ();
......@@ -351,8 +351,8 @@ public class Games.Application : Gtk.Application {
dialog.set_transient_for (window);
dialog.set_modal (true);
dialog.program_name = _("GNOME Games");
dialog.logo_icon_name = "org.gnome.Games";
dialog.program_name = _("GNOME Games") + Config.NAME_SUFFIX;
dialog.logo_icon_name = Config.APPLICATION_ID;
dialog.comments = _("A video game player for GNOME");
dialog.version = Config.VERSION;
......
......@@ -2,4 +2,11 @@
[GtkTemplate (ui = "/org/gnome/Games/ui/empty-collection.ui")]
private class Games.EmptyCollection : Gtk.Box {
[GtkChild]
private Gtk.Image icon;
construct {
var icon_name = Config.APPLICATION_ID + "-symbolic";
icon.icon_name = icon_name;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment