[gnome-usage/bielmoussaoui/nightlies] Build: Setup dual installation
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage/bielmoussaoui/nightlies] Build: Setup dual installation
- Date: Thu, 26 Sep 2019 20:07:05 +0000 (UTC)
commit 4c3d5f0cecdc4b3b78d15a5431cb9397483f983a
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Thu Sep 26 22:07:01 2019 +0200
Build: Setup dual installation
This allow setting a development profile for nightly builds
.gitlab-ci.yml | 2 +-
data/meson.build | 43 +++++++++++++++-------
...ta.xml.in => org.gnome.Usage.appdata.xml.in.in} | 3 +-
...ge.desktop.in => org.gnome.Usage.desktop.in.in} | 2 +-
....gschema.xml => org.gnome.Usage.gschema.xml.in} | 2 +-
meson.build | 11 ++++++
meson_options.txt | 11 ++++++
org.gnome.Usage.json | 6 ++-
src/application.vala | 4 +-
src/meson.build | 5 ++-
src/settings.vala | 2 +-
src/window.vala | 4 ++
vapi/config.vapi | 3 ++
13 files changed, 74 insertions(+), 24 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7dd8496..cbe6d0f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,7 +25,7 @@ flatpak:
MANIFEST_PATH: 'org.gnome.Usage.json'
RUNTIME_REPO: 'https://nightly.gnome.org/gnome-nightly.flatpakrepo'
FLATPAK_MODULE: 'gnome-usage'
- APP_ID: 'org.gnome.Usage'
+ APP_ID: 'org.gnome.UsageDevel'
review:
dependencies:
diff --git a/data/meson.build b/data/meson.build
index b9fabb8..6896701 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -23,32 +23,47 @@ resources = gnome.compile_resources(
dependencies: resource_data
)
-install_data('org.gnome.Usage.gschema.xml', install_dir : get_option('datadir') + '/glib-2.0/schemas/')
-
-desktop = 'org.gnome.Usage.desktop'
+schema_conf = configuration_data()
+schema_conf.set('app-id', application_id)
+configure_file(
+ input: 'org.gnome.Usage.gschema.xml.in',
+ output: '@BASENAME@',
+ configuration: schema_conf,
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
+)
+desktop_conf = configuration_data()
+desktop_conf.set('icon', application_id)
i18n.merge_file(
- desktop,
type: 'desktop',
- input: desktop + '.in',
- output: desktop,
+ input: configure_file(
+ input: 'org.gnome.Usage.desktop.in.in',
+ output: '@BASENAME@',
+ configuration: desktop_conf
+ ),
+ output: '@0@.desktop'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
-appdata = 'org.gnome.Usage.appdata.xml'
-
+appdata_conf = configuration_data()
+appdata_conf.set('app-id', application_id)
i18n.merge_file(
- appdata,
- input: appdata + '.in',
- output: appdata,
+ input: configure_file(
+ input: 'org.gnome.Usage.appdata.xml.in.in',
+ output: '@BASENAME@',
+ configuration: appdata_conf
+ ),
+ output: '@0 appdata xml'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
-install_subdir(
- 'icons/hicolor',
- install_dir: join_paths(get_option('datadir'), 'icons')
+install_data(
+ 'icons/hicolor/scalable/apps/org.gnome.Usage.svg',
+ install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps'),
+ rename: '@0@.svg'.format(application_id)
)
diff --git a/data/org.gnome.Usage.appdata.xml.in b/data/org.gnome.Usage.appdata.xml.in.in
similarity index 96%
rename from data/org.gnome.Usage.appdata.xml.in
rename to data/org.gnome.Usage.appdata.xml.in.in
index 687a71c..7390c82 100644
--- a/data/org.gnome.Usage.appdata.xml.in
+++ b/data/org.gnome.Usage.appdata.xml.in.in
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
- <id>org.gnome.Usage.desktop</id>
+ <id>@app-id@</id>
<metadata_license>CC0-1.0</metadata_license>
<name>GNOME Usage</name>
<summary>A nice way to view information about use of system resources</summary>
@@ -40,6 +40,7 @@
<kudo>HighContrast</kudo>
<kudo>ModernToolkit</kudo>
</kudos>
+ <launchable type="desktop-id">@app-id@.desktop</launchable>
<project_license>GPL-3.0+</project_license>
<url type="bugtracker">https://gitlab.gnome.org/GNOME/gnome-usage/issues</url>
<url type="donation">http://www.gnome.org/friends/</url>
diff --git a/data/org.gnome.Usage.desktop.in b/data/org.gnome.Usage.desktop.in.in
similarity index 96%
rename from data/org.gnome.Usage.desktop.in
rename to data/org.gnome.Usage.desktop.in.in
index 71bff5b..cb9a615 100644
--- a/data/org.gnome.Usage.desktop.in
+++ b/data/org.gnome.Usage.desktop.in.in
@@ -4,7 +4,7 @@ Comment=A nice way to view information about use of system resources, like memor
Categories=GNOME;GTK;System;Monitor;
Exec=gnome-usage
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=org.gnome.Usage
+Icon=@icon@
Terminal=false
StartupNotify=true
Type=Application
diff --git a/data/org.gnome.Usage.gschema.xml b/data/org.gnome.Usage.gschema.xml.in
similarity index 83%
rename from data/org.gnome.Usage.gschema.xml
rename to data/org.gnome.Usage.gschema.xml.in
index de8c4fc..0cd6a04 100644
--- a/data/org.gnome.Usage.gschema.xml
+++ b/data/org.gnome.Usage.gschema.xml.in
@@ -1,5 +1,5 @@
<schemalist>
- <schema id="org.gnome.Usage" path="/org/gnome/Usage/" gettext-domain="gnome-usage">
+ <schema id="@app-id@" path="/org/gnome/Usage/" gettext-domain="gnome-usage">
<key name="unkillable-processes" type="as">
<default>['gnome-shell', 'gdm-x-session', 'gdm-wayland-session', 'gdm', 'systemd',
'gdm-session-worker', 'pulseaudio', 'Xorg', 'system']</default>
<summary>A list of processes which we don’t want killed</summary>
diff --git a/meson.build b/meson.build
index 32ec3f4..48c6039 100644
--- a/meson.build
+++ b/meson.build
@@ -23,6 +23,17 @@ i18n = import('i18n')
po_dir = join_paths(meson.source_root(), 'po')
vapi_dir = join_paths (meson.source_root (), 'vapi')
+if get_option('profile') == 'development'
+ profile = 'Devel'
+ name_suffix = ' (Development)'
+else
+ profile = ''
+ name_suffix = ''
+endif
+
+application_id = 'org.gnome.Usage@0@'.format(profile)
+
+
subdir('data')
subdir('po')
subdir('src')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..24b4a55
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,11 @@
+option(
+ 'profile',
+ type: 'combo',
+ choices: [
+ 'default',
+ 'development'
+ ],
+ value: 'default',
+ description: 'The build profile for Usage. One of "default" or "development".'
+)
+
diff --git a/org.gnome.Usage.json b/org.gnome.Usage.json
index 2770bfe..e5d3a8a 100644
--- a/org.gnome.Usage.json
+++ b/org.gnome.Usage.json
@@ -1,5 +1,5 @@
{
- "app-id": "org.gnome.Usage",
+ "app-id": "org.gnome.UsageDevel",
"runtime": "org.gnome.Sdk",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
@@ -68,7 +68,9 @@
},
{
"buildsystem": "meson",
- "builddir": true,
+ "config-opts": [
+ "-Dprofile=development"
+ ],
"name": "gnome-usage",
"sources": [
{
diff --git a/src/application.vala b/src/application.vala
index 4d2579a..306874e 100644
--- a/src/application.vala
+++ b/src/application.vala
@@ -36,7 +36,7 @@ namespace Usage
public Application ()
{
- application_id = "org.gnome.Usage";
+ application_id = Config.APPLICATION_ID;
}
public Window? get_window()
@@ -75,7 +75,7 @@ namespace Usage
};
Gtk.show_about_dialog (window,
- logo_icon_name: "org.gnome.Usage",
+ logo_icon_name: Config.APPLICATION_ID,
program_name: _("Usage"),
comments: _("A nice way to view information about use of system resources, like memory and
disk space."),
authors: authors,
diff --git a/src/meson.build b/src/meson.build
index c3a7ddc..aa1b736 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -66,7 +66,10 @@ deps = [
c_args = [
'-DVERSION="@0@"'.format(meson.project_version()),
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
- '-DGNOMELOCALEDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localedir')))
+ '-DGNOMELOCALEDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localedir'))),
+ '-DPROFILE="@0@"'.format(profile),
+ '-DAPPLICATION_ID="@0@"'.format(application_id),
+ '-DNAME_SUFFIX="@0@"'.format(name_suffix)
]
executable(
diff --git a/src/settings.vala b/src/settings.vala
index 83bb531..f82e7b8 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -43,7 +43,7 @@ namespace Usage {
public Settings()
{
- Object(schema_id: "org.gnome.Usage");
+ Object(schema_id: Config.APPLICATION_ID);
}
}
}
diff --git a/src/window.vala b/src/window.vala
index 16fd96c..d36b012 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -40,6 +40,10 @@ namespace Usage
this.window_position = Gtk.WindowPosition.CENTER;
this.set_title(_("Usage"));
+ if(Config.PROFILE == "Devel") {
+ get_style_context().add_class("devel");
+ }
+
load_css();
Gtk.Settings.get_for_screen(get_screen()).notify["gtk-application-prefer-dark-theme"].connect(()
=>
{
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 0e4fffe..136c0a9 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -3,5 +3,8 @@ namespace Config {
public const string VERSION;
public const string GETTEXT_PACKAGE;
public const string GNOMELOCALEDIR;
+ public const string APPLICATION_ID;
+ public const string NAME_SUFFIX;
+ public const string PROFILE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]