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