[gnome-multi-writer] build: Do not hardcode installation paths
- From: Jeremy Bicha <jbicha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-multi-writer] build: Do not hardcode installation paths
- Date: Tue, 27 Feb 2018 03:19:10 +0000 (UTC)
commit 4c957e42b62afe1f19ca615f2e12f135e8a2fb67
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Jan 23 14:04:38 2018 +0000
build: Do not hardcode installation paths
Always use the configuration options from Meson.
Closes #4
data/appdata/meson.build | 2 +-
data/icons/meson.build | 10 +++++-----
data/meson.build | 6 +++---
man/meson.build | 2 +-
meson.build | 18 ++++++++++--------
src/meson.build | 5 ++---
6 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/data/appdata/meson.build b/data/appdata/meson.build
index 43072c4..7498605 100644
--- a/data/appdata/meson.build
+++ b/data/appdata/meson.build
@@ -4,5 +4,5 @@ i18n.merge_file(
type: 'xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
- install_dir: join_paths(get_option('datadir'), 'metainfo')
+ install_dir: join_paths(prefixed_datadir, 'metainfo'),
)
diff --git a/data/icons/meson.build b/data/icons/meson.build
index bc5a49d..baa4a98 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,10 +1,10 @@
install_data('16x16/org.gnome.MultiWriter.png',
- install_dir : 'share/icons/hicolor/16x16/apps')
+ install_dir : join_paths(prefixed_datadir, 'icons/hicolor/16x16/apps'))
install_data('22x22/org.gnome.MultiWriter.png',
- install_dir : 'share/icons/hicolor/22x22/apps')
+ install_dir : join_paths(prefixed_datadir, 'icons/hicolor/22x22/apps'))
install_data('32x32/org.gnome.MultiWriter.png',
- install_dir : 'share/icons/hicolor/32x32/apps')
+ install_dir : join_paths(prefixed_datadir, 'icons/hicolor/32x32/apps'))
install_data('48x48/org.gnome.MultiWriter.png',
- install_dir : 'share/icons/hicolor/48x48/apps')
+ install_dir : join_paths(prefixed_datadir, 'icons/hicolor/48x48/apps'))
install_data('256x256/org.gnome.MultiWriter.png',
- install_dir : 'share/icons/hicolor/256x256/apps')
+ install_dir : join_paths(prefixed_datadir, 'icons/hicolor/256x256/apps'))
diff --git a/data/meson.build b/data/meson.build
index a022f95..d010358 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -3,7 +3,7 @@ subdir('icons')
compiled = gnome.compile_schemas()
install_data('org.gnome.MultiWriter.gschema.xml',
- install_dir : 'share/glib-2.0/schemas'
+ install_dir : 'share/glib-2.0/schemas',
)
i18n.merge_file(
@@ -12,7 +12,7 @@ i18n.merge_file(
type: 'desktop',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
- install_dir: join_paths(get_option('datadir'), 'applications')
+ install_dir: join_paths(prefixed_datadir, 'applications'),
)
i18n.merge_file(
@@ -21,5 +21,5 @@ i18n.merge_file(
type: 'xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
- install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions')
+ install_dir: join_paths(prefixed_datadir, 'polkit-1', 'actions'),
)
diff --git a/man/meson.build b/man/meson.build
index b1cf81b..f2d8903 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -5,6 +5,6 @@ if docbook2man.found()
input : 'gnome-multi-writer.sgml',
command : [docbook2man, '@INPUT@', '--output', 'man'],
install : true,
- install_dir : 'share/man/man1'
+ install_dir : join_paths(prefixed_mandir, 'man1'),
)
endif
diff --git a/meson.build b/meson.build
index 2a3da2f..2bcaa02 100644
--- a/meson.build
+++ b/meson.build
@@ -74,9 +74,14 @@ foreach arg: test_link_args
endforeach
add_global_link_arguments(
global_link_args,
- language: 'c'
+ language: 'c',
)
+prefixed_localedir = join_paths(get_option('prefix'), get_option('localedir'))
+prefixed_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
+prefixed_mandir = join_paths(get_option('prefix'), get_option('mandir'))
+prefixed_datadir = join_paths(get_option('prefix'), get_option('datadir'))
+
gtk = dependency('gtk+-3.0', version : '>= 3.11.2')
gio = dependency('gio-2.0')
gusb = dependency('gusb', version : '>= 0.2.7')
@@ -90,15 +95,12 @@ i18n = import('i18n')
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('VERSION', meson.project_version())
-conf.set_quoted('LOCALEDIR',
- join_paths(get_option('prefix'),
- get_option('localedir')))
-conf.set_quoted('LIBEXECDIR',
- join_paths(get_option('prefix'),
- get_option('libexecdir')))
+conf.set_quoted('LOCALEDIR', prefixed_localedir)
+conf.set_quoted('LIBEXECDIR', prefixed_libexecdir)
+
configure_file(
output : 'config.h',
- configuration : conf
+ configuration : conf,
)
subdir('src')
diff --git a/src/meson.build b/src/meson.build
index 6610c4c..cc97464 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -4,7 +4,7 @@ gnome_multi_writer_resources = gnome.compile_resources(
'gnome-multi-writer-resources',
'gnome-multi-writer.gresource.xml',
source_dir : '.',
- c_name : 'gmw'
+ c_name : 'gmw',
)
executable(
@@ -27,7 +27,6 @@ executable(
],
c_args : cargs,
install : true,
- install_dir : 'bin'
)
executable(
@@ -44,5 +43,5 @@ executable(
],
c_args : cargs,
install : true,
- install_dir : 'libexec'
+ install_dir : prefixed_libexecdir,
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]