summaryrefslogtreecommitdiff
path: root/meson.build
blob: d1f3a653207619205c41dd9acaddfe61dbdad777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

#### Project ####
project('places', 'c',
        version: '0.2.0',
        license: 'GPL v3',
        meson_version: '>= 0.47.0')

gettext_domain = 'e-module-' + meson.project_name()


#### Enlightenemnt ####
dep_e = dependency('enlightenment', version: '>= 0.23.99')
e_modules_dir = dep_e.get_pkgconfig_variable('modules')
e_release = dep_e.get_pkgconfig_variable('release')
e_module_arch = dep_e.get_pkgconfig_variable('module_arch')


#### Install dirs ####
mod_install_dir = join_paths(e_modules_dir, meson.project_name())
lib_install_dir = join_paths(mod_install_dir, e_module_arch)


#### config.h ####
config_h = configuration_data()
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
config_h.set_quoted('LOCALEDOMAIN', gettext_domain)
config_dir = include_directories('.')


#### Udisks2 support ####
if get_option('udisks2') == true
   dependency('udisks2', required: true, version: '>= 2.7.2')
   config_h.set('PLACES_HAVE_UDISKS2', 1)
endif


#### Udisks1 support ####
if get_option('udisks') == true
   dependency('udisks', required: true)
   config_h.set('PLACES_HAVE_UDISKS1', 1)
endif


#### fstab/mtab/mount support ####
if get_option('mount') == true
   # TODO here check if /etc/fstab and /proc/mounts exists
   config_h.set('PLACES_HAVE_MOUNT', 1)
endif


#### EXPERIMENTAL eeze support ####
if get_option('eeze') == true
   dependency('eeze', required: true)
   config_h.set('PLACES_HAVE_EEZE', 1)
endif


#### EXPERIMENTAL systemd support ####
if get_option('systemd') == true
   dependency('systemd', required: true,)
   config_h.set('PLACES_HAVE_SYSTEMD', 1)
endif


#### i18n ####
dep_intl = []
if get_option('nls')
   config_h.set('HAVE_GETTEXT', '1')
   cc = meson.get_compiler('c')
   dep_intl = cc.find_library('intl', required : false)
   subdir('po')
endif 


#### Edje cc ####
edje_cc = find_program('edje_cc')


#### module sources ####
subdir('src')


#### write config file ####
configure_file(output: 'places_config.h', configuration: config_h)


#### Data files ####
install_data('module.desktop', install_dir: mod_install_dir)

cmd = [ edje_cc,
        '-id', join_paths(meson.source_root(), 'images'),
        '@INPUT@', '@OUTPUT@']
custom_target('e-module-places.edj',
              input      : 'e-module-places.edc',
              output     : 'e-module-places.edj',
              command    : cmd,
              install_dir: mod_install_dir,
              install    : true
             )


#### Report ####
if meson.version().version_compare('>=0.53')
   summary({'install': lib_install_dir,
           }, section: 'Directories')
   summary({'udisks2': get_option('udisks2'),
            'udisks1': get_option('udisks'),
            'mount': get_option('mount'),
           }, section: 'Backends', bool_yn: true)
   summary({'eeze': get_option('eeze'),
            'systemd': get_option('systemd'),
         }, section: 'Experimental Backends', bool_yn: true)
endif