summaryrefslogtreecommitdiff
path: root/meson.build
blob: 1e85b628b311126674517dfb204404d62cd4770f (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

#### Project ####
project('edgar', 'c',
        version: '0.4.0',
        license: 'GPL v3',
        meson_version: '>= 0.53.0')

# NOTE: meson 51 needed for the 'modules' param of pymod.find_installation()
# NOTE: meson 53 needed for the 'embed' param of py3.dependency()


#### EFL ####
dep_efl = dependency('efl', version: '>= 1.24')


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


#### Dlopen ####
cc = meson.get_compiler('c')
dep_dl = cc.find_library('dl', required: false)


#### Python3 ####
py3 = import('python').find_installation('python3', modules: ['efl', 'dbus'])
dep_py3 = py3.dependency(embed: true)

## bytecompile command to be used by gadgets
py3_bytecompile = [py3, meson.source_root() / 'meson_bytecompile.py',
                   '@INPUT@', '@OUTPUT@']

## find the installed libpython soname, will be dlopened at runtime
py_instsoname = py3.get_variable('INSTSONAME')


#### Install dirs ####
mod_install_dir = join_paths(e_modules_dir, meson.project_name())
lib_install_dir = join_paths(mod_install_dir, e_module_arch)
gadgets_install_dir = join_paths(e_lib_dir, 'enlightenment', 'edgar_gadgets')


#### Config.h ####
config_h = configuration_data()
config_h.set_quoted('PACKAGE', meson.project_name())
config_h.set_quoted('PYINSTSONAME', py_instsoname)
config_dir = include_directories('.')


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


#### Edgar sources ####
subdir('src')


#### Gadgets ####
subdir('gadgets/audio')
subdir('gadgets/calculator')
subdir('gadgets/cpu')
subdir('gadgets/dropbox')
subdir('gadgets/led_clock')
subdir('gadgets/mem')
subdir('gadgets/netspeed')


#### Write config.h ####
configure_file(output: 'edgar_config.h', configuration: config_h)


#### Data files ####
install_data('python/e.py', install_dir: gadgets_install_dir)
install_data('module.desktop', install_dir: mod_install_dir)

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