diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am deleted file mode 100644 index 171761523c5e6365a75867e0b315af77f62c5aa8..0000000000000000000000000000000000000000 --- a/data/icons/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -icondir = $(datadir)/icons - -# I'd like to use nobase_dist_icon_DATA, but -# automake doesn't recognizes two prefixes at once -nobase_icon_DATA = \ - hicolor/scalable/apps/$(PACKAGE_NAME).svg \ - hicolor/symbolic/apps/$(PACKAGE_NAME)-symbolic.svg - -EXTRA_DIST=$(nobase_icon_DATA) - -gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor - -install-data-hook: update-icon-cache -uninstall-hook: update-icon-cache -update-icon-cache: - @-if test -z "$(DESTDIR)"; then \ - echo "Updating Gtk icon cache."; \ - $(gtk_update_icon_cache); \ - else \ - echo "*** Icon cache not updated. After (un)install, run this:"; \ - echo "*** $(gtk_update_icon_cache)"; \ - fi - --include $(top_srcdir)/git.mk diff --git a/data/icons/meson.build b/data/icons/meson.build index d247f3e1f4f0d0ac83bcc51659966362dda45781..67dea9e2858e725c53be4af614486619b5c57781 100644 --- a/data/icons/meson.build +++ b/data/icons/meson.build @@ -1,4 +1,4 @@ -datadir = join_paths('share', 'icons') +datadir = join_paths(get_option('datadir'), 'icons') icondir = join_paths('hicolor', 'scalable', 'apps') if get_option('profile') == 'development' install_data ( diff --git a/data/meson.build b/data/meson.build index f9147aa2128b9b1533669a59fc8d2717c910ebd0..4a7f2c20d95bd2ed5e9f1a6ba8562ac37f8d4a04 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,10 +1,9 @@ gnome = import('gnome') +podir = join_paths(meson.source_root(), 'po') data_conf = configuration_data() -data_conf.set('application_id', application_id) -data_conf.set('PACKAGE_NAME', meson.project_name()) +data_conf.set('APP_ID', application_id) data_conf.set('DATA_DIR', DATA_DIR) -data_conf.set('pkgdatadir', pkgdatadir) message('Compiling resources') @@ -33,15 +32,24 @@ install_data( ) # Building desktop file +msgfmt = find_program('msgfmt') desktop_conf = configuration_data() -desktop = i18n.merge_file( - 'desktop', - input: application_id_stable + '.Application.desktop.in', - output: application_id + '.Application.desktop', - po_dir: join_paths(meson.source_root(), 'po'), - type: 'desktop', - install: true, - install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications') +desktop_conf.set('APP_ID', application_id) +desktop = custom_target( + 'desktop-file', + input: configure_file( + input: '@0@.Application.desktop.in.in'.format(application_id_stable), + output: '@0@.Application.desktop.in'.format(application_id_stable), + configuration: desktop_conf, + ), + output: '@0@.Application.desktop'.format(application_id), + install: true, + install_dir: join_paths(get_option('datadir'), 'applications'), + command: [msgfmt, '--desktop', + '--template', '@INPUT@', '-d', podir, '-o', '@OUTPUT@', + '--keyword=X-Geoclue-Reason', + '--keyword=Name', '--keyword=Comment', '--keyword=Keywords' + ] ) # Validating desktop file @@ -71,7 +79,7 @@ configure_file( output: application_id + '.Application.service', configuration: data_conf, install: true, - install_dir: join_paths(DATA_DIR, 'dbus-1', 'services') + install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services') ) configure_file( @@ -79,7 +87,7 @@ configure_file( output: application_id + '.BackgroundService.service', configuration: data_conf, install: true, - install_dir: join_paths(DATA_DIR, 'dbus-1', 'services') + install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services') ) # Search Provider diff --git a/data/org.gnome.Weather.Application.desktop.in b/data/org.gnome.Weather.Application.desktop.in.in similarity index 77% rename from data/org.gnome.Weather.Application.desktop.in rename to data/org.gnome.Weather.Application.desktop.in.in index ed3b9a2aba211acf72f9fc7036ad8c42edbe5be7..4adb6bc676de0edf235e79d32677a7830303f9df 100644 --- a/data/org.gnome.Weather.Application.desktop.in +++ b/data/org.gnome.Weather.Application.desktop.in.in @@ -2,8 +2,8 @@ Type=Application Name=Weather Comment=Show weather conditions and forecast -Icon=org.gnome.Weather -Exec=gapplication launch org.gnome.Weather.Application +Icon=@APP_ID@ +Exec=gapplication launch @APP_ID@.Application DBusActivatable=true StartupNotify=true Categories=GNOME;GTK;Utility;Core; diff --git a/data/org.gnome.Weather.Application.service.in b/data/org.gnome.Weather.Application.service.in index 966e758d5dd2b304401959fbafcd29dcece42689..b1d9729f9c0dce50ec971e689950271b92ec93cd 100644 --- a/data/org.gnome.Weather.Application.service.in +++ b/data/org.gnome.Weather.Application.service.in @@ -1,3 +1,3 @@ [D-BUS Service] -Name=@PACKAGE_NAME@.Application -Exec=@pkgdatadir@/@PACKAGE_NAME@.Application --gapplication-service +Name=@APP_ID@.Application +Exec=@DATA_DIR@/@APP_ID@.Application --gapplication-service diff --git a/data/org.gnome.Weather.BackgroundService.service.in b/data/org.gnome.Weather.BackgroundService.service.in index 484a6903a30c95e7dfe10ff32179f7c35faa98e3..72d6e7051f3602831079f3093b479872c58b2309 100644 --- a/data/org.gnome.Weather.BackgroundService.service.in +++ b/data/org.gnome.Weather.BackgroundService.service.in @@ -1,3 +1,3 @@ [D-BUS Service] -Name=@PACKAGE_NAME@.BackgroundService -Exec=@pkgdatadir@/@PACKAGE_NAME@.BackgroundService +Name=@APP_ID@.BackgroundService +Exec=@DATA_DIR@/@APP_ID@.BackgroundService diff --git a/meson.build b/meson.build index 0bfef04b2963e256c099848d82c29bcf248fdc39..cf5653dd933a2aaab235f2e069800062565254f5 100644 --- a/meson.build +++ b/meson.build @@ -24,7 +24,6 @@ LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir')) EXTENSION_DIR = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name()) DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), application_id) BIN_DIR = join_paths(get_option('prefix'), get_option('bindir')) -pkgdatadir = join_paths(DATA_DIR, meson.project_name()) # Profiles if get_option('profile') == 'development' diff --git a/src/meson.build b/src/meson.build index 3bce183319cebcff5965babfa76dd2227ed6d9ca..90cfd5ccbc469531710a3f8e95b7638e2f56909d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -5,7 +5,7 @@ source_conf.set('PACKAGE_VERSION', meson.project_version()) source_conf.set('libdir', EXTENSION_DIR) source_conf.set('prefix', prefix) -configure_file( +application = configure_file( input: application_id_stable + '.Application.in', output: application_id + '.Application', configuration: source_conf, @@ -21,7 +21,7 @@ configure_file( install_dir: DATA_DIR ) -gnome.compile_resources( +application_sources = gnome.compile_resources( application_id_stable + '.Application.src', application_id_stable + '.Application.src.gresource.xml', gresource_bundle: true, @@ -36,3 +36,8 @@ gnome.compile_resources( install: true, install_dir: DATA_DIR ) + +run_target('run', + command: application, + depends: application_sources +)