tuf-manager/src/meson.build

218 lines
4.9 KiB
Meson
Raw Permalink Normal View History

2020-08-07 00:41:12 -04:00
glib_dep = dependency('glib-2.0')
2020-08-07 20:21:05 -04:00
gtk_dep = dependency('gtk+-3.0', version: '>=3.14.0')
2020-08-07 19:25:54 -04:00
posix_dep = meson.get_compiler('vala').find_library('posix', required: true)
m_dep = meson.get_compiler('c').find_library('m', required: true)
2020-08-07 00:41:12 -04:00
gio_unix_dep = dependency('gio-unix-2.0')
if not always_authenticated
polkit_gobject_dep = dependency('polkit-gobject-1')
endif
if build_gui
gobject_dep = dependency('gobject-2.0')
gmodule_dep = dependency('gmodule-2.0') # gmodule-export-2.0 is needed to connect the handlers from glade ui
if build_tray
appindicator_dep = dependency('appindicator3-0.1')
libnotify_dep = dependency('libnotify')
endif
endif
2020-08-04 23:09:05 -04:00
server_dependencies = [
2020-08-07 00:41:12 -04:00
glib_dep,
gio_unix_dep,
gtk_dep,
2020-08-07 19:25:54 -04:00
m_dep,
posix_dep
2020-08-04 23:09:05 -04:00
]
# if not always authenticated then polkit will be used for authentication
if not always_authenticated
2020-08-07 00:41:12 -04:00
server_dependencies += [polkit_gobject_dep]
2020-08-04 23:09:05 -04:00
endif
if build_cli
2020-08-05 21:15:32 -04:00
cli_dependencies = [
2020-08-07 00:41:12 -04:00
glib_dep,
gtk_dep,
2020-08-07 19:25:54 -04:00
m_dep
2020-08-05 21:15:32 -04:00
]
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
gui_dependencies = [
2020-08-07 00:41:12 -04:00
glib_dep,
gobject_dep,
gtk_dep,
gmodule_dep # gmodule-export-2.0 is needed to connect the handlers from glade ui
2020-08-05 21:15:32 -04:00
]
2020-08-07 00:32:22 -04:00
if build_tray
tray_dependencies = [
2020-08-07 00:41:12 -04:00
appindicator_dep,
gtk_dep,
2020-08-07 16:17:15 -04:00
libnotify_dep,
2020-08-07 19:25:54 -04:00
posix_dep
2020-08-07 00:32:22 -04:00
]
endif
2020-08-04 23:09:05 -04:00
endif
config_data = configuration_data()
config_data.set('VERSION', meson.project_version())
config_data.set('GETTEXT_PACKAGE', meson.project_name())
config_data_file = configure_file(
2020-08-05 21:15:32 -04:00
input: 'config.vala.in',
output: 'config.vala',
configuration: config_data
2020-08-04 23:09:05 -04:00
)
if build_cli
2020-08-05 21:15:32 -04:00
config_data = configuration_data()
config_data.set('APP', 'CLI')
cli_main_file = configure_file(
input: 'main.vala.in',
output: 'cli-main.vala',
configuration: config_data
)
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
config_data = configuration_data()
config_data.set('APP', 'GUI')
gui_main_file = configure_file(
input: 'main.vala.in',
output: 'gui-main.vala',
configuration: config_data
)
2020-08-04 23:09:05 -04:00
endif
error_vala_sources = files(
2020-08-05 21:15:32 -04:00
'error.vala'
2020-08-04 23:09:05 -04:00
)
# The sources containing a main function definition are separated to prevent
# conflict errors when building valadoc. valadoc doesn't like multiple entry
# points even if they are in different namespaces.
server_vala_sources_main = files(
2020-08-05 21:15:32 -04:00
'server-main.vala'
2020-08-04 23:09:05 -04:00
)
2020-08-07 00:32:22 -04:00
if build_tray
tray_vala_sources_main = files(
'tray-main.vala'
)
endif
2020-08-04 23:09:05 -04:00
server_vala_sources = files(
2020-08-05 21:15:32 -04:00
'server.vala',
'server-interface.vala'
2020-08-04 23:09:05 -04:00
)
if build_cli
2020-08-05 21:15:32 -04:00
cli_vala_sources = files(
'cli.vala',
'server-interface.vala',
'common.vala'
)
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
gui_vala_sources = files(
'gui.vala',
'gui-window.vala',
'server-interface.vala',
'common.vala'
)
2020-08-07 00:32:22 -04:00
if build_tray
tray_vala_sources = files(
'tray.vala',
'tray-icon.vala',
2020-08-07 16:17:15 -04:00
'server-interface.vala',
'common.vala'
2020-08-07 00:32:22 -04:00
)
endif
2020-08-04 23:09:05 -04:00
endif
server_sources = server_vala_sources
server_sources += server_vala_sources_main
server_sources += error_vala_sources
server_sources += config_data_file
if build_cli
2020-08-05 21:15:32 -04:00
cli_sources = cli_vala_sources
cli_sources += cli_main_file
cli_sources += error_vala_sources
cli_sources += config_data_file
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
gui_sources = gui_vala_sources
gui_sources += gui_main_file
gui_sources += error_vala_sources
gui_sources += [tuf_manager_gresource]
gui_sources += config_data_file
2020-08-07 00:32:22 -04:00
if build_tray
tray_sources = tray_vala_sources
tray_sources += tray_vala_sources_main
tray_sources += error_vala_sources
tray_sources += config_data_file
endif
2020-08-04 23:09:05 -04:00
endif
server_vala_args = []
if always_authenticated
2020-08-05 21:15:32 -04:00
server_vala_args += ['--define=ALWAYS_AUTHENTICATED']
2020-08-04 23:09:05 -04:00
endif
if build_cli
2020-08-05 21:15:32 -04:00
cli_vala_args = []
if always_authenticated
cli_vala_args += ['--define=ALWAYS_AUTHENTICATED']
endif
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
gui_vala_args = ['--gresources='+join_paths(meson.source_root(), 'data/ui/tuf.manager.gresource.xml')]
2020-08-04 23:09:05 -04:00
endif
server_exe = executable(
2020-08-05 21:15:32 -04:00
'tuf-server',
server_sources,
dependencies: server_dependencies,
vala_args: server_vala_args,
install: true,
install_dir: join_paths(get_option('libexecdir'), meson.project_name())
2020-08-04 23:09:05 -04:00
)
if build_cli
2020-08-05 21:15:32 -04:00
cli_exe = executable(
'tuf-cli',
cli_sources,
vala_args: cli_vala_args,
dependencies: cli_dependencies,
install: true
)
2020-08-04 23:09:05 -04:00
endif
if build_gui
2020-08-05 21:15:32 -04:00
gui_exe = executable(
'tuf-gui',
gui_sources,
dependencies: gui_dependencies,
vala_args: gui_vala_args,
install: true
)
2020-08-07 00:32:22 -04:00
if build_tray
tray_exe = executable(
'tuf-tray',
tray_sources,
dependencies: tray_dependencies,
install: true
)
endif
2020-08-04 23:09:05 -04:00
endif