2022-08-18 16:50:25 +00:00
|
|
|
project('gradience',
|
2022-11-29 16:23:08 +00:00
|
|
|
version: '0.3.3',
|
2022-07-17 11:46:05 +00:00
|
|
|
meson_version: '>= 0.59.0',
|
|
|
|
default_options: [ 'warning_level=2',
|
|
|
|
'werror=false',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
# Import modules
|
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
|
|
|
python = import('python')
|
|
|
|
|
2022-08-15 18:33:41 +00:00
|
|
|
# Project information
|
2022-08-18 16:50:25 +00:00
|
|
|
PROJECT_URL = 'https://github.com/GradienceTeam/Gradience'
|
2022-08-23 17:23:27 +00:00
|
|
|
BUGTRACKER_URL = 'https://github.com/GradienceTeam/Gradience/issues'
|
2022-09-22 08:32:51 +00:00
|
|
|
HELP_URL = 'https://github.com/GradienceTeam/Gradience/discussions'
|
|
|
|
TRANSLATE_URL = 'https://hosted.weblate.org/projects/GradienceTeam/gradience'
|
2022-08-15 18:33:41 +00:00
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
# Constants
|
2022-08-18 16:50:25 +00:00
|
|
|
PROJECT_RDNN_NAME = 'com.github.GradienceTeam.Gradience'
|
2022-08-15 18:33:41 +00:00
|
|
|
|
|
|
|
# Set APPLICATION_ID and VERSION_SUFFIX
|
|
|
|
if get_option('buildtype') == 'debug'
|
2022-11-11 00:42:00 +00:00
|
|
|
VCS_TAG = run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip()
|
2022-08-15 18:33:41 +00:00
|
|
|
if VCS_TAG == ''
|
|
|
|
VERSION_SUFFIX = '-devel'
|
|
|
|
else
|
|
|
|
VERSION_SUFFIX = '-@0@'.format(VCS_TAG)
|
|
|
|
endif
|
|
|
|
APPLICATION_ID = '@0@.Devel'.format(PROJECT_RDNN_NAME)
|
|
|
|
else
|
|
|
|
VERSION_SUFFIX = ''
|
|
|
|
APPLICATION_ID = PROJECT_RDNN_NAME
|
|
|
|
endif
|
2022-08-13 10:24:16 +00:00
|
|
|
|
2022-08-11 16:44:51 +00:00
|
|
|
dependency('glib-2.0')
|
2022-08-13 10:24:16 +00:00
|
|
|
dependency('gtk4', version: '>= 4.5.0')
|
|
|
|
dependency('libadwaita-1', version: '>= 1.2.alpha')
|
|
|
|
dependency('pygobject-3.0', version: '>= 3.42.0')
|
2022-10-02 01:55:42 +00:00
|
|
|
dependency('libsoup-3.0', version: '>= 3.2.0')
|
2022-08-11 16:44:51 +00:00
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
# Python installation directory
|
2022-08-20 22:59:36 +00:00
|
|
|
PY_INSTALLDIR = python.find_installation('python3', required: true, modules: ['lxml'])
|
2022-07-17 11:46:05 +00:00
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
# Check if python3 is installed
|
|
|
|
if not PY_INSTALLDIR.found()
|
|
|
|
error('No valid python3 binary found')
|
|
|
|
endif
|
|
|
|
|
|
|
|
PKGDATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
|
2022-08-18 16:50:25 +00:00
|
|
|
MODULE_DIR = join_paths(PKGDATA_DIR, 'gradience')
|
|
|
|
PLUGINS_DIR = join_paths(PKGDATA_DIR, 'gradience', 'plugins')
|
2022-08-13 10:24:16 +00:00
|
|
|
|
|
|
|
# Install configuration data
|
|
|
|
conf = configuration_data()
|
2022-08-15 18:33:41 +00:00
|
|
|
conf.set('APP_ID', APPLICATION_ID)
|
2022-08-13 10:24:16 +00:00
|
|
|
conf.set('PKGDATA_DIR', PKGDATA_DIR)
|
|
|
|
conf.set('DATA_DIR', join_paths(get_option('prefix'), get_option('datadir')))
|
|
|
|
conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
|
|
|
|
conf.set('PYTHON', PY_INSTALLDIR.full_path())
|
2022-08-15 18:33:41 +00:00
|
|
|
conf.set('VERSION', meson.project_version() + VERSION_SUFFIX)
|
2022-08-13 10:24:16 +00:00
|
|
|
conf.set('BUILD_TYPE', get_option('buildtype'))
|
2022-09-13 16:29:43 +00:00
|
|
|
conf.set('SCHEMAS_DIR', PKGDATA_DIR)
|
2022-09-13 19:53:05 +00:00
|
|
|
conf.set('SOURCE_DIR', meson.current_source_dir())
|
|
|
|
conf.set('BUILD_DIR', meson.current_build_dir())
|
2022-09-13 16:29:43 +00:00
|
|
|
|
|
|
|
conf.set('local_build', 'False')
|
|
|
|
|
|
|
|
# Local install configuration data
|
|
|
|
local_conf = configuration_data()
|
|
|
|
local_conf.set('APP_ID', APPLICATION_ID)
|
|
|
|
local_conf.set('PKGDATA_DIR', join_paths(meson.current_build_dir(), 'data'))
|
|
|
|
local_conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
|
|
|
|
local_conf.set('PYTHON', meson.current_source_dir())
|
|
|
|
local_conf.set('VERSION', meson.project_version() + VERSION_SUFFIX)
|
|
|
|
local_conf.set('BUILD_TYPE', get_option('buildtype'))
|
2022-09-16 12:20:02 +00:00
|
|
|
local_conf.set('SCHEMAS_DIR', join_paths(meson.current_build_dir(), get_option('datadir')))
|
2022-09-13 19:53:05 +00:00
|
|
|
local_conf.set('SOURCE_DIR', meson.current_source_dir())
|
|
|
|
local_conf.set('BUILD_DIR', meson.current_build_dir())
|
2022-09-13 16:29:43 +00:00
|
|
|
|
|
|
|
local_conf.set('local_build', 'True')
|
2022-07-17 11:46:05 +00:00
|
|
|
|
2022-08-13 10:24:16 +00:00
|
|
|
# Subdirs
|
2022-09-13 16:29:43 +00:00
|
|
|
subdir('gradience')
|
2022-07-17 11:46:05 +00:00
|
|
|
subdir('data')
|
|
|
|
subdir('po')
|
|
|
|
|
|
|
|
gnome.post_install(
|
|
|
|
glib_compile_schemas: true,
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
update_desktop_database: true,
|
|
|
|
)
|