2017-10-02 14:01:18 +00:00
|
|
|
project(
|
|
|
|
'gitg', ['c', 'vala'],
|
2019-05-23 06:53:59 +00:00
|
|
|
version: '3.33.2',
|
2017-11-15 10:07:49 +00:00
|
|
|
license: 'GPL2+',
|
|
|
|
default_options: 'buildtype=debugoptimized',
|
2018-12-19 23:50:03 +00:00
|
|
|
meson_version: '>= 0.48.0',
|
2017-10-02 14:01:18 +00:00
|
|
|
)
|
2019-01-13 16:31:50 +00:00
|
|
|
application_id = 'org.gnome.gitg'
|
2017-10-02 14:01:18 +00:00
|
|
|
gitg_name = meson.project_name()
|
|
|
|
|
2019-01-13 16:31:50 +00:00
|
|
|
if get_option('profile') == 'development'
|
|
|
|
application_id = 'org.gnome.gitgDevel'
|
|
|
|
gitg_name = meson.project_name() + 'Devel'
|
|
|
|
endif
|
|
|
|
|
2017-10-02 14:01:18 +00:00
|
|
|
gitg_version = meson.project_version()
|
|
|
|
version_array = gitg_version.split('.')
|
|
|
|
gitg_major_version = version_array[0].to_int()
|
|
|
|
gitg_minor_version = version_array[1].to_int()
|
|
|
|
gitg_micro_version = version_array[2].to_int()
|
|
|
|
|
|
|
|
gitg_api_version = '1.0'
|
|
|
|
|
2018-10-25 12:45:13 +00:00
|
|
|
windows = import('windows')
|
|
|
|
host_system = host_machine.system()
|
|
|
|
|
2017-10-02 14:01:18 +00:00
|
|
|
gitg_gettext = gitg_name
|
|
|
|
|
|
|
|
gitg_prefix = get_option('prefix')
|
|
|
|
gitg_bindir = join_paths(gitg_prefix, get_option('bindir'))
|
|
|
|
gitg_datadir = join_paths(gitg_prefix, get_option('datadir'))
|
|
|
|
gitg_includedir = join_paths(gitg_prefix, get_option('includedir'))
|
|
|
|
gitg_libdir = join_paths(gitg_prefix, get_option('libdir'))
|
|
|
|
gitg_localedir = join_paths(gitg_prefix, get_option('localedir'))
|
|
|
|
|
|
|
|
gitg_pkgdatadir = join_paths(gitg_datadir, gitg_name)
|
|
|
|
gitg_pkglibdir = join_paths(gitg_libdir, gitg_name)
|
|
|
|
|
2018-10-05 07:19:46 +00:00
|
|
|
gitg_girepositorydir = join_paths(gitg_libdir, 'girepository-1.0')
|
2017-10-02 14:01:18 +00:00
|
|
|
|
|
|
|
soversion = 0
|
|
|
|
current = 0
|
|
|
|
revision = 0
|
|
|
|
libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
|
|
|
|
|
|
|
|
gitg_debug = get_option('buildtype').contains('debug')
|
|
|
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
valac = meson.get_compiler('vala')
|
|
|
|
|
2018-10-04 11:23:31 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
|
|
|
pkg = import('pkgconfig')
|
|
|
|
|
|
|
|
source_root = meson.current_source_dir()
|
|
|
|
build_root = meson.current_build_dir()
|
|
|
|
|
2018-10-05 07:24:44 +00:00
|
|
|
libgitg_dir = join_paths(source_root, 'libgitg')
|
2018-10-04 11:23:31 +00:00
|
|
|
po_dir = join_paths(source_root, 'po')
|
|
|
|
vapi_dir = join_paths(source_root, 'vapi')
|
|
|
|
|
|
|
|
top_inc = include_directories('.')
|
|
|
|
|
2017-10-02 14:01:18 +00:00
|
|
|
config_h = configuration_data()
|
|
|
|
|
|
|
|
# defines
|
|
|
|
set_defines = [
|
|
|
|
# package
|
|
|
|
['PACKAGE_NAME', gitg_name],
|
|
|
|
['PACKAGE_URL', 'https://wiki.gnome.org/Apps/Gitg'],
|
|
|
|
['VERSION', gitg_version],
|
2019-01-13 16:31:50 +00:00
|
|
|
['APPLICATION_ID', application_id],
|
|
|
|
['PROFILE', get_option('profile')],
|
2017-10-02 14:01:18 +00:00
|
|
|
# i18n
|
|
|
|
['GETTEXT_PACKAGE', gitg_gettext],
|
|
|
|
# gitg
|
|
|
|
['GITG_DATADIR', gitg_pkgdatadir],
|
|
|
|
['GITG_LIBDIR', gitg_pkglibdir],
|
2018-10-01 19:44:32 +00:00
|
|
|
['GITG_LOCALEDIR', gitg_localedir],
|
2017-10-02 14:01:18 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach define: set_defines
|
|
|
|
config_h.set_quoted(define[0], define[1])
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
# c compiler flags
|
|
|
|
common_flags = ['-DHAVE_CONFIG_H']
|
|
|
|
warn_flags = []
|
|
|
|
|
2017-11-15 10:00:01 +00:00
|
|
|
if get_option('deprecations')
|
2017-10-02 14:01:18 +00:00
|
|
|
warn_flags += [
|
|
|
|
'-DG_DISABLE_DEPRECATED',
|
|
|
|
'-DGDK_DISABLE_DEPRECATED',
|
|
|
|
'-DGTK_DISABLE_DEPRECATED',
|
|
|
|
'-DGDK_PIXBUF_DISABLE_DEPRECATED',
|
|
|
|
'-DGNOME_DISABLE_DEPRECATED',
|
2018-10-01 19:44:32 +00:00
|
|
|
'-DGSEAL_ENABLE',
|
2017-10-02 14:01:18 +00:00
|
|
|
]
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gitg_debug
|
2018-10-01 19:54:04 +00:00
|
|
|
warn_flags += cc.get_supported_arguments([
|
2017-10-02 14:01:18 +00:00
|
|
|
'-Werror=format=2',
|
|
|
|
'-Werror=implicit-function-declaration',
|
|
|
|
'-Werror=init-self',
|
|
|
|
'-Werror=missing-include-dirs',
|
|
|
|
'-Werror=missing-prototypes',
|
|
|
|
'-Werror=pointer-arith',
|
|
|
|
'-Werror=return-type',
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
'-Wnested-externs',
|
|
|
|
'-Wstrict-prototypes',
|
2018-10-01 19:44:32 +00:00
|
|
|
'-Wuninitialized',
|
2018-10-01 19:54:04 +00:00
|
|
|
])
|
2017-10-02 14:01:18 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
add_project_arguments(common_flags, language: 'c')
|
2019-04-23 18:35:38 +00:00
|
|
|
add_project_arguments(['-DG_LOG_DOMAIN="gitg"'], language: 'c')
|
2017-10-02 14:01:18 +00:00
|
|
|
|
|
|
|
# vala compiler flags
|
2018-10-01 19:54:04 +00:00
|
|
|
add_project_arguments('--vapidir=' + vapi_dir, language: 'vala')
|
2017-10-02 14:01:18 +00:00
|
|
|
|
2018-10-04 11:23:31 +00:00
|
|
|
symbol_map = join_paths(source_root, 'libgitg.map')
|
2018-10-01 20:20:33 +00:00
|
|
|
common_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.format(symbol_map))
|
2017-10-02 14:01:18 +00:00
|
|
|
|
|
|
|
glib_req_version = '>= 2.38'
|
|
|
|
|
|
|
|
gee_dep = dependency('gee-0.8')
|
|
|
|
gio_dep = dependency('gio-2.0', version: glib_req_version)
|
|
|
|
glib_dep = dependency('glib-2.0', version: glib_req_version)
|
2018-10-05 05:32:30 +00:00
|
|
|
gobject_introspection_dep = dependency('gobject-introspection-1.0', version: '>= 0.10.1')
|
|
|
|
gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas')
|
2017-10-02 14:01:18 +00:00
|
|
|
gtk_dep = dependency('gtk+-3.0', version: '>= 3.20.0')
|
2018-10-05 05:32:30 +00:00
|
|
|
gtkspell_dep = dependency('gtkspell3-3.0')
|
2019-05-19 20:03:51 +00:00
|
|
|
gtksourceview_dep = dependency('gtksourceview-4', version: '>= 4.0.3')
|
2019-04-06 16:53:47 +00:00
|
|
|
libgit2_glib_dep = dependency('libgit2-glib-1.0', version: ['>= 0.27.8'])
|
2017-10-02 14:01:18 +00:00
|
|
|
libpeas_dep = dependency('libpeas-1.0')
|
2018-10-05 05:32:30 +00:00
|
|
|
libsecret_dep = dependency('libsecret-1')
|
2017-10-02 14:01:18 +00:00
|
|
|
libsoup_dep = dependency('libsoup-2.4')
|
2018-10-05 05:32:30 +00:00
|
|
|
libxml_dep = dependency('libxml-2.0', version: '>= 2.9.0')
|
2019-03-07 23:52:56 +00:00
|
|
|
libdazzle_dep = dependency('libdazzle-1.0')
|
2017-10-02 14:01:18 +00:00
|
|
|
|
|
|
|
config_dep = valac.find_library('config', dirs: vapi_dir)
|
|
|
|
gitg_platform_support_dep = valac.find_library('gitg-platform-support', dirs: vapi_dir)
|
|
|
|
|
|
|
|
# ggit threads
|
|
|
|
ggit_threads = '''
|
|
|
|
#include <libgit2-glib/ggit.h>
|
|
|
|
int
|
|
|
|
main(int argc, const char *argv[])
|
|
|
|
{
|
|
|
|
ggit_init ();
|
|
|
|
return ((ggit_get_features () & GGIT_FEATURE_THREADS) != 0) ? 0 : 1;
|
|
|
|
};
|
|
|
|
'''
|
|
|
|
|
|
|
|
res = cc.run(ggit_threads, dependencies: libgit2_glib_dep)
|
|
|
|
assert(
|
|
|
|
res.compiled() and (res.returncode() == 0),
|
2018-10-01 19:44:32 +00:00
|
|
|
'please recompile a threadsafe version of libgit2 (-DTHREADSAFE:BOOL=ON)',
|
2017-10-02 14:01:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# gtk required version is set to 3.20, so this will be always true
|
2018-10-05 07:49:35 +00:00
|
|
|
gtk_shortcuts_window = gtk_dep.version().version_compare('>= 3.19')
|
2017-10-02 14:01:18 +00:00
|
|
|
|
|
|
|
m_dep = cc.find_library('m', required: false)
|
|
|
|
|
|
|
|
gdk_dep = dependency('gdk-3.0')
|
|
|
|
gdk_targets = gdk_dep.get_pkgconfig_variable('targets')
|
|
|
|
|
|
|
|
if gdk_targets.contains('quartz')
|
|
|
|
platform_name = 'osx'
|
|
|
|
elif gdk_targets.contains('x11')
|
|
|
|
platform_name = 'unix'
|
|
|
|
elif gdk_targets.contains('win32')
|
|
|
|
platform_name = 'win32'
|
|
|
|
else
|
|
|
|
error('Unknown Gdk targets: ' + gdk_targets)
|
|
|
|
endif
|
|
|
|
config_h.set_quoted('PLATFORM_NAME', platform_name)
|
|
|
|
|
|
|
|
g_ir_compiler = find_program('g-ir-compiler')
|
|
|
|
|
2018-10-25 12:10:04 +00:00
|
|
|
module_suffix = []
|
|
|
|
# Keep the autotools convention for shared module suffix because GModule
|
|
|
|
# depends on it: https://gitlab.gnome.org/GNOME/glib/issues/520
|
|
|
|
if ['darwin', 'ios'].contains(host_machine.system())
|
|
|
|
module_suffix = 'so'
|
|
|
|
endif
|
|
|
|
|
2017-10-02 14:01:18 +00:00
|
|
|
subdir('po')
|
|
|
|
subdir('contrib/xml')
|
|
|
|
subdir('contrib/ide')
|
|
|
|
subdir('libgitg')
|
|
|
|
subdir('libgitg-ext')
|
|
|
|
subdir('plugins')
|
|
|
|
subdir('gitg')
|
|
|
|
subdir('data')
|
|
|
|
subdir('tests')
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
output: 'config.h',
|
2018-10-01 19:44:32 +00:00
|
|
|
configuration: config_h,
|
2017-10-02 14:01:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
meson.add_install_script(
|
|
|
|
'meson_post_install.py',
|
|
|
|
gitg_datadir,
|
2017-11-15 10:00:01 +00:00
|
|
|
(enable_python ? 'python' : ''),
|
2018-10-01 19:44:32 +00:00
|
|
|
gitg_libdir,
|
2017-10-02 14:01:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
output = '\nConfiguration:\n\n'
|
2018-10-04 11:23:31 +00:00
|
|
|
output += ' Source code location: ' + source_root + '\n'
|
2017-10-02 14:01:18 +00:00
|
|
|
output += ' Compiler: ' + cc.get_id() + '\n'
|
|
|
|
output += ' Glade catalog: ' + enable_glade_catalog.to_string() + '\n'
|
|
|
|
output += ' Debug enabled: ' + gitg_debug.to_string() + '\n'
|
|
|
|
output += ' Python support: ' + enable_python.to_string() + '\n'
|
2019-01-13 16:31:50 +00:00
|
|
|
output += ' Profile: ' + get_option('profile') + '\n'
|
2017-10-02 14:01:18 +00:00
|
|
|
message(output)
|