Skip to content

Instantly share code, notes, and snippets.

@danirabbit
Last active May 20, 2020 08:38
Show Gist options
  • Save danirabbit/5d60f802dc9c7ee45b13f075e9bd0b3e to your computer and use it in GitHub Desktop.
Save danirabbit/5d60f802dc9c7ee45b13f075e9bd0b3e to your computer and use it in GitHub Desktop.
Meson example
# project name and programming language
project('com.github.yourusername.yourrepositoryname', 'vala', 'c')
# Include the translations module
i18n = import('i18n')
# Set our translation domain
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
# Create a new executable, list the files we want to compile, list the dependencies we need, and install
executable(
meson.project_name(),
'src/Application.vala',
dependencies: [
dependency('gtk+-3.0')
],
install: true
)
#Translate and install our .desktop file
i18n.merge_file(
input: meson.project_name() + '.desktop.in',
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)
#Translate and install our .appdata file
i18n.merge_file(
input: meson.project_name() + '.appdata.xml.in',
output: meson.project_name() + '.appdata.xml',
po_dir: join_paths(meson.source_root(), 'po'),
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment