Commit 09eb0546 authored by Christopher Davis's avatar Christopher Davis 🌱

meson: Fix things missed in review

* Define DATA_DIR correctly
* pkgdatadir is no longer used
* remove icons/Makefile.am
* Properly format extra tags for .desktop file
* Install data to correct directory & icons
* Use APP_ID instead of PACKAGE_NAME for services
parent 10ddc677
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
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 (
......
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
......
......@@ -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;
......
[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
[D-BUS Service]
Name=@PACKAGE_NAME@.BackgroundService
Exec=@pkgdatadir@/@PACKAGE_NAME@.BackgroundService
Name=@APP_ID@.BackgroundService
Exec=@DATA_DIR@/@APP_ID@.BackgroundService
......@@ -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'
......
......@@ -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
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment