summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2019-09-28 16:35:34 -0700
committerCosimo Cecchi <cosimoc@gnome.org>2019-09-28 17:24:12 -0700
commit0e070cc98a59c93ba0fdc89ace3d4f545ef54be0 (patch)
treeb0aa13e98003dca9e8f95cb3657f5a35d2bf4e1d
parent24485438bcabfdc41ebbe8dec9d4ce9e40fd5deb (diff)
downloadgnome-font-viewer-wip/cosimoc/nightly-flatpak.tar.gz
Support building a nightly flatpakwip/cosimoc/nightly-flatpak
This allows to build a development version of the flatpak that can be installed alongside the default one. We also switch the CI job to do that.
-rw-r--r--.gitlab-ci.yml10
-rw-r--r--data/icons/hicolor/scalable/apps/org.gnome.font-viewerDevel.svg (renamed from data/icons/hicolor/scalable/apps/org.gnome.font-viewer.Devel.svg)0
-rw-r--r--data/icons/meson.build5
-rw-r--r--flatpak/org.gnome.font-viewerDevel.json52
-rw-r--r--meson.build9
-rw-r--r--meson_options.txt1
-rw-r--r--src/font-view.c4
-rw-r--r--src/meson.build14
-rw-r--r--src/org.gnome.font-viewer.desktop.in.in (renamed from src/org.gnome.font-viewer.desktop.in)2
-rw-r--r--src/org.gnome.font-viewer.service.in2
10 files changed, 85 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d1dbb72..2ef96ed 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,23 +2,23 @@ stages:
- build
variables:
- BUNDLE: 'org.gnome.font-viewer.Devel.flatpak'
+ BUNDLE: 'org.gnome.font-viewerDevel.flatpak'
flatpak:
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
stage: 'build'
variables:
- MANIFEST_PATH: 'flatpak/org.gnome.font-viewer.json'
- MESON_ARGS: ''
+ MANIFEST_PATH: 'flatpak/org.gnome.font-viewerDevel.json'
+ MESON_ARGS: '-Dprofile=development'
RUNTIME_REPO: 'https://sdk.gnome.org/gnome-nightly.flatpakrepo'
FLATPAK_MODULE: 'gnome-font-viewer'
- DBUS_ID: 'org.gnome.font-viewer'
+ APP_ID: 'org.gnome.font-viewerDevel'
script:
- flatpak-builder --stop-at=${FLATPAK_MODULE} app ${MANIFEST_PATH}
- flatpak build app meson --prefix=/app ${MESON_ARGS} _build
- flatpak build app ninja -C _build install
- flatpak-builder --finish-only --repo=repo app ${MANIFEST_PATH}
- - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
+ - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID}
artifacts:
paths:
diff --git a/data/icons/hicolor/scalable/apps/org.gnome.font-viewer.Devel.svg b/data/icons/hicolor/scalable/apps/org.gnome.font-viewerDevel.svg
index afac2c8..afac2c8 100644
--- a/data/icons/hicolor/scalable/apps/org.gnome.font-viewer.Devel.svg
+++ b/data/icons/hicolor/scalable/apps/org.gnome.font-viewerDevel.svg
diff --git a/data/icons/meson.build b/data/icons/meson.build
index 366c94c..aa41097 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,11 +1,12 @@
scalable_icondir = join_paths('hicolor', 'scalable', 'apps')
install_data (
- join_paths(scalable_icondir, 'org.gnome.font-viewer.svg'),
+ join_paths(scalable_icondir, '@0@.svg'.format(application_id)),
install_dir: join_paths(datadir, 'icons', scalable_icondir)
)
symbolic_icondir = join_paths('hicolor', 'symbolic', 'apps')
install_data (
join_paths(symbolic_icondir, 'org.gnome.font-viewer-symbolic.svg'),
- install_dir: join_paths(datadir, 'icons', symbolic_icondir)
+ install_dir: join_paths(datadir, 'icons', symbolic_icondir),
+ rename: ['@0@-symbolic.svg'.format(application_id)]
)
diff --git a/flatpak/org.gnome.font-viewerDevel.json b/flatpak/org.gnome.font-viewerDevel.json
new file mode 100644
index 0000000..60b44d7
--- /dev/null
+++ b/flatpak/org.gnome.font-viewerDevel.json
@@ -0,0 +1,52 @@
+{
+ "app-id": "org.gnome.font-viewerDevel",
+ "runtime": "org.gnome.Platform",
+ "sdk": "org.gnome.Sdk",
+ "command": "gnome-font-viewer",
+ "rename-appdata-file": "org.gnome.font-viewer.appdata.xml",
+ "rename-desktop-file": "org.gnome.font-viewer.desktop",
+ "tags": ["nightly"],
+ "desktop-file-name-prefix": "(Development) ",
+ "finish-args": [
+ "--device=dri",
+ "--share=ipc",
+ "--socket=wayland",
+ "--socket=fallback-x11",
+ "--talk-name=org.gtk.vfs", "--talk-name=org.gtk.vfs.*",
+ "--talk-name=ca.desrt.conf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf",
+ "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro"
+ ],
+ "cleanup": [
+ "/include",
+ "/lib/pkgconfig", "/share/pkgconfig",
+ "/share/aclocal",
+ "/man", "/share/man", "/share/gtk-doc",
+ "*.la", ".a",
+ "/lib/girepository-1.0",
+ "/share/gir-1.0",
+ "/share/doc"
+ ],
+ "modules": [
+ {
+ "name": "gnome-desktop",
+ "buildsystem": "meson",
+ "sources": [
+ {
+ "type": "git",
+ "url": "https://git.gnome.org/browse/gnome-desktop"
+ }
+ ]
+ },
+ {
+ "name": "gnome-font-viewer",
+ "buildsystem": "meson",
+ "config-opts": ["-Dprofile=development"],
+ "sources": [
+ {
+ "type": "dir",
+ "path": ".."
+ }
+ ]
+ }
+ ]
+}
diff --git a/meson.build b/meson.build
index 0d7f32c..3f3bcea 100644
--- a/meson.build
+++ b/meson.build
@@ -34,10 +34,19 @@ freetype2_dep = dependency('freetype2')
gnomedesktop_dep = dependency('gnome-desktop-3.0')
mathlib_dep = cc.find_library('m')
+if get_option('profile') == 'development'
+ profile = 'Devel'
+else
+ profile = ''
+endif
+
+application_id = 'org.gnome.font-viewer@0@'.format(profile)
+
config_h = configuration_data()
config_h.set_quoted('VERSION', meson.project_version())
config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_h.set_quoted('GNOMELOCALEDIR', localedir)
+config_h.set_quoted('APPLICATION_ID', application_id)
configure_file(output: 'config.h', configuration: config_h)
root_inc = include_directories('.')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..a6631f6
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('profile', type: 'combo', choices: ['default', 'development'], value: 'default', description: 'Build profiles')
diff --git a/src/font-view.c b/src/font-view.c
index a7568eb..2c7e02d 100644
--- a/src/font-view.c
+++ b/src/font-view.c
@@ -44,7 +44,7 @@
#include "sushi-font-widget.h"
#define FONT_VIEW_TYPE_APPLICATION (font_view_application_get_type ())
-#define FONT_VIEW_ICON_NAME "org.gnome.font-viewer"
+#define FONT_VIEW_ICON_NAME APPLICATION_ID
G_DECLARE_FINAL_TYPE (FontViewApplication, font_view_application,
FONT_VIEW, APPLICATION,
@@ -1546,7 +1546,7 @@ static GApplication *
font_view_application_new (void)
{
return g_object_new (FONT_VIEW_TYPE_APPLICATION,
- "application-id", "org.gnome.font-viewer",
+ "application-id", APPLICATION_ID,
"flags", G_APPLICATION_HANDLES_OPEN,
NULL);
}
diff --git a/src/meson.build b/src/meson.build
index 3084688..6abf610 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -37,8 +37,14 @@ executable('gnome-font-viewer', viewer_sources + resources,
install: true)
desktop_file = 'org.gnome.font-viewer.desktop'
+
+desktop_conf = configuration_data()
+desktop_conf.set('VERSION', meson.project_version())
+desktop_conf.set('APPLICATION_ID', application_id)
i18n.merge_file(desktop_file,
- input: desktop_file + '.in',
+ input: configure_file(input: desktop_file + '.in.in',
+ output: desktop_file + '.in',
+ configuration: desktop_conf),
output: desktop_file,
po_dir: '../po',
install: true,
@@ -46,11 +52,13 @@ i18n.merge_file(desktop_file,
type: 'desktop'
)
+service_file = 'org.gnome.font-viewer.service'
+
service_conf = configuration_data()
service_conf.set('bindir', bindir)
-service_file = 'org.gnome.font-viewer.service'
+service_conf.set('application_id', application_id)
configure_file(input: service_file + '.in',
- output: service_file,
+ output: '@0@.service'.format(application_id),
configuration: service_conf,
install: true,
install_dir: servicesdir)
diff --git a/src/org.gnome.font-viewer.desktop.in b/src/org.gnome.font-viewer.desktop.in.in
index 9aeeab8..a303640 100644
--- a/src/org.gnome.font-viewer.desktop.in
+++ b/src/org.gnome.font-viewer.desktop.in.in
@@ -4,7 +4,7 @@ Comment=View fonts on your system
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=fonts;fontface;
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
-Icon=org.gnome.font-viewer
+Icon=@APPLICATION_ID@
Exec=gnome-font-viewer %u
Terminal=false
Type=Application
diff --git a/src/org.gnome.font-viewer.service.in b/src/org.gnome.font-viewer.service.in
index d8c89a3..aa74cf9 100644
--- a/src/org.gnome.font-viewer.service.in
+++ b/src/org.gnome.font-viewer.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
-Name=org.gnome.font-viewer
+Name=@application_id@
Exec=@bindir@/gnome-font-viewer --gapplication-service