Commit f5914afd authored by Robert Roth's avatar Robert Roth

Added meson build (bgo#793016)

parent 5ea330d0
......@@ -7,4 +7,12 @@ MAINTAINERCLEANFILES = \
# We currently have no custom macros
GITIGNOREFILES = m4
EXTRA_DIST = \
meson.build \
data/meson.build \
help/meson.build \
po/meson.build \
src/meson.build \
meson_post_install.py
-include $(top_srcdir)/git.mk
# Icons
install_subdir('icons',
install_dir: join_paths(get_option('datadir')),
exclude_files: [ 'Makefile', 'Makefile.in', 'Makefile.am', 'icon-source.svg','.gitignore' ],
)
# Themes
install_subdir('themes',
install_dir: pkgdatadir,
exclude_files: [ '**/Makefile', '**/Makefile.in', '**/Makefile.am', '**/.gitignore' ],
)
# UI files
install_data('preferences.ui',
install_dir: pkgdatadir,
)
install_data('swell-foop.css',
install_dir: pkgdatadir,
)
# Desktop file
i18n.merge_file(
input: 'swell-foop.desktop.in',
output: 'swell-foop.desktop',
type: 'desktop',
po_dir: podir,
install: true,
install_dir: join_paths(get_option('datadir'), 'applications'),
)
# Appdata
i18n.merge_file(
input: 'swell-foop.appdata.xml.in',
output: 'swell-foop.appdata.xml',
type: 'xml',
po_dir: podir,
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
)
# Gschema
install_data('org.gnome.swell-foop.gschema.xml',
install_dir: join_paths(get_option('datadir'), 'glib-2.0', 'schemas'),
)
# please keep this list sorted alphabetically
ca
cs
de
el
en_GB
es
eu
fr
hu
it
oc
pl
pt_BR
ru
sl
sr
sr@latin
sv
zh_CN
swell_foop_help_pages = [
'legal.xml',
'index.docbook',
]
swell_foop_help_media = [
'figures/play1.png',
'figures/play2.png',
'figures/play3.png',
'figures/play4.png',
'figures/start-up.png',
]
gnome.yelp(meson.project_name(),
sources: swell_foop_help_pages,
media: swell_foop_help_media
)
project('swell-foop', ['c','vala'],
version: '3.27.2',
meson_version: '>= 0.37',
license: 'GPLv3+',
)
gnome = import('gnome')
i18n = import('i18n')
localedir = join_paths(get_option('prefix'), get_option('localedir'))
podir = join_paths(meson.source_root(), 'po')
datadir = join_paths (get_option ('prefix'), get_option ('datadir'))
pkgdatadir = join_paths (datadir, 'swell-foop')
# Dependencies
glib_min_version = '2.36'
glib = dependency('glib-2.0', version: '>= ' + glib_min_version)
gmodule = dependency('gmodule-2.0')
gobject = dependency('gobject-2.0', version: '>= ' + glib_min_version)
gtk = dependency('gtk+-3.0', version: '>= 3.12')
clutter = dependency('clutter-1.0', version: '>= 1.14.0')
clutter_gtk = dependency('clutter-gtk-1.0', version: '>= 1.5.0')
# Check for compilers
valac = meson.get_compiler('vala')
cc = meson.get_compiler('c')
# Libraries
libmath = cc.find_library('m')
posix = valac.find_library('posix')
# Configuration
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('LOCALEDIR', localedir)
conf.set_quoted('DATADIR', localedir)
conf.set_quoted('VERSION', meson.project_version())
configure_file(output: 'config.h', configuration: conf)
config_h_dir = include_directories('.')
# Extra scripts
meson.add_install_script('meson_post_install.py')
# Subdirs
subdir('data')
subdir('src')
subdir('help')
subdir('po')
#!/usr/bin/env python3
import os
import subprocess
install_prefix = os.environ['MESON_INSTALL_PREFIX']
icondir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
if not os.environ.get('DESTDIR'):
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
print('Compiling gsettings schemas...')
subprocess.call(['glib-compile-schemas', schemadir])
i18n.gettext(meson.project_name(),
preset: 'glib'
)
swell_foop_sources = [
'config.vapi',
'history.vala',
'game.vala',
'game-view.vala',
'score-dialog.vala',
'swell-foop.vala',
]
swell_foop_deps = [
posix,
libmath,
gmodule,
glib,
gobject,
gtk,
clutter,
clutter_gtk,
]
swell_foop_c_flags = [
'-DVERSION="@0@"'.format (meson.project_version ()),
'-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()),
'-DLOCALEDIR="@0@"'.format (localedir),
'-DDATADIR="@0@"'.format (pkgdatadir),
]
swell_foop_vala_flags = [
'--target-glib', glib_min_version,
]
executable('swell-foop', swell_foop_sources,
dependencies: swell_foop_deps,
vala_args: swell_foop_vala_flags,
c_args: swell_foop_c_flags,
install: true,
)
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