Skip to content

Commit

Permalink
Meson: modernize (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Jul 29, 2023
1 parent 077ed4b commit 6c7626d
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 59 deletions.
16 changes: 8 additions & 8 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ endforeach
install_data([
'styles/elementary-dark.xml',
'styles/elementary-light.xml',
], install_dir: join_paths(get_option('datadir'), 'gtksourceview-4', 'styles'))
], install_dir: get_option('datadir') / 'gtksourceview-4' / 'styles')

install_data([
'fonts/BuilderBlocks.ttf',
], install_dir: join_paths(get_option('datadir'), meson.project_name(), 'fonts'))
], install_dir: get_option('datadir') / meson.project_name() / 'fonts')

install_data(
'io.elementary.code.gschema.xml',
'io.elementary.code.plugins.spell.gschema.xml',
install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas')
install_dir: get_option('prefix') / get_option('datadir') / 'glib-2.0' / 'schemas'
)

config_data = configuration_data()
Expand All @@ -47,16 +47,16 @@ desktop_in_file = configure_file(
desktop_file = i18n.merge_file(
input: desktop_in_file,
output: 'io.elementary.code.desktop',
po_dir: join_paths(meson.source_root (), 'po', 'extra'),
po_dir: meson.project_source_root () / 'po' / 'extra',
type: 'desktop',
install_dir: join_paths(get_option('datadir'), 'applications'),
install_dir: get_option('datadir') / 'applications',
install: true
)

i18n.merge_file(
input: 'code.metainfo.xml.in',
output: meson.project_name() + '.metainfo.xml',
po_dir: meson.source_root() / 'po' / 'extra',
po_dir: meson.project_source_root() / 'po' / 'extra',
type: 'xml',
install: true,
install_dir: get_option('datadir') / 'metainfo',
Expand All @@ -78,9 +78,9 @@ if get_option ('have_pkexec')
i18n.merge_file(
input: policy_in,
output: meson.project_name() + '.policy',
po_dir: join_paths(meson.source_root (), 'po', 'extra'),
po_dir: meson.project_source_root () / 'po' / 'extra',
install: true,
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions'),
install_dir: get_option('datadir') / 'polkit-1' / 'actions',
)
endif

Expand Down
11 changes: 6 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
project(
'io.elementary.code',
'vala', 'c',
meson_version: '>= 0.58.0',
version: '7.0.0'
)

Expand All @@ -11,16 +12,16 @@ add_project_arguments([
)

add_project_arguments(
['--vapidir', join_paths(meson.current_source_dir(), 'vapi')],
['--vapidir', meson.project_source_root() / 'vapi'],
language: 'vala'
)

if get_option('have_pkexec')
add_project_arguments('--define=HAVE_PKEXEC', language: 'vala')
endif

libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'), meson.project_name())
pluginsdir = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name(), 'plugins')
libexecdir = get_option('prefix') / get_option('libexecdir') / meson.project_name()
pluginsdir = get_option('prefix') / get_option('libdir') / meson.project_name() / 'plugins'

gnome = import('gnome')
i18n = import('i18n')
Expand All @@ -46,7 +47,7 @@ code_resources = gnome.compile_resources(
)

# We need libvala-X.XX library, but it changes depending on the version that is installed
vala_version = run_command (meson.get_compiler('vala'), '--api-version').stdout().strip()
vala_version = run_command (meson.get_compiler('vala'), '--api-version', check: true).stdout().strip()
vala_dep = dependency('libvala-@0@'.format(vala_version))

dependencies = [
Expand Down Expand Up @@ -81,4 +82,4 @@ if get_option('plugins')
endif
subdir('po')

meson.add_install_script('meson/post_install.py')
gnome.post_install(glib_compile_schemas: true)
10 changes: 0 additions & 10 deletions meson/post_install.py

This file was deleted.

6 changes: 3 additions & 3 deletions plugins/brackets-completion/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/detect-indent/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/editorconfig/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -25,10 +25,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/highlight-word-selection/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/markdown-actions/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/pastebin/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -27,10 +27,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/preserve-indent/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/spell/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -26,10 +26,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/vim-emulation/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -23,10 +23,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
6 changes: 3 additions & 3 deletions plugins/word-completion/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shared_module(
module_files,
dependencies: module_deps,
install: true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)

custom_target(module_name + '.plugin_merge',
Expand All @@ -26,10 +26,10 @@ custom_target(module_name + '.plugin_merge',
'--desktop',
'--keyword=Description',
'--keyword=Name',
'-d' + join_paths(meson.source_root (), 'po', 'plugins'),
'-d' + meson.project_source_root () / 'po' / 'plugins',
'--template=@INPUT@',
'-o@OUTPUT@',
],
install : true,
install_dir: join_paths(pluginsdir, module_name),
install_dir: pluginsdir / module_name,
)
2 changes: 1 addition & 1 deletion po/extra/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
i18n.gettext('extra',
args: ['--directory='+meson.source_root()],
args: ['--directory='+meson.project_source_root()],
install: false,
preset: 'glib'
)
2 changes: 1 addition & 1 deletion po/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
i18n.gettext(meson.project_name(),
args: ['--directory='+meson.source_root()],
args: ['--directory='+meson.project_source_root()],
preset: 'glib'
)
subdir('extra')
Expand Down
2 changes: 1 addition & 1 deletion po/plugins/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
i18n.gettext('plugins',
args: ['--directory='+meson.source_root(),
args: ['--directory='+meson.project_source_root(),
'--from-code=UTF-8',
'--language=Desktop',
'--keyword=',
Expand Down
6 changes: 3 additions & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('PREFIX', get_option('prefix'))
conf_data.set_quoted('PLUGINDIR', pluginsdir)
conf_data.set_quoted('DATADIR', join_paths (get_option('prefix'), get_option('datadir')))
conf_data.set_quoted('LOCALEDIR', join_paths (get_option('prefix'), get_option('localedir')))
conf_data.set_quoted('DATADIR', get_option('prefix') / get_option('datadir'))
conf_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
conf_data.set_quoted('BRANCH', branch)

config_header = configure_file(
Expand Down Expand Up @@ -89,7 +89,7 @@ pkg.generate(
filebase: 'codecore'
)

install_data ('codecore.deps', install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi'))
install_data ('codecore.deps', install_dir: get_option('prefix') / get_option('datadir') / 'vala' / 'vapi')

codecore_dep = declare_dependency(
link_with: codecore,
Expand Down

0 comments on commit 6c7626d

Please sign in to comment.