[gnome-break-timer/dylanmccall/meson-build: 13/25] Fix build and run errors for the helper module



commit e2edfd2af080718876a47e34d89ff9bbbfbe0712
Author: Dylan McCall <dylan dylanmccall com>
Date:   Mon Jan 7 22:15:08 2019 -0800

    Fix build and run errors for the helper module
    
    This involved aggressively trimming dependencies and replacing them with
    some temporary stub code. In particular, X11ActivityMonitorBackend
    has been replaced with a nonfunctional MutterActivityMonitorBackend.
    
    In the future, this backend will understand how to use the session idle
    time from the org.gnome.Mutter.IdleMonitor dbus interface.
    
    With the current set of changes, the program is able to run, albeit
    very incorrectly.

 common/meson.build                                 |   1 +
 gnome-break-timer.in                               |   2 +-
 helper/HelperApplication.vala                      |   2 +-
 .../X11ActivityMonitorBackend.vala                 |  58 ------
 .../c_x11_activity_monitor_backend-xcb.c           |  68 -------
 .../c_x11_activity_monitor_backend.c               | 217 ---------------------
 helper/meson.build                                 |  40 ++--
 meson.build                                        |   9 +-
 settings/meson.build                               |   3 +-
 9 files changed, 29 insertions(+), 371 deletions(-)
---
diff --git a/common/meson.build b/common/meson.build
index 0b8a3e3..93018e3 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -17,5 +17,6 @@ common_lib = static_library(
 
 common_lib_dep = declare_dependency(
     link_with: common_lib,
+    dependencies: common_dependencies,
     include_directories: include_directories('.')
 )
diff --git a/gnome-break-timer.in b/gnome-break-timer.in
index 96edb70..6605382 100755
--- a/gnome-break-timer.in
+++ b/gnome-break-timer.in
@@ -8,7 +8,7 @@ else
 fi
 
 if [ "${SUBCOMMAND}" = 'helper' ]; then
-    exec @BINDIR@/gnome-break-timer-helper $@
+    exec @BINDIR@/gnome-break-timer-service $@
 elif [ "${SUBCOMMAND}" = 'settings' ]; then
     exec @BINDIR@/gnome-break-timer-settings $@
 else
diff --git a/helper/HelperApplication.vala b/helper/HelperApplication.vala
index 983bef0..0c32553 100644
--- a/helper/HelperApplication.vala
+++ b/helper/HelperApplication.vala
@@ -100,7 +100,7 @@ public class HelperApplication : Gtk.Application {
                this.session_status = new SessionStatus (this);
 
                try {
-                       this.activity_monitor_backend = new GnomeShellActivityMonitorBackend ();
+                       this.activity_monitor_backend = new MutterActivityMonitorBackend ();
                } catch {
                        GLib.error ("Failed to initialize activity monitor backend");
                }
diff --git a/helper/meson.build b/helper/meson.build
index 9776a50..6ef6f09 100644
--- a/helper/meson.build
+++ b/helper/meson.build
@@ -1,5 +1,11 @@
 helper_sources = [
-    build_config,
+    'activity-monitor/ActivityMonitor.vala',
+    'activity-monitor/MutterActivityMonitorBackend.vala',
+    'util/Countdown.vala',
+    'util/PausableTimeout.vala',
+    'util/SimpleFocusManager.vala',
+    'util/StatefulTimer.vala',
+    'util/Util.vala',
     'break/BreakController.vala',
     'break/BreakType.vala',
     'break/BreakView.vala',
@@ -17,23 +23,20 @@ helper_sources = [
     'HelperApplication.vala',
     'ScreenOverlay.vala',
     'SessionStatus.vala',
-    'UIManager.vala',
-    'main.vala'
+    'UIManager.vala'
 ]
 
 # TODO: Build and link activity_monitor and util subdirs
 
 helper_dependencies = [
+    common_lib_dep,
     gtk_dep,
     gio_dep,
     gio_unix_dep,
     gee_dep,
     json_glib_dep,
-    libcanberra_dep,
-    libcanberra_gtk_dep,
     libnotify_dep,
-    # posix_dep,
-    common_dep
+    m_dep
 ]
 
 helper_lib = static_library(
@@ -42,22 +45,21 @@ helper_lib = static_library(
     dependencies: helper_dependencies
 )
 
-helper_dep = declare_dependency(
-    link_with: helper_lib
+helper_lib_dep = declare_dependency(
+    link_with: helper_lib,
+    dependencies: helper_dependencies,
+    include_directories: include_directories('.')
 )
 
-main_sources = [
-    'helper/main.vala'
-]
-
-main_dependencies = [
-    glib_dep,
-    gobject_dep
+helper_main_sources = [
+    'main.vala',
+    break_timer_resources
 ]
 
 executable(
     'gnome-break-timer-service',
-    sources : main_sources,
-    dependencies : main_dependencies
+    sources : helper_main_sources,
+    dependencies : helper_lib_dep,
+    install: true,
+    install_dir: bindir
 )
-
diff --git a/meson.build b/meson.build
index 6b5e787..fb9659f 100644
--- a/meson.build
+++ b/meson.build
@@ -4,6 +4,7 @@ gnome = import('gnome')
 i18n = import('i18n')
 
 valac = meson.get_compiler('vala')
+cc = meson.get_compiler('c')
 
 env = environment()
 
@@ -15,10 +16,8 @@ glib_dep = dependency('glib-2.0')
 gobject_dep = dependency('gobject-2.0')
 gtk_dep = dependency('gtk+-3.0')
 json_glib_dep = dependency('json-glib-1.0')
-libcanberra_dep = dependency('libcanberra')
-libcanberra_gtk_dep = dependency('libcanberra-gtk')
 libnotify_dep = dependency('libnotify')
-# posix_dep = dependency('posix')
+m_dep = cc.find_library('m', required : false)
 
 gettext_package = meson.project_name()
 po_dir = join_paths(meson.source_root(), 'po')
@@ -91,6 +90,6 @@ subdir('po')
 subdir('common')
 subdir('data')
 subdir('settings')
-# subdir('helper')
+subdir('helper')
 
-meson.add_install_script('build-aux/meson/postinstall.py')
+meson.add_install_script('build-aux/meson/postinstall.py')
\ No newline at end of file
diff --git a/settings/meson.build b/settings/meson.build
index e3c4d39..1251ea4 100644
--- a/settings/meson.build
+++ b/settings/meson.build
@@ -17,7 +17,6 @@ settings_sources = [
 ]
 
 settings_dependencies = [
-    config_lib_dep,
     common_lib_dep,
     cairo_dep,
     gtk_dep,
@@ -49,4 +48,4 @@ executable(
     dependencies : settings_lib_dep,
     install: true,
     install_dir: bindir
-)
+)
\ No newline at end of file


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