Commit 7400a1c8 authored by Niels De Graef's avatar Niels De Graef

meson: bump the minimal version to 0.49

This allows us to clean up some of the definitions in the meson.build
files. For example, we can use the `/` operator to join paths (rather
than the more verbose `join_paths()`) and we can use a dictionary for
small configuration_data objects.
parent b5582ba2
icons_install_dir = join_paths(datadir, 'icons')
icons_install_dir = get_option('datadir') / 'icons'
foreach size: [ 16, 22, 24, 32, 48 ]
icon_size_str = '@0@x@0@'.format(size)
icon_subfolder = join_paths('hicolor', icon_size_str, 'apps')
icon_subfolder = 'hicolor' / icon_size_str / 'apps'
foreach app: [ 'seahorse-preferences' ]
install_data(
join_paths(icon_subfolder, app + '.png'),
install_dir: join_paths(icons_install_dir, icon_subfolder),
icon_subfolder / (app + '.png'),
install_dir: icons_install_dir / icon_subfolder,
)
endforeach
endforeach
# special case for symbolic
icon_subfolder = join_paths('hicolor', 'symbolic', 'apps')
install_data(
join_paths(icon_subfolder, 'org.gnome.seahorse.Application-symbolic.svg'),
install_dir: join_paths(icons_install_dir, icon_subfolder),
icon_subfolder = 'hicolor' / 'symbolic' / 'apps'
install_data(icon_subfolder / 'org.gnome.seahorse.Application-symbolic.svg',
install_dir: icons_install_dir / icon_subfolder,
)
icon_subfolder = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(icon_subfolder, 'org.gnome.seahorse.Application.svg'),
install_dir: join_paths(icons_install_dir, icon_subfolder),
icon_subfolder = 'hicolor' / 'scalable' / 'apps'
install_data(icon_subfolder / 'org.gnome.seahorse.Application.svg',
install_dir: icons_install_dir / icon_subfolder,
)
# private icons
private_icons_install_dir = join_paths(pkgdatadir, 'icons')
private_icons_install_dir = get_option('datadir') / meson.project_name() / 'icons'
foreach size: [ 22, 48 ]
icon_size_str = '@0@x@0@'.format(size)
# ..../apps
icon_subfolder = join_paths('hicolor', icon_size_str, 'apps')
icon_subfolder = 'hicolor' / icon_size_str / 'apps'
foreach private_icon: [ 'key', 'key-personal', 'key-ssh' ]
install_data(
join_paths(icon_subfolder, 'seahorse-@0@.png'.format(private_icon)),
install_dir: join_paths(private_icons_install_dir, icon_subfolder),
icon_subfolder / 'seahorse-@0@.png'.format(private_icon),
install_dir: private_icons_install_dir / icon_subfolder,
)
endforeach
# ..../status
icon_subfolder = join_paths('hicolor', icon_size_str, 'status')
icon_subfolder = 'hicolor' / icon_size_str / 'status'
foreach private_icon: [ 'sign', 'sign-bad', 'sign-ok' ]
install_data(
join_paths(icon_subfolder, 'seahorse-@0@.png'.format(private_icon)),
install_dir: join_paths(private_icons_install_dir, icon_subfolder),
icon_subfolder / 'seahorse-@0@.png'.format(private_icon),
install_dir: private_icons_install_dir / icon_subfolder,
)
endforeach
endforeach
# Only has a 48x48 version somehow
icon_subfolder = join_paths('hicolor', '48x48', 'status')
icon_subfolder = 'hicolor' / '48x48' / 'status'
install_data(
join_paths(icon_subfolder, 'seahorse-sign-unknown.png'),
install_dir: join_paths(private_icons_install_dir, icon_subfolder),
icon_subfolder / 'seahorse-sign-unknown.png',
install_dir: private_icons_install_dir / icon_subfolder,
)
......@@ -7,11 +7,11 @@ gsettings_files = [
'org.gnome.seahorse.window.gschema.xml',
]
install_data(gsettings_files,
install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
)
# Resources
resources_xml = join_paths(meson.source_root(), 'data', 'seahorse.gresource.xml')
resources_xml = meson.source_root() / 'data' / 'seahorse.gresource.xml'
resources_src = gnome.compile_resources('seahorse-resources',
resources_xml,
)
......@@ -23,18 +23,16 @@ i18n.merge_file(
type: 'xml',
po_dir: po_dir,
install: true,
install_dir: join_paths(datadir, 'metainfo')
install_dir: get_option('datadir') / 'metainfo',
)
# The configuration for the desktop and service files
desktop_conf = configuration_data()
desktop_conf.set('bindir', bindir)
# The desktop file
configured_desktop_file = configure_file(
input: 'org.gnome.seahorse.Application.desktop.in.in',
output: 'org.gnome.seahorse.Application.desktop.in',
configuration: desktop_conf,
configuration: {
'bindir': seahorse_prefix / get_option('bindir'),
},
)
i18n.merge_file(
input: configured_desktop_file,
......@@ -42,22 +40,23 @@ i18n.merge_file(
type: 'desktop',
po_dir: po_dir,
install: true,
install_dir: join_paths(datadir, 'applications')
install_dir: get_option('datadir') / 'applications',
)
# The service file
configure_file(
input: 'org.gnome.seahorse.Application.service.in',
output: 'org.gnome.seahorse.Application.service',
configuration: desktop_conf,
install: true,
install_dir: join_paths(datadir, 'dbus-1', 'services'),
configuration: {
'bindir': seahorse_prefix / get_option('bindir'),
},
install_dir: get_option('datadir') / 'dbus-1' / 'services',
)
# The search provider
install_data(
'seahorse-search-provider.ini',
install_dir: join_paths(datadir, 'gnome-shell', 'search-providers')
install_dir: get_option('datadir') / 'gnome-shell' / 'search-providers',
)
# manpage
......@@ -65,9 +64,8 @@ if with_manpage
xsltproc = find_program('xsltproc')
custom_target('manfile-seahorse',
input: 'seahorse.xml',
output: 'seahorse.1',
install: true,
install_dir: join_paths(get_option('mandir'), 'man1'),
install_dir: get_option('mandir') / 'man1',
command: [
xsltproc,
'--nonet',
......
project('seahorse', ['vala', 'c'],
version: '3.32',
meson_version: '>= 0.42',
meson_version: '>= 0.49',
license: 'GPL2+',
)
......@@ -23,19 +23,16 @@ valac = meson.get_compiler('vala')
buildtype = get_option('buildtype')
seahorse_prefix = get_option('prefix')
po_dir = join_paths(meson.source_root(), 'po')
datadir = join_paths(seahorse_prefix, get_option('datadir'))
bindir = join_paths(seahorse_prefix, get_option('bindir'))
pkgdatadir = join_paths(datadir, meson.project_name())
libexecbindir = join_paths(seahorse_prefix, get_option('libexecdir'), meson.project_name())
localedir = join_paths(seahorse_prefix, get_option('localedir'))
po_dir = meson.source_root() / 'po'
datadir = seahorse_prefix / get_option('datadir')
libexecbindir = seahorse_prefix / get_option('libexecdir') / meson.project_name()
# Dependencies
min_glib_version = '2.44'
min_gcr_version = '3.11.91'
min_gpgme_version = '1.7.0'
accepted_gpg_versions = [ '2.0.12', '2.1.4', '2.2.0' ]
gpg_check_version = find_program(join_paths('build-aux', 'gpg_check_version.py'))
gpg_check_version = find_program('build-aux' / 'gpg_check_version.py')
glib_deps = [
dependency('glib-2.0', version: '>=' + min_glib_version),
......@@ -119,9 +116,9 @@ conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', '@VCS_TAG@')
conf.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
conf.set_quoted('PKGDATADIR', pkgdatadir)
conf.set_quoted('PKGDATADIR', get_option('datadir') / meson.project_name())
conf.set_quoted('EXECDIR', libexecbindir)
conf.set_quoted('LOCALEDIR', localedir)
conf.set_quoted('LOCALEDIR', seahorse_prefix / get_option('localedir'))
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
conf.set('WITH_DEBUG', buildtype.contains('debug'))
......@@ -160,13 +157,13 @@ config_file = configure_file(
config = declare_dependency(
sources: config_file,
dependencies: [
valac.find_library('config', dirs: join_paths(meson.source_root(), 'common')),
valac.find_library('config', dirs: meson.source_root() / 'common'),
],
include_directories: include_directories('.'),
)
# Post-install scripts
meson.add_install_script(join_paths('build-aux', 'meson_post_install.py'))
meson.add_install_script('build-aux' / 'meson_post_install.py')
# subdirs
subdir('po')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment