meson - make modules with helper binaries simpelr to build
this makes modules with a binary helper simpler to build using the parent module build harness as much as possible. i probably could simplify this down to a single binary only and it is either setuid or not... define the deps and flags ... it could be a bit simpler. not much. i also removed the if's in the build for battery and ifdefs in src handle it instead (imho simpler to maintain in src). sysinfo still uses the if's there.
This commit is contained in:
parent
fe7c39fa18
commit
16a702ac73
|
@ -818,7 +818,7 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
|||
|
||||
#ifdef HAVE_EEZE
|
||||
_battery_udev_stop();
|
||||
#elif defined __OpenBSD__ || defined __DragonFly__ || defined __FreeBSD__ || defined __NetBSD__
|
||||
#elif defined (__OpenBSD__) || defined (__DragonFly__) || defined (__FreeBSD__) || defined (__NetBSD__)
|
||||
_battery_sysctl_stop();
|
||||
#else
|
||||
_battery_upower_stop();
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
# include <err.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/sysctl.h>
|
||||
|
||||
#if defined(__OpenBSD__) || defined(__NetBSD__)
|
||||
# include <sys/param.h>
|
||||
# include <sys/sensors.h>
|
||||
#endif
|
||||
|
||||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static Eina_Bool _battery_sysctl_battery_update_poll(void *data EINA_UNUSED);
|
||||
static int _battery_sysctl_battery_update();
|
||||
|
@ -338,6 +335,7 @@ _battery_sysctl_battery_update()
|
|||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#ifdef HAVE_EEZE
|
||||
|
||||
static void _battery_udev_event_battery(const char *syspath, Eeze_Udev_Event event, void *data, Eeze_Udev_Watch *watch);
|
||||
static void _battery_udev_event_ac(const char *syspath, Eeze_Udev_Event event, void *data, Eeze_Udev_Watch *watch);
|
||||
static void _battery_udev_battery_add(const char *syspath);
|
||||
|
@ -310,4 +312,4 @@ _battery_udev_ac_update(const char *syspath, Ac_Adapter *ac)
|
|||
|
||||
_battery_device_update();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
#if !(defined(HAVE_EEZE) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__))
|
||||
|
||||
# define BUS "org.freedesktop.UPower"
|
||||
# define PATH "/org/freedesktop/UPower"
|
||||
# define IFACE "org.freedesktop.UPower"
|
||||
|
@ -348,3 +350,4 @@ _battery_upower_stop(void)
|
|||
eldbus_object_unref(obj);
|
||||
eldbus_connection_unref(conn);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,45 +1,18 @@
|
|||
battery_dist = [
|
||||
'e-module-battery.edj',
|
||||
'module.desktop',
|
||||
]
|
||||
|
||||
battery_src = [
|
||||
'e_mod_config.c',
|
||||
src = files(
|
||||
'e_mod_main.c',
|
||||
'e_mod_main.h',
|
||||
]
|
||||
|
||||
if config_h.has('HAVE_EEZE') == true
|
||||
battery_src += 'e_mod_udev.c'
|
||||
elif host_machine.system().contains('bsd') == true
|
||||
battery_src += 'e_mod_sysctl.c'
|
||||
else
|
||||
battery_src += 'e_mod_upower.c'
|
||||
endif
|
||||
|
||||
battery_dir = join_paths(dir_module_e, 'battery', module_arch)
|
||||
if get_option('battery') == true
|
||||
config_h.set('USE_MODULE_BATTERY', '1')
|
||||
|
||||
install_data(battery_dist,
|
||||
install_dir: join_paths(dir_module_e, 'battery')
|
||||
)
|
||||
|
||||
module_files += join_paths(battery_dir, 'battery.so')
|
||||
shared_module('battery',
|
||||
battery_src,
|
||||
include_directories: include_directories(module_includes),
|
||||
name_prefix: '',
|
||||
dependencies: module_deps,
|
||||
install_dir: battery_dir,
|
||||
install: true
|
||||
'e_mod_config.c',
|
||||
'e_mod_sysctl.c',
|
||||
'e_mod_udev.c',
|
||||
'e_mod_upower.c',
|
||||
'e_mod_main.h'
|
||||
)
|
||||
|
||||
if get_option(m) == true
|
||||
executable('batget',
|
||||
'batget.c',
|
||||
include_directories: include_directories(module_includes),
|
||||
dependencies : [ dep_eina, dep_ecore, dep_ecore_con, dep_ecore_file ],
|
||||
install_dir: battery_dir,
|
||||
install_dir : _dir_bin,
|
||||
install : true
|
||||
)
|
||||
endif
|
||||
|
|
|
@ -1,40 +1,17 @@
|
|||
cpufreq_dist = [
|
||||
'e-module-cpufreq.edj',
|
||||
'module.desktop',
|
||||
]
|
||||
|
||||
cpufreq_src = [
|
||||
'e_mod_config.c',
|
||||
src = files(
|
||||
'e_mod_main.c',
|
||||
'freqset.c',
|
||||
'e_mod_main.h',
|
||||
]
|
||||
|
||||
cpufreq_dir = join_paths(dir_module_e, 'cpufreq', module_arch)
|
||||
if get_option('cpufreq') == true
|
||||
config_h.set('USE_MODULE_CPUFREQ', '1')
|
||||
|
||||
install_data(cpufreq_dist,
|
||||
install_dir: join_paths(dir_module_e, 'cpufreq')
|
||||
)
|
||||
|
||||
module_files += join_paths(cpufreq_dir, 'cpufreq.so')
|
||||
shared_module('cpufreq',
|
||||
cpufreq_src,
|
||||
include_directories: include_directories(module_includes),
|
||||
name_prefix: '',
|
||||
dependencies: module_deps,
|
||||
install_dir: cpufreq_dir,
|
||||
install: true
|
||||
'e_mod_config.c',
|
||||
'e_mod_main.h'
|
||||
)
|
||||
|
||||
if get_option(m) == true
|
||||
executable('freqset',
|
||||
'freqset.c',
|
||||
c_args : suid_cflags,
|
||||
link_args : suid_ldflags,
|
||||
install_dir: cpufreq_dir,
|
||||
install_dir: _dir_bin,
|
||||
install : true
|
||||
)
|
||||
suid_exes += join_paths(cpufreq_dir, 'freqset')
|
||||
suid_exes += join_paths(_dir_bin, 'freqset')
|
||||
endif
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ module_includes = [ '../../..', '../../bin', '../../bin/efx' ]
|
|||
module_includes2 = [ '../..' , '../bin' , '../bin/efx' ]
|
||||
module_deps = [ deps_e, dep_dl ]
|
||||
|
||||
subdir('battery')
|
||||
subdir('cpufreq')
|
||||
subdir('wizard')
|
||||
subdir('mixer')
|
||||
subdir('everything')
|
||||
|
@ -13,14 +11,16 @@ subdir('teamwork')
|
|||
subdir('wl_desktop_shell')
|
||||
subdir('wl_text_input')
|
||||
subdir('wl_weekeyboard')
|
||||
subdir('sysinfo')
|
||||
|
||||
# disabled for now
|
||||
####subdir('wl_fb')
|
||||
|
||||
mods = [
|
||||
# standard run of the mill modules with cion and desktop
|
||||
'battery',
|
||||
'cpufreq',
|
||||
'clock',
|
||||
'sysinfo',
|
||||
'ibar',
|
||||
'pager',
|
||||
'pager_plain',
|
||||
|
@ -80,7 +80,9 @@ foreach m: mods
|
|||
no_icon = false
|
||||
disable = false
|
||||
cargs = ''
|
||||
|
||||
_dir = join_paths(dir_module_e, m)
|
||||
_dir_bin = join_paths(_dir, module_arch)
|
||||
_inc = include_directories(module_includes2, join_paths('.', m))
|
||||
subdir(m)
|
||||
|
||||
opt = '-'.join(m.split('_'))
|
||||
|
@ -88,9 +90,6 @@ foreach m: mods
|
|||
if get_option(opt) == true and disable == false
|
||||
|
||||
_conf = 'USE_MODULE_' + m.underscorify().to_upper()
|
||||
_dir = join_paths(dir_module_e, m)
|
||||
_dir_bin = join_paths(_dir, module_arch)
|
||||
_inc = include_directories(module_includes2, join_paths('.', m))
|
||||
module_files += join_paths(_dir_bin, m + '.so')
|
||||
|
||||
if desktop_only == true
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
module = 'sysinfo'
|
||||
opt = 'sysinfo'
|
||||
conf = 'USE_MODULE_SYSINFO'
|
||||
|
||||
src = [
|
||||
src = files(
|
||||
'mod.c',
|
||||
'sysinfo.c',
|
||||
'sysinfo.h',
|
||||
|
@ -29,55 +25,34 @@ src = [
|
|||
'netstatus/netstatus.c',
|
||||
'netstatus/netstatus_config.c',
|
||||
'netstatus/netstatus_proc.c'
|
||||
]
|
||||
|
||||
)
|
||||
if config_h.has('HAVE_EEZE') == true
|
||||
src += [
|
||||
src += files(
|
||||
'batman/batman_udev.c',
|
||||
'thermal/thermal_udev.c'
|
||||
]
|
||||
'thermal/thermal_udev.c')
|
||||
elif host_machine.system().contains('bsd') == true
|
||||
src += ['batman/batman_sysctl.c',
|
||||
src += files(
|
||||
'batman/batman_sysctl.c',
|
||||
'thermal/thermal_sysctl.c',
|
||||
'cpuclock/cpuclock_sysctl.c',
|
||||
'netstatus/netstatus_sysctl.c',
|
||||
'cpumonitor/cpumonitor_sysctl.c',
|
||||
'memusage/memusage_sysctl.c'
|
||||
]
|
||||
'memusage/memusage_sysctl.c')
|
||||
else
|
||||
src += ['batman/batman_upower.c',
|
||||
src += files(
|
||||
'batman/batman_upower.c',
|
||||
'thermal/thermal_sysctl.c',
|
||||
'cpuclock/cpuclock_sysctl.c'
|
||||
]
|
||||
'cpuclock/cpuclock_sysctl.c')
|
||||
endif
|
||||
|
||||
icon = [
|
||||
'e-module-' + module + '.edj',
|
||||
'module.desktop'
|
||||
]
|
||||
|
||||
dir_mod = join_paths(dir_module_e, module)
|
||||
dir_mod_bin = join_paths(dir_mod, module_arch)
|
||||
|
||||
if get_option(opt) == true
|
||||
config_h.set(conf, '1')
|
||||
module_files += join_paths(dir_mod_bin, module + '.so')
|
||||
|
||||
install_data(icon, install_dir: dir_mod)
|
||||
shared_module(module, src,
|
||||
include_directories: include_directories(module_includes),
|
||||
name_prefix : '',
|
||||
dependencies : module_deps,
|
||||
install_dir : dir_mod_bin,
|
||||
install : true
|
||||
)
|
||||
if get_option(m) == true
|
||||
executable('cpuclock_sysfs',
|
||||
'cpuclock/cpuclock_sysfs.c',
|
||||
dependencies: dep_crypt,
|
||||
c_args : suid_cflags,
|
||||
link_args : suid_ldflags,
|
||||
install_dir : dir_mod_bin,
|
||||
install_dir : _dir_bin,
|
||||
install : true
|
||||
)
|
||||
suid_exes += join_paths(dir_mod_bin, 'cpuclock_sysfs')
|
||||
suid_exes += join_paths(_dir_bin, 'cpuclock_sysfs')
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue