[gnome-break-timer/dylanmccall/meson-build: 6/25] Build and install required resources for settings application



commit 0a48db54949a80f1fe34b1437f21f90f98537305
Author: Dylan McCall <dylan dylanmccall com>
Date:   Mon Dec 31 22:44:46 2018 -0800

    Build and install required resources for settings application

 data/gnome-break-timer-autostart.desktop.in        |   4 +--
 data/gnome-break-timer-service.desktop.in          |   4 +--
 data/gnome-break-timer.appdata.xml.in              |  15 --------
 data/gnome-break-timer.desktop.in                  |  10 ------
 ...me-break-timer.png => org.gnome.BreakTimer.png} | Bin
 ...me-break-timer.png => org.gnome.BreakTimer.png} | Bin
 ...me-break-timer.png => org.gnome.BreakTimer.png} | Bin
 ...me-break-timer.png => org.gnome.BreakTimer.png} | Bin
 ...me-break-timer.png => org.gnome.BreakTimer.png} | Bin
 ...me-break-timer.svg => org.gnome.BreakTimer.svg} |   0
 data/icons/meson.build                             |   4 +++
 data/meson.build                                   |  40 +++++++++++++++++++--
 data/org.gnome.BreakTimer.appdata.xml.in           |  15 ++++++++
 data/org.gnome.BreakTimer.desktop.in               |  10 ++++++
 ...urce.xml => org.gnome.BreakTimer.gresource.xml} |   0
 data/org.gnome.BreakTimer.service.in               |   3 ++
 data/org.gnome.break-timer.gschema.xml.in          |  14 ++++----
 flatpak/org.gnome.BreakTimer.json                  |   2 +-
 meson.build                                        |   5 +++
 settings/meson.build                               |   6 ++--
 20 files changed, 90 insertions(+), 42 deletions(-)
---
diff --git a/data/gnome-break-timer-autostart.desktop.in b/data/gnome-break-timer-autostart.desktop.in
index eb134b4..460854b 100644
--- a/data/gnome-break-timer-autostart.desktop.in
+++ b/data/gnome-break-timer-autostart.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Type=Application
-_Name=Break Timer
-_Comment=Provides a gentle reminder to take regular breaks
+Name=Break Timer
+Comment=Provides a gentle reminder to take regular breaks
 X-Ubuntu-Gettext-Domain=gnome-break-timer
 Icon=gnome-break-timer
 NoDisplay=true
diff --git a/data/gnome-break-timer-service.desktop.in b/data/gnome-break-timer-service.desktop.in
index 7eec49e..81a97bc 100644
--- a/data/gnome-break-timer-service.desktop.in
+++ b/data/gnome-break-timer-service.desktop.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Type=Application
-_Name=Break Timer
-_Comment=Provides a gentle reminder to take regular breaks
+Name=Break Timer
+Comment=Provides a gentle reminder to take regular breaks
 X-Ubuntu-Gettext-Domain=gnome-break-timer
 Icon=gnome-break-timer
 NoDisplay=true
diff --git a/data/icons/hicolor/16x16/apps/gnome-break-timer.png 
b/data/icons/hicolor/16x16/apps/org.gnome.BreakTimer.png
similarity index 100%
rename from data/icons/hicolor/16x16/apps/gnome-break-timer.png
rename to data/icons/hicolor/16x16/apps/org.gnome.BreakTimer.png
diff --git a/data/icons/hicolor/22x22/apps/gnome-break-timer.png 
b/data/icons/hicolor/22x22/apps/org.gnome.BreakTimer.png
similarity index 100%
rename from data/icons/hicolor/22x22/apps/gnome-break-timer.png
rename to data/icons/hicolor/22x22/apps/org.gnome.BreakTimer.png
diff --git a/data/icons/hicolor/256x256/apps/gnome-break-timer.png 
b/data/icons/hicolor/256x256/apps/org.gnome.BreakTimer.png
similarity index 100%
rename from data/icons/hicolor/256x256/apps/gnome-break-timer.png
rename to data/icons/hicolor/256x256/apps/org.gnome.BreakTimer.png
diff --git a/data/icons/hicolor/32x32/apps/gnome-break-timer.png 
b/data/icons/hicolor/32x32/apps/org.gnome.BreakTimer.png
similarity index 100%
rename from data/icons/hicolor/32x32/apps/gnome-break-timer.png
rename to data/icons/hicolor/32x32/apps/org.gnome.BreakTimer.png
diff --git a/data/icons/hicolor/48x48/apps/gnome-break-timer.png 
b/data/icons/hicolor/48x48/apps/org.gnome.BreakTimer.png
similarity index 100%
rename from data/icons/hicolor/48x48/apps/gnome-break-timer.png
rename to data/icons/hicolor/48x48/apps/org.gnome.BreakTimer.png
diff --git a/data/icons/hicolor/gnome-break-timer.svg b/data/icons/hicolor/org.gnome.BreakTimer.svg
similarity index 100%
rename from data/icons/hicolor/gnome-break-timer.svg
rename to data/icons/hicolor/org.gnome.BreakTimer.svg
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..1d2af68
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,4 @@
+install_subdir(
+    'hicolor',
+    install_dir: join_paths(datadir, 'icons')
+)
diff --git a/data/meson.build b/data/meson.build
index 62d969b..be0cd64 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -1,11 +1,45 @@
-schema_dir = join_paths(get_option('datadir'), 'glib-2.0', 'schemas')
+subdir('icons')
 
