summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Bouchaud (yoz) <yoz@efl.so>2019-01-14 10:51:10 +0100
committerMichael Bouchaud (yoz) <yoz@efl.so>2019-01-14 10:51:10 +0100
commit42a99c92b7528498cfe1445ea0c6a244eda73bf9 (patch)
tree4723ad269bc8175c24ea3f156d9066e07a47ceff
parent2b06adc7712f083b89630f3b9c755905485ca5cb (diff)
Allow to install into home directory when using enlightenment module
-rw-r--r--meson.build23
-rw-r--r--meson_options.txt2
2 files changed, 19 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index b6dd04d..21fb65e 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('e-module-weather', 'c',
2 version: '0.1', 2 version: '0.1',
3 license: 'BSD 2 clause', 3 license: 'BSD 2 clause',
4 default_options: [ 'c_std=gnu99', 'warning_level=2' ], 4 default_options: [ 'c_std=gnu99', 'warning_level=2' ],
5 meson_version: '>= 0.40.0') 5 meson_version: '>= 0.46.0')
6 6
7pkgconfig = import('pkgconfig') 7pkgconfig = import('pkgconfig')
8cc = meson.get_compiler('c') 8cc = meson.get_compiler('c')
@@ -30,14 +30,30 @@ if host_os == 'linux'
30endif 30endif
31module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release) 31module_arch = '@0@-@1@-@2@'.format(host_os, host_machine.cpu_family(), release)
32 32
33
34desktop_data = configuration_data()
35desktop_data.set('GADGET_VERSION', meson.project_version())
33dir_prefix = dep_e.get_pkgconfig_variable('prefix') 36dir_prefix = dep_e.get_pkgconfig_variable('prefix')
34if get_option('sandbox') 37if get_option('sandbox')
35 dir_lib = join_paths(dir_prefix, get_option('libdir')) 38 dir_lib = join_paths(dir_prefix, get_option('libdir'))
36 dir_gadgets = join_paths([dir_lib, 'enlightenment/gadgets', module_arch, 'weather']) 39 dir_gadgets = join_paths([dir_lib, 'enlightenment/gadgets', module_arch, 'weather'])
37 dir_gadgets_e = join_paths([dir_lib, 'enlightenment/gadgets', module_arch]) 40 dir_gadgets_e = join_paths([dir_lib, 'enlightenment/gadgets', module_arch])
38 config_h.set_quoted('PACKAGE_PREFIX', dir_prefix) 41 config_h.set_quoted('PACKAGE_PREFIX', dir_prefix)
42 desktop_data.set('E_GADGET_DIR', dir_gadgets_e)
39else 43else
40 dir_gadgets = join_paths([dir_lib, 'enlightenment/modules/weather']) 44 if get_option('home-install')
45 pymodule = import('python')
46 python = pymodule.find_installation()
47 res = run_command(python, '-c', 'import os; print(os.environ["HOME"],end="")')
48 if res.returncode() == 0
49 dir_home = res.stdout()
50 dir_gadgets = join_paths([dir_home, '.e/e/modules/weather'])
51 else
52 # not found, do fallback
53 endif
54 else
55 dir_gadgets = join_paths([dep_e.get_pkgconfig_variable('modules'), 'weather'])
56 endif
41endif 57endif
42 58
43if get_option('sandbox') 59if get_option('sandbox')
@@ -49,9 +65,6 @@ if get_option('sandbox')
49endif 65endif
50 66
51 67
52desktop_data = configuration_data()
53desktop_data.set('E_GADGET_DIR', dir_gadgets_e)
54desktop_data.set('GADGET_VERSION', meson.project_version())
55 68
56if get_option('sandbox') 69if get_option('sandbox')
57 configure_file(input: 'weather.desktop.in', 70 configure_file(input: 'weather.desktop.in',
diff --git a/meson_options.txt b/meson_options.txt
index 896f92a..6664e1e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -21,5 +21,5 @@ option('home-install',
21option('test', 21option('test',
22 type: 'boolean', 22 type: 'boolean',
23 value: false, 23 value: false,
24 description: 'Install into home directory') 24 description: 'Enable test mode (Warning don\'t use it as a gadget)')
25 25