flatpak: Allow dual installation of app bundles

Part of https://gitlab.gnome.org/GNOME/Initiatives/issues/1.
Allows for the installation of development bundles alongside
stable versions.

Related to https://gitlab.gnome.org/GNOME/gnome-calendar/issues/285
This commit is contained in:
Christopher Davis
2019-09-30 12:04:08 -03:00
committed by Georges Basile Stavracas Neto
parent 151c47a8b3
commit 0d6b2327e0
13 changed files with 92 additions and 45 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
{
"app-id" : "org.gnome.Calendar",
"app-id" : "org.gnome.Calendar.Devel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
@@ -178,7 +178,8 @@
}
],
"config-opts" : [
"-Dtracing=true"
"-Dtracing=true",
"-Dprofile=development"
]
}
]
+10 -6
View File
@@ -1,9 +1,13 @@
info = 'org.gnome.Calendar.appdata.xml'
i18n.merge_file(
info,
input: 'org.gnome.Calendar.appdata.xml.in',
output: info,
appdata_conf = configuration_data()
appdata_conf.set('appid', application_id)
appdata = i18n.merge_file(
'appdata',
input: configure_file(
input: files('org.gnome.Calendar.appdata.xml.in.in'),
output: 'org.gnome.Calendar.appdata.xml.in',
configuration: appdata_conf
),
output: '@0@.appdata.xml'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(calendar_datadir, 'metainfo')
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 Igor Gnatenko <ignatenko@src.gnome.org> -->
<component type="desktop">
<id>org.gnome.Calendar.desktop</id>
<id>@appid@</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<name>Calendar</name>
+20 -3
View File
@@ -1,4 +1,21 @@
install_subdir(
'hicolor',
install_dir: join_paths(calendar_datadir, 'icons')
symbolic_icondir = join_paths('hicolor', 'symbolic', 'apps')
install_data(
join_paths(symbolic_icondir, 'org.gnome.Calendar-symbolic.svg'),
install_dir: join_paths(
calendar_datadir,
join_paths('icons', symbolic_icondir)
),
rename: '@0@-symbolic.svg'.format(application_id)
)
icondir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(icondir, 'org.gnome.Calendar.svg'),
install_dir: join_paths(
calendar_datadir,
join_paths('icons', icondir)
),
rename: '@0@.svg'.format(application_id)
)
+22 -14
View File
@@ -18,22 +18,30 @@ enums_xml = gnome.mkenums(
# Desktop files
# Note: This name is registered in gcal-weather-service.c.
desktop = 'org.gnome.Calendar.desktop'
i18n.merge_file(
desktop,
type: 'desktop',
input: desktop + '.in',
output: desktop,
po_dir: po_dir,
install: true,
desktop_conf = configuration_data()
desktop_conf.set('icon', application_id)
desktop = i18n.merge_file(
type: 'desktop',
input: configure_file(
input: files('org.gnome.Calendar.desktop.in.in'),
output: 'org.gnome.Calendar.desktop.in',
configuration: desktop_conf
),
output: '@0@.desktop'.format(application_id),
po_dir: po_dir,
install: true,
install_dir: join_paths(calendar_datadir, 'applications')
)
# GNOME Shell search provider
install_data(
'org.gnome.Calendar.search-provider.ini',
install_dir: join_paths(calendar_datadir, 'gnome-shell', 'search-providers')
search_provider_conf = configuration_data()
search_provider_conf.set('appid', application_id)
search_provider_conf.set('profile', profile)
configure_file(
configuration: search_provider_conf,
input: files('org.gnome.Calendar.search-provider.ini.in'),
install_dir: join_paths(calendar_datadir, 'gnome-shell', 'search-providers'),
output: '@0@.search-provider.ini'.format(application_id)
)
# GSettings schema
@@ -63,13 +71,13 @@ compiled_schemas = custom_target(
# DBus service files
service_conf = configuration_data()
service_conf.set('appid', application_id)
service_conf.set('bindir', calendar_bindir)
service = 'org.gnome.Calendar.service'
configure_file(
input: service + '.in',
output: service,
output: '@0@.service'.format(application_id),
install: true,
install_dir: join_paths(calendar_datadir, 'dbus-1', 'services'),
configuration: service_conf
@@ -3,7 +3,7 @@ Name=Calendar
Comment=Access and manage your calendars
Exec=gnome-calendar
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Calendar
Icon=@icon@
Terminal=false
Type=Application
StartupNotify=true
@@ -1,6 +0,0 @@
[Shell Search Provider]
Icon=gnome-calendar
DesktopId=org.gnome.Calendar.desktop
BusName=org.gnome.Calendar
ObjectPath=/org/gnome/Calendar/SearchProvider
Version=2
@@ -0,0 +1,6 @@
[Shell Search Provider]
Icon=gnome-calendar
DesktopId=@appid@.desktop
BusName=@appid@
ObjectPath=/org/gnome/Calendar@profile@/SearchProvider
Version=2
+1 -1
View File
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.gnome.Calendar
Name=@appid@
Exec=@bindir@/gnome-calendar --gapplication-service
+18 -3
View File
@@ -34,6 +34,18 @@ calendar_schemadir = join_paths(calendar_datadir, 'glib-2.0', 'schemas')
# Options #
###########
rev_txt = run_command('git','rev-parse','--short','HEAD').stdout().strip()
if get_option('profile') == 'development'
profile = 'Devel'
name_suffix = ' (Development)'
rev = '-@0@'.format(rev_txt)
else
profile = ''
name_suffix = ''
rev = ''
endif
application_id = 'org.gnome.Calendar.@0@'.format(profile)
calendar_buildtype = get_option('buildtype')
calendar_debug = calendar_minor_version.is_odd() or calendar_buildtype.contains('debug')
enable_tracing = get_option('tracing')
@@ -52,9 +64,12 @@ set_defines = [
['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), calendar_version)],
['PACKAGE_TARNAME', meson.project_name()],
['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Calendar'],
['PACKAGE_VERSION', calendar_version],
['VERSION', calendar_version],
['GETTEXT_PACKAGE', meson.project_name()]
['PACKAGE_VERSION', calendar_version + rev],
['VERSION', calendar_version + rev],
['GETTEXT_PACKAGE', meson.project_name()],
['PROFILE', profile],
['NAME_SUFFIX', name_suffix],
['APPLICATION_ID', application_id]
]
foreach define: set_defines
+1
View File
@@ -1 +1,2 @@
option('tracing', type: 'boolean', value: false, description: 'add extra debugging information')
option('profile', type: 'combo', choices: ['default', 'development'], value: 'default')
+7 -5
View File
@@ -254,6 +254,7 @@ gcal_application_show_about (GSimpleAction *simple,
GcalApplication *self;
GtkWidget *dialog;
GtkLabel *copyright_label;
g_autofree gchar *program_name = NULL;
g_autofree gchar *copyright = NULL;
const gchar *authors[] = {
@@ -273,16 +274,17 @@ gcal_application_show_about (GSimpleAction *simple,
self = GCAL_APPLICATION (user_data);
program_name = g_strconcat (_("Calendar"), NAME_SUFFIX, NULL);
dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
"transient-for", GTK_WINDOW (self->window),
"modal", TRUE,
"destroy-with-parent", TRUE,
"program-name", _("Calendar"),
"program-name", program_name,
"version", VERSION,
"license-type", GTK_LICENSE_GPL_3_0,
"authors", authors,
"artists", artists,
"logo-icon-name", "org.gnome.Calendar",
"logo-icon-name", APPLICATION_ID,
"translator-credits", _("translator-credits"),
NULL);
@@ -425,7 +427,7 @@ gcal_application_startup (GApplication *app)
self = GCAL_APPLICATION (app);
gtk_window_set_default_icon_name ("org.gnome.Calendar");
gtk_window_set_default_icon_name (APPLICATION_ID);
/* add actions */
g_action_map_add_action_entries (G_ACTION_MAP (app),
@@ -541,7 +543,7 @@ gcal_application_dbus_register (GApplication *application,
if (!G_APPLICATION_CLASS (gcal_application_parent_class)->dbus_register (application, connection, object_path, error))
GCAL_RETURN (FALSE);
search_provider_path = g_strconcat (object_path, "/SearchProvider", NULL);
search_provider_path = g_strconcat (object_path, PROFILE, "/SearchProvider", NULL);
if (!gcal_shell_search_provider_dbus_export (self->search_provider, connection, search_provider_path, error))
GCAL_RETURN (FALSE);
@@ -627,7 +629,7 @@ gcal_application_new (void)
{
return g_object_new (gcal_application_get_type (),
"resource-base-path", "/org/gnome/calendar",
"application-id", "org.gnome.Calendar",
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_HANDLES_COMMAND_LINE,
NULL);
}
+2 -3
View File
@@ -18,13 +18,12 @@
#define G_LOG_DOMAIN "GcalWeatherService"
#define DESKTOP_FILE_NAME "org.gnome.Calendar"
#include <geocode-glib/geocode-glib.h>
#include <geoclue.h>
#include <string.h>
#include <math.h>
#include "config.h"
#include "gcal-debug.h"
#include "gcal-timer.h"
#include "gcal-weather-service.h"
@@ -1118,7 +1117,7 @@ gcal_weather_service_run (GcalWeatherService *self,
g_cancellable_cancel (self->location_cancellable);
g_cancellable_reset (self->location_cancellable);
gclue_simple_new (DESKTOP_FILE_NAME,
gclue_simple_new (APPLICATION_ID,
GCLUE_ACCURACY_LEVEL_EXACT,
self->location_cancellable,
(GAsyncReadyCallback) on_gclue_simple_creation_cb,