-schema_file = i18n.merge_file(
+i18n.merge_file(
+    input: 'org.gnome.BreakTimer.desktop.in',
+    output: 'org.gnome.BreakTimer.desktop',
+    type: 'desktop',
+    po_dir: po_dir,
+    install: true,
+    install_dir: join_paths(datadir, 'applications')
+)
+
+i18n.merge_file(
+    input: 'org.gnome.BreakTimer.appdata.xml.in',
+    output: 'org.gnome.BreakTimer.appdata.xml',
+    po_dir: po_dir,
+    install: true,
+    install_dir: join_paths(datadir, 'metainfo')
+)
+
+i18n.merge_file(
     input: 'org.gnome.break-timer.gschema.xml.in',
     output: 'org.gnome.break-timer.gschema.xml',
     po_dir: po_dir,
     install: true,
-    install_dir: schema_dir
+    install_dir: join_paths(datadir, 'glib-2.0', 'schemas')
 )
 
 gnome.compile_schemas()
+
+service_conf = configuration_data()
+service_conf.set('bindir', bindir)
+
+configure_file(
+    input: 'org.gnome.BreakTimer.service.in',
+    output: 'org.gnome.BreakTimer.service',
+    configuration: service_conf,
+    install_dir: join_paths(datadir, 'dbus-1', 'services')
+)
+
+break_timer_resources = gnome.compile_resources(
+    'resources',
+    'org.gnome.BreakTimer.gresource.xml',
+    source_dir : '.',
+    c_name : 'gnome_break_timer_resources'
+)
diff --git a/data/org.gnome.BreakTimer.appdata.xml.in b/data/org.gnome.BreakTimer.appdata.xml.in
new file mode 100644
index 0000000..899c4e1
--- /dev/null
+++ b/data/org.gnome.BreakTimer.appdata.xml.in
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<component type="desktop">
+  <id>org.gnome.BreakTimer.desktop</id>
+  <project_license>GPLv3</project_license>
+  <name>Break Timer</name>
+  <summary>Remember to take regular breaks from using the computer</summary>
+  <description>
+    <p>Break Timer keeps track of how much you are using the computer, and it reminds you to take regular 
breaks. It is designed to encourage healthy behaviour, with a mix of short breaks for your eyes and wrists, 
as well as longer breaks to keep your body moving and your mind on task.</p>
+    <p>Break Timer is simple to set up, so you can pick a break schedule that works for you and it will 
carry on working in the background.</p>
+  </description>
+  <screenshots>
+  </screenshots>
+  <url type="homepage">https://wiki.gnome.org/GnomeBreakTimer</url>
+  <updatecontact>dylan dylanmccall com</updatecontact>
+</component>
diff --git a/data/org.gnome.BreakTimer.desktop.in b/data/org.gnome.BreakTimer.desktop.in
new file mode 100644
index 0000000..cb8bec5
--- /dev/null
+++ b/data/org.gnome.BreakTimer.desktop.in
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Name=Break Timer
+Comment=Choose your preferences for micro breaks and rest breaks
+Keywords=break;micro;rest;timer;
+X-Ubuntu-Gettext-Domain=gnome-break-timer
+Categories=GNOME;GTK;Utility;Settings;
+Icon=org.gnome.BreakTimer
+Exec=gapplication launch org.gnome.BreakTimer
+StartupNotify=true
diff --git a/data/gnome-break-timer.gresource.xml b/data/org.gnome.BreakTimer.gresource.xml
similarity index 100%
rename from data/gnome-break-timer.gresource.xml
rename to data/org.gnome.BreakTimer.gresource.xml
diff --git a/data/org.gnome.BreakTimer.service.in b/data/org.gnome.BreakTimer.service.in
new file mode 100644
index 0000000..e295890
--- /dev/null
+++ b/data/org.gnome.BreakTimer.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.BreakTimer
+Exec=@bindir@/gnome-break-timer-settings --gapplication-service
diff --git a/data/org.gnome.break-timer.gschema.xml.in b/data/org.gnome.break-timer.gschema.xml.in
index 53c70a0..1feef09 100644
--- a/data/org.gnome.break-timer.gschema.xml.in
+++ b/data/org.gnome.break-timer.gschema.xml.in
@@ -9,44 +9,44 @@
       <summary>The list of breaks that are currently enabled</summary>
       <default>['microbreak', 'restbreak']</default>
     </key>
-    
+
     <key name="quiet-mode" type="b">
       <summary>True to enable quiet mode</summary>
       <description>Hides breaks until quiet-mode-expire-time.</description>
       <default>false</default>
     </key>
-    
+
     <key name="quiet-mode-expire-time" type="x">
       <summary>Time to end quiet mode.</summary>
       <description>The time to automatically disable quiet mode, in unix time.</description>
       <default>0</default>
     </key>
-    
+
     <child schema="org.gnome.break-timer.restbreak" name="restbreak"/>
     <child schema="org.gnome.break-timer.microbreak" name="microbreak"/>
   </schema>
-  
+
   <schema id="org.gnome.break-timer.restbreak" path="/org/gnome/break-timer/restbreak/" 
gettext-domain="gnome-break-timer">
     <key name="interval-seconds" type="i">
       <summary>Time between breaks</summary>
       <description>The time between rest breaks, in seconds.</description>
       <default>2400</default>
     </key>
-    
+
     <key name="duration-seconds" type="i">
       <summary>Duration of each break</summary>
       <description>The duration of each rest break, in seconds.</description>
       <default>360</default>
     </key>
   </schema>
-  
+
   <schema id="org.gnome.break-timer.microbreak" path="/org/gnome/break-timer/microbreak/" 
gettext-domain="gnome-break-timer">
     <key name="interval-seconds" type="i">
       <summary>Time between breaks</summary>
       <description>The preferred time between micro breaks, in seconds.</description>
       <default>360</default>
     </key>
-    
+
     <key name="duration-seconds" type="i">
       <default>30</default>
       <summary>Duration of each break</summary>
diff --git a/flatpak/org.gnome.BreakTimer.json b/flatpak/org.gnome.BreakTimer.json
index da9d1f5..8d201d6 100644
--- a/flatpak/org.gnome.BreakTimer.json
+++ b/flatpak/org.gnome.BreakTimer.json
@@ -1,7 +1,7 @@
 {
     "id" : "org.gnome.BreakTimer",
     "runtime" : "org.gnome.Platform",
-    "runtime-version" : "3.28",
+    "runtime-version" : "master",
     "sdk" : "org.gnome.Sdk",
     "command" : "gnome-break-timer-settings",
     "finish-args": [
diff --git a/meson.build b/meson.build
index 50e5a2d..1fc2cf9 100644
--- a/meson.build
+++ b/meson.build
@@ -23,6 +23,11 @@ libnotify_dep = dependency('libnotify')
 gettext_package = meson.project_name()
 po_dir = join_paths(meson.source_root(), 'po')
 
+prefix = get_option('prefix')
+bindir = join_paths(prefix, get_option('bindir'))
+libdir = join_paths(prefix, get_option('libdir'))
+datadir = join_paths(prefix, get_option('datadir'))
+
 conf = configuration_data()
 conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
 conf.set_quoted('PACKAGE_NAME', meson.project_name())
diff --git a/settings/meson.build b/settings/meson.build
index 38f8eb8..e3c4d39 100644
--- a/settings/meson.build
+++ b/settings/meson.build
@@ -39,12 +39,14 @@ settings_lib_dep = declare_dependency(
 )
 
 settings_main_sources = [
-    'main.vala'
+    'main.vala',
+    break_timer_resources
 ]
 
 executable(
     'gnome-break-timer-settings',
     sources : settings_main_sources,
     dependencies : settings_lib_dep,
-    install: true
+    install: true,
+    install_dir: bindir
 )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]