diff --git a/meson.build b/meson.build index 9f4c5f3..e51a7ed 100644 --- a/meson.build +++ b/meson.build @@ -42,6 +42,7 @@ i18n = import('i18n') add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c') windows_build = build_machine.system() == 'windows' +macos_build = build_machine.system() == 'darwin' #================================ @@ -61,6 +62,8 @@ endif # Windows needs icons, special arguments, and skip libportal if windows_build vala_flags += ['--define', 'WINDOWS'] +elif macos_build + vala_flags += ['--define', 'MACOS'] endif # Hot fixes for flathub builds @@ -111,7 +114,8 @@ dependencies = [ if windows_build dependencies += dependency('gio-windows-2.0') ico_src = import('windows').compile_resources('windows/icons/ico.rc') - +elif macos_build + dependencies += dependency('gio-unix-2.0') else dependencies += dependency('gio-unix-2.0') dependencies += dependency('libportal') @@ -128,5 +132,5 @@ subdir('src') gnome.post_install( glib_compile_schemas: true, gtk_update_icon_cache: true, - update_desktop_database: true + update_desktop_database: not macos_build ) diff --git a/src/Application.vala b/src/Application.vala index 118cf30..bf493e9 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -80,8 +80,10 @@ public class Jorts.Application : Gtk.Application { debug ("Jorts Startupโ€ฆ"); base.startup (); Gtk.init (); - Granite.init (); +#if !MACOS + Granite.init (); +#endif add_action_entries (ACTION_ENTRIES, this); set_accels_for_action ("app.action_quit", {"Q"}); set_accels_for_action ("app.action_new", {"N"}); @@ -105,11 +107,14 @@ public class Jorts.Application : Gtk.Application { // Force the eOS icon theme, and set the blueberry as fallback, if for some reason it fails for individual notes +#if !MACOS var granite_settings = Granite.Settings.get_default (); +#endif gtk_settings = Gtk.Settings.get_default (); gtk_settings.gtk_icon_theme_name = "elementary"; gtk_settings.gtk_theme_name = "io.elementary.stylesheet." + Jorts.Constants.DEFAULT_THEME.to_string ().ascii_down (); +#if !MACOS // Also follow dark if system is dark lIke mY sOul. gtk_settings.gtk_application_prefer_dark_theme = ( granite_settings.prefers_color_scheme == DARK @@ -120,7 +125,7 @@ public class Jorts.Application : Gtk.Application { granite_settings.prefers_color_scheme == DARK ); }); - +#endif print (""" ๐ŸŽ‰โœจ ACTIVATING: SUPER COOL JORTS ๐Ÿ˜Ž๐Ÿ”ฅโ—๐ŸŽถ๐ŸคŒ Your Notes are all belong to us! diff --git a/src/Views/PreferencesView.vala b/src/Views/PreferencesView.vala index 0d58e0a..5bf734b 100644 --- a/src/Views/PreferencesView.vala +++ b/src/Views/PreferencesView.vala @@ -101,7 +101,7 @@ /****************************************************/ /* Autostart Request */ /****************************************************/ -#if !WINDOWS +#if !WINDOWS && !MACOS var both_buttons = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 5) { halign = Gtk.Align.FILL }; diff --git a/src/meson.build b/src/meson.build index 79fd70c..8c5549b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -35,6 +35,8 @@ sources = files ( if windows_build sources += ico_src +elif macos_build + # noop else sources += files('Utils' / 'Libportal.vala') endif