2026-08-19 02:22:27 -08:00
|
|
|
project('bazaar', ['c', 'vala'],
|
2025-06-01 13:48:12 -08:00
|
|
|
version: run_command('version.sh', 'get-vcs').stdout().strip(),
|
2025-05-06 17:02:55 -08:00
|
|
|
meson_version: '>= 1.0.0',
|
2025-08-04 18:51:29 -08:00
|
|
|
default_options: [
|
|
|
|
|
'warning_level=2',
|
|
|
|
|
'werror=false',
|
|
|
|
|
'c_std=gnu11',
|
|
|
|
|
],
|
2025-05-06 17:02:55 -08:00
|
|
|
)
|
|
|
|
|
|
2026-04-24 15:49:24 -08:00
|
|
|
# can't have statements before `project` ...
|
|
|
|
|
bz_vcs_version = run_command('version.sh', 'get-vcs').stdout().strip()
|
|
|
|
|
bz_version = run_command('version.sh', 'get-version').stdout().strip()
|
2026-08-01 15:19:50 -08:00
|
|
|
bz_cache_version = run_command('version.sh', 'get-cache').stdout().strip()
|
2026-04-24 15:49:24 -08:00
|
|
|
|
2026-03-22 10:09:30 -08:00
|
|
|
python3 = find_program('python3')
|
2025-05-06 17:02:55 -08:00
|
|
|
i18n = import('i18n')
|
2025-07-07 08:59:02 -08:00
|
|
|
if get_option('im_a_translator')
|
|
|
|
|
subdir('po')
|
|
|
|
|
else
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
|
cc = meson.get_compiler('c')
|
2025-05-06 17:02:55 -08:00
|
|
|
|
2025-07-07 08:59:02 -08:00
|
|
|
project_c_args = []
|
|
|
|
|
test_c_args = [
|
|
|
|
|
'-Wcast-align',
|
|
|
|
|
'-Wdeclaration-after-statement',
|
|
|
|
|
'-Werror=address',
|
|
|
|
|
'-Werror=array-bounds',
|
|
|
|
|
'-Werror=empty-body',
|
|
|
|
|
'-Werror=implicit',
|
|
|
|
|
'-Werror=implicit-function-declaration',
|
|
|
|
|
'-Werror=incompatible-pointer-types',
|
|
|
|
|
'-Werror=init-self',
|
|
|
|
|
'-Werror=int-conversion',
|
|
|
|
|
'-Werror=int-to-pointer-cast',
|
|
|
|
|
'-Werror=main',
|
|
|
|
|
'-Werror=misleading-indentation',
|
|
|
|
|
'-Werror=missing-braces',
|
|
|
|
|
'-Werror=missing-include-dirs',
|
|
|
|
|
'-Werror=nonnull',
|
|
|
|
|
'-Werror=overflow',
|
|
|
|
|
'-Werror=parenthesis',
|
|
|
|
|
'-Werror=pointer-arith',
|
|
|
|
|
'-Werror=pointer-to-int-cast',
|
|
|
|
|
'-Werror=redundant-decls',
|
|
|
|
|
'-Werror=return-type',
|
|
|
|
|
'-Werror=sequence-point',
|
|
|
|
|
'-Werror=shadow',
|
|
|
|
|
'-Werror=strict-prototypes',
|
|
|
|
|
'-Werror=trigraphs',
|
|
|
|
|
'-Werror=undef',
|
|
|
|
|
'-Werror=write-strings',
|
|
|
|
|
'-Wformat-nonliteral',
|
|
|
|
|
'-Wignored-qualifiers',
|
|
|
|
|
'-Wimplicit-function-declaration',
|
|
|
|
|
'-Wlogical-op',
|
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
|
'-Wmissing-format-attribute',
|
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
|
'-Wmissing-noreturn',
|
|
|
|
|
'-Wnested-externs',
|
|
|
|
|
'-Wno-cast-function-type',
|
|
|
|
|
'-Wno-dangling-pointer',
|
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
'-Wold-style-definition',
|
|
|
|
|
'-Wpointer-arith',
|
|
|
|
|
'-Wredundant-decls',
|
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
|
'-Wswitch-default',
|
|
|
|
|
'-Wswitch-enum',
|
|
|
|
|
'-Wundef',
|
|
|
|
|
'-Wuninitialized',
|
|
|
|
|
'-Wunused',
|
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
|
['-Werror=format-security', '-Werror=format=2'],
|
|
|
|
|
]
|
|
|
|
|
if get_option('buildtype') != 'plain'
|
|
|
|
|
test_c_args += '-fstack-protector-strong'
|
|
|
|
|
endif
|
|
|
|
|
foreach arg: test_c_args
|
|
|
|
|
if cc.has_multi_arguments(arg)
|
|
|
|
|
project_c_args += arg
|
|
|
|
|
endif
|
|
|
|
|
endforeach
|
|
|
|
|
add_project_arguments(project_c_args, language: 'c')
|
2025-05-06 17:02:55 -08:00
|
|
|
|
2026-03-23 12:25:04 -08:00
|
|
|
if get_option('bge_only')
|
|
|
|
|
subdir('bge')
|
|
|
|
|
else
|
|
|
|
|
config_h = configuration_data()
|
2025-05-06 17:02:55 -08:00
|
|
|
|
2026-04-24 15:49:24 -08:00
|
|
|
config_h.set_quoted('PACKAGE_VERSION', bz_version)
|
|
|
|
|
config_h.set_quoted('PACKAGE_VCS_VERSION', bz_vcs_version)
|
2026-08-01 15:19:50 -08:00
|
|
|
config_h.set_quoted('CACHE_VERSION', bz_cache_version)
|
2026-03-23 12:25:04 -08:00
|
|
|
config_h.set_quoted('GETTEXT_PACKAGE', 'bazaar')
|
2026-07-14 02:30:35 -08:00
|
|
|
config_h.set_quoted('APPLICATION_ID', 'io.github.kolunmi.Bazaar')
|
2026-03-23 12:25:04 -08:00
|
|
|
config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
|
|
|
|
|
config_h.set_quoted('DONATE_LINK', 'https://ko-fi.com/kolunmi')
|
2026-08-18 04:46:24 -08:00
|
|
|
config_h.set_quoted('RELEASE_PAGE', run_command('version.sh', 'get-gitlab-release').stdout().strip())
|
2026-03-23 12:25:04 -08:00
|
|
|
|
2026-07-11 01:20:44 -08:00
|
|
|
bazaar_bin_name = 'bazaar'
|
|
|
|
|
config_h.set_quoted('BAZAAR_BIN_NAME', bazaar_bin_name)
|
|
|
|
|
config_h.set_quoted('REFRESH_WORKER_CLI_OPTION', '--run-refresh-worker')
|
2026-07-14 02:30:35 -08:00
|
|
|
config_h.set_quoted('UPDATE_WORKER_CLI_OPTION', '--run-update-worker')
|
2026-04-23 01:57:16 -08:00
|
|
|
|
2026-03-23 12:25:04 -08:00
|
|
|
dl_worker_bin_name = 'bazaar-dl-worker'
|
|
|
|
|
config_h.set_quoted('DL_WORKER_BIN_NAME', dl_worker_bin_name)
|
|
|
|
|
|
2026-07-11 13:23:09 -08:00
|
|
|
daemon_bin_name = 'bazaar-daemon'
|
|
|
|
|
config_h.set_quoted('DAEMON_BIN_NAME', daemon_bin_name)
|
|
|
|
|
|
|
|
|
|
bazaar_bin_name = 'bazaar'
|
|
|
|
|
config_h.set_quoted('BAZAAR_BIN_NAME', bazaar_bin_name)
|
|
|
|
|
config_h.set_quoted('BAZAAR_BIN_PATH', get_option('prefix') / get_option('bindir') / bazaar_bin_name)
|
|
|
|
|
|
2026-03-23 12:25:04 -08:00
|
|
|
if get_option('hardcoded_main_config_path') != ''
|
|
|
|
|
config_h.set_quoted('HARDCODED_MAIN_CONFIG', get_option('hardcoded_main_config_path'))
|
|
|
|
|
endif
|
|
|
|
|
if get_option('hardcoded_blocklist_path') != ''
|
|
|
|
|
config_h.set_quoted('HARDCODED_BLOCKLIST', get_option('hardcoded_blocklist_path'))
|
|
|
|
|
endif
|
|
|
|
|
if get_option('hardcoded_content_config_path') != ''
|
|
|
|
|
config_h.set_quoted('HARDCODED_CONTENT_CONFIG', get_option('hardcoded_content_config_path'))
|
|
|
|
|
endif
|
|
|
|
|
if get_option('sandboxed_libflatpak')
|
|
|
|
|
config_h.set_quoted('SANDBOXED_LIBFLATPAK', '1')
|
|
|
|
|
endif
|
2026-09-12 11:23:10 -08:00
|
|
|
config_h.set_quoted('COSMIC_APPLET_REMOTE_NAME', get_option('cosmic_applet_remote_name'))
|
2026-03-23 12:25:04 -08:00
|
|
|
|
|
|
|
|
if get_option('development')
|
|
|
|
|
config_h.set10('DEVELOPMENT_BUILD', get_option('development'))
|
2026-06-24 09:46:23 -08:00
|
|
|
config_h.set_quoted('DEVELOPMENT_EXAMPLE_YAML', get_option('prefix') / get_option('datadir') / 'bazaar' / 'example.yaml')
|
|
|
|
|
install_data(
|
|
|
|
|
'docs/example.yaml',
|
|
|
|
|
install_dir: get_option('datadir') / 'bazaar',
|
|
|
|
|
)
|
2026-03-23 12:25:04 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
configure_file(output: 'config.h', configuration: config_h)
|
|
|
|
|
add_project_arguments(['-I' + meson.project_build_root()], language: 'c')
|
|
|
|
|
|
|
|
|
|
subdir('bge')
|
|
|
|
|
subdir('data')
|
|
|
|
|
subdir('src')
|
|
|
|
|
subdir('po')
|
|
|
|
|
|
|
|
|
|
gnome.post_install(
|
|
|
|
|
glib_compile_schemas: true,
|
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
|
update_desktop_database: true,
|
|
|
|
|
)
|
|
|
|
|
endif
|
2025-07-07 08:59:02 -08:00
|
|
|
endif
|