2025-02-05 20:57:28 +08:00
|
|
|
project('maomao', ['c', 'cpp'],
|
2025-02-23 21:37:59 +08:00
|
|
|
version : '0.1.5'
|
2025-02-03 23:18:47 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
subdir('protocols')
|
|
|
|
|
|
2025-02-23 22:15:06 +08:00
|
|
|
# fs = import('fs')
|
|
|
|
|
#
|
|
|
|
|
# # 获取用户的主目录
|
|
|
|
|
# home_dir = run_command('sh', '-c', 'echo $HOME', check: true).stdout().strip()
|
|
|
|
|
# config_dir = join_paths(home_dir, '.config', 'maomao')
|
|
|
|
|
#
|
|
|
|
|
# # 如果目标目录不存在,则创建它
|
|
|
|
|
# if not fs.is_dir(config_dir)
|
|
|
|
|
# run_command('mkdir', '-p', config_dir, check: true)
|
|
|
|
|
# endif
|
|
|
|
|
#
|
|
|
|
|
# # 拷贝 config.conf
|
|
|
|
|
# config_file = join_paths(config_dir, 'config.conf')
|
|
|
|
|
# if not fs.exists(config_file)
|
|
|
|
|
# run_command('cp', 'config.conf', config_file, check: true)
|
|
|
|
|
# endif
|
|
|
|
|
#
|
|
|
|
|
# # 拷贝 autostart.sh
|
|
|
|
|
# autostart_file = join_paths(config_dir, 'autostart.sh')
|
|
|
|
|
# if not fs.exists(autostart_file)
|
|
|
|
|
# run_command('cp', 'autostart.sh', autostart_file, check: true)
|
|
|
|
|
# endif
|
2025-02-04 13:36:44 +08:00
|
|
|
|
2025-02-03 23:18:47 +08:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
libm = cc.find_library('m')
|
|
|
|
|
xcb = dependency('xcb', required : get_option('xwayland'))
|
|
|
|
|
xlibs = dependency('xcb-icccm', required : get_option('xwayland'))
|
|
|
|
|
wayland_server_dep = dependency('wayland-server')
|
|
|
|
|
wlroots_dep = dependency('wlroots', version : ['>=0.17.0', '<0.18.0'])
|
|
|
|
|
xkbcommon_dep = dependency('xkbcommon')
|
|
|
|
|
libinput_dep = dependency('libinput')
|
|
|
|
|
libwayland_client_dep = dependency('wayland-client')
|
|
|
|
|
|
|
|
|
|
c_args = [
|
|
|
|
|
'-g',
|
|
|
|
|
'-Wno-unused-function',
|
|
|
|
|
'-DWLR_USE_UNSTABLE',
|
|
|
|
|
'-D_POSIX_C_SOURCE=200809L',
|
|
|
|
|
'-DVERSION="@0@"'.format(meson.project_version())
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if xcb.found() and xlibs.found()
|
|
|
|
|
c_args += '-DXWAYLAND'
|
|
|
|
|
c_args += '-DIM'
|
|
|
|
|
endif
|
|
|
|
|
|
2025-02-05 20:57:28 +08:00
|
|
|
executable('maomao',
|
2025-02-15 18:35:22 +08:00
|
|
|
'maomao.c',
|
2025-02-03 23:18:47 +08:00
|
|
|
'util.c',
|
|
|
|
|
wayland_sources,
|
|
|
|
|
dependencies : [
|
|
|
|
|
libm,
|
|
|
|
|
xcb,
|
|
|
|
|
xlibs,
|
|
|
|
|
wayland_server_dep,
|
|
|
|
|
wlroots_dep,
|
|
|
|
|
xkbcommon_dep,
|
|
|
|
|
libinput_dep,
|
|
|
|
|
libwayland_client_dep,
|
|
|
|
|
],
|
|
|
|
|
install : true,
|
|
|
|
|
c_args : c_args
|
|
|
|
|
)
|
|
|
|
|
|
2025-02-04 07:17:44 +08:00
|
|
|
prefix = get_option('prefix')
|
|
|
|
|
desktop_install_dir = join_paths(prefix, 'share/wayland-sessions')
|
2025-02-05 20:57:28 +08:00
|
|
|
install_data('maomao.desktop', install_dir : desktop_install_dir)
|
2025-02-23 21:37:59 +08:00
|
|
|
install_data('config.conf', install_dir : '/etc/maomao')
|
|
|
|
|
|