[gnome-games] build: Port to meson
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] build: Port to meson
- Date: Sun, 15 Jul 2018 14:56:02 +0000 (UTC)
commit bb23e468f267eba080aac44ad9132dd5bb0e9a08
Author: Exalm <exalm7659 gmail com>
Date: Mon May 7 17:31:16 2018 +0500
build: Port to meson
Also change config.vala to config.vapi to match autogenerated header.
Requires meson >= 0.46.1 because older versions have a bug that prevents
building plugins.
build-aux/post_install.py | 20 ++++
data/icons/meson.build | 23 ++++
data/meson.build | 35 ++++++
data/options/meson.build | 6 ++
meson.build | 75 +++++++++++++
meson_options.txt | 16 +++
plugins/desktop/data/meson.build | 7 ++
plugins/desktop/meson.build | 2 +
plugins/desktop/src/meson.build | 27 +++++
plugins/dreamcast/data/meson.build | 1 +
plugins/dreamcast/meson.build | 2 +
plugins/dreamcast/src/meson.build | 18 ++++
plugins/game-cube/data/meson.build | 1 +
plugins/game-cube/meson.build | 2 +
plugins/game-cube/src/meson.build | 18 ++++
plugins/libretro/data/meson.build | 1 +
plugins/libretro/meson.build | 2 +
plugins/libretro/src/meson.build | 22 ++++
plugins/love/data/meson.build | 1 +
plugins/love/meson.build | 2 +
plugins/love/src/meson.build | 27 +++++
plugins/mame/data/meson.build | 7 ++
plugins/mame/meson.build | 2 +
plugins/mame/src/meson.build | 19 ++++
plugins/meson.build | 22 ++++
plugins/nintendo-ds/data/meson.build | 1 +
plugins/nintendo-ds/meson.build | 2 +
plugins/nintendo-ds/src/meson.build | 21 ++++
plugins/playstation/data/meson.build | 19 ++++
plugins/playstation/meson.build | 2 +
plugins/playstation/src/meson.build | 27 +++++
plugins/sega-cd/data/meson.build | 1 +
plugins/sega-cd/meson.build | 2 +
plugins/sega-cd/src/meson.build | 18 ++++
plugins/sega-saturn/data/meson.build | 1 +
plugins/sega-saturn/meson.build | 2 +
plugins/sega-saturn/src/meson.build | 19 ++++
plugins/steam/data/meson.build | 1 +
plugins/steam/meson.build | 2 +
plugins/steam/src/meson.build | 23 ++++
plugins/turbografx-cd/data/meson.build | 1 +
plugins/turbografx-cd/meson.build | 2 +
plugins/turbografx-cd/src/meson.build | 17 +++
plugins/virtual-boy/data/meson.build | 1 +
plugins/virtual-boy/meson.build | 2 +
plugins/virtual-boy/src/meson.build | 17 +++
plugins/wii/data/meson.build | 1 +
plugins/wii/meson.build | 2 +
plugins/wii/src/meson.build | 18 ++++
po/meson.build | 1 +
src/config.vala | 6 --
src/config.vapi | 8 ++
src/core/plugin-register-iterator.vala | 2 +-
src/core/plugin-registrar.vala | 2 +-
src/gnome-games.deps | 5 -
src/main.vala | 9 +-
src/meson.build | 192 +++++++++++++++++++++++++++++++++
src/retro/retro-runner.vala | 2 +-
src/ui/application.vala | 4 +-
59 files changed, 768 insertions(+), 23 deletions(-)
---
diff --git a/build-aux/post_install.py b/build-aux/post_install.py
new file mode 100755
index 0000000..4d770e0
--- /dev/null
+++ b/build-aux/post_install.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python3
+
+import os
+import subprocess
+import sys
+
+destdir = os.environ.get('DESTDIR', '')
+
+if not destdir and len(sys.argv) > 1:
+ datadir = sys.argv[1]
+
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')])
+
+ print('Updating icon cache...')
+ subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'hicolor')])
+ subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'HighContrast')])
+
+ print('Updating desktop database...')
+ subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'icons', 'applications')])
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..09953d6
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,23 @@
+icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256', '512x512']
+
+foreach icon_size: icon_sizes
+ hicolor_dir = join_paths('hicolor', icon_size, 'apps')
+ highcontrast_dir = join_paths('HighContrast', icon_size, 'apps')
+
+ install_data(
+ join_paths(hicolor_dir, 'org.gnome.Games.png'),
+ install_dir: join_paths(datadir, 'icons', hicolor_dir)
+ )
+
+ install_data(
+ join_paths(highcontrast_dir, 'org.gnome.Games.png'),
+ install_dir: join_paths(datadir, 'icons', highcontrast_dir)
+ )
+endforeach
+
+hicolor_dir = join_paths('hicolor', 'scalable', 'apps')
+
+install_data(
+ join_paths(hicolor_dir, 'org.gnome.Games-symbolic.svg'),
+ install_dir: join_paths(datadir, 'icons', hicolor_dir)
+)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..2e4716a
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,35 @@
+resources = gnome.compile_resources(
+ 'org.gnome.Games',
+ 'org.gnome.Games.gresource.xml',
+ c_name: 'resources'
+)
+
+i18n.merge_file ('desktop-file',
+ type: 'desktop',
+ input: 'org.gnome.Games.desktop.in',
+ output: 'org.gnome.Games.desktop',
+ po_dir: podir,
+ install: true,
+ install_dir: join_paths (datadir, 'applications')
+)
+
+i18n.merge_file ('appdata-file',
+ input: 'org.gnome.Games.appdata.xml.in',
+ output: 'org.gnome.Games.appdata.xml',
+ po_dir: podir,
+ install: true,
+ install_dir: join_paths (datadir, 'metainfo')
+)
+
+gsettings_conf = configuration_data ()
+gsettings_conf.set ('GETTEXT_PACKAGE', meson.project_name ())
+configure_file (
+ input: 'org.gnome.Games.gschema.xml',
+ output: 'org.gnome.Games.gschema.xml',
+ configuration: gsettings_conf,
+ install: true,
+ install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
+)
+
+subdir ('icons')
+subdir ('options')
diff --git a/data/options/meson.build b/data/options/meson.build
new file mode 100644
index 0000000..fbc6c08
--- /dev/null
+++ b/data/options/meson.build
@@ -0,0 +1,6 @@
+options_files = [
+ 'desmume.options',
+ 'desmume2015.options'
+]
+
+install_data (options_files, install_dir: options_dir)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..32ef147
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,75 @@
+project('gnome-games',
+ ['vala', 'c'],
+ version: '3.29.1',
+ license: 'GPL3+',
+ meson_version: '>= 0.46.1'
+)
+
+gnome = import ('gnome')
+i18n = import('i18n')
+
+cc = meson.get_compiler ('c')
+valac = meson.get_compiler ('vala')
+
+glib_min_version = '2.38'
+manette_min_version = '0.2.0'
+retro_gtk_min_version = '0.13.2'
+
+gio_dep = dependency ('gio-2.0', version: '>=' + glib_min_version)
+glib_dep = dependency ('glib-2.0', version: '>=' + glib_min_version)
+grilo_dep = dependency ('grilo-0.3')
+gtk_dep = dependency ('gtk+-3.0')
+manette_dep = dependency ('manette-0.2', version: '>=' + manette_min_version)
+retro_gtk_dep = dependency ('retro-gtk-0.14', version: '>=' + retro_gtk_min_version)
+rsvg_dep = dependency ('librsvg-2.0')
+soup_dep = dependency ('libsoup-2.4')
+sqlite_dep = dependency ('sqlite3')
+tracker_sparql_dep = dependency ('tracker-sparql-2.0')
+xml_dep = dependency ('libxml-2.0')
+
+srcdir = join_paths (meson.source_root (), 'src')
+podir = join_paths (meson.source_root (), 'po')
+
+prefix = get_option('prefix')
+datadir = join_paths (prefix, get_option ('datadir'))
+libdir = join_paths (prefix, get_option ('libdir'))
+localedir = join_paths (prefix, get_option ('localedir'))
+options_dir = join_paths (datadir, meson.project_name(), 'options')
+plugins_dir = join_paths (libdir, meson.project_name(), 'plugins')
+
+config_h = configuration_data ()
+config_h.set_quoted ('GETTEXT_PACKAGE', meson.project_name ())
+config_h.set_quoted ('GNOMELOCALEDIR', localedir)
+config_h.set_quoted ('OPTIONS_DIR', options_dir)
+config_h.set_quoted ('PLUGINS_DIR', plugins_dir)
+config_h.set_quoted ('VERSION', meson.project_version ())
+
+configure_file (output: 'config.h', configuration: config_h)
+
+config_dep = valac.find_library ('config', dirs: srcdir)
+
+confinc = include_directories('.')
+srcinc = include_directories('src')
+
+add_project_arguments (
+ '-DGETTEXT_PACKAGE="' + meson.project_name () + '"',
+ '-DRETRO_GTK_USE_UNSTABLE_API',
+ language: 'c'
+)
+
+add_project_arguments (
+ '--target-glib=' + glib_min_version,
+ language: 'vala'
+)
+
+meson.add_install_script (
+ join_paths ('build-aux', 'post_install.py'),
+ datadir
+)
+
+# FIXME 'plugins' have to be after 'src' as the plugins depend on the
+# produced VAPI file and dependency tracking doesn't work as expected.
+subdir ('data')
+subdir ('po')
+subdir ('src')
+subdir ('plugins')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..f70dc61
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,16 @@
+# Plugins
+# This must mirror the list in plugins/meson.build
+option ('desktop-plugin', description: 'Support for desktop games', type: 'boolean')
+option ('dreamcast-plugin', description: 'Support for Dreamcast games', type: 'boolean')
+option ('game-cube-plugin', description: 'Support for GameCube games', type: 'boolean')
+option ('libretro-plugin', description: 'Support for Libretro games', type: 'boolean')
+option ('love-plugin', description: 'Support for LÖVE games', type: 'boolean')
+option ('mame-plugin', description: 'Support for MAME games', type: 'boolean')
+option ('nintendo-ds-plugin', description: 'Support for Nintendo DS games', type: 'boolean')
+option ('playstation-plugin', description: 'Support for PlayStation games', type: 'boolean')
+option ('sega-cd-plugin', description: 'Support for Sega CD games', type: 'boolean')
+option ('sega-saturn-plugin', description: 'Support for Sega Saturn games', type: 'boolean')
+option ('steam-plugin', description: 'Support for Steam games', type: 'boolean')
+option ('turbografx-cd-plugin', description: 'Support for TurboGrafx-CD games', type: 'boolean')
+option ('virtual-boy-plugin', description: 'Support for Virtual Boy games', type: 'boolean')
+option ('wii-plugin', description: 'Support for Wii games', type: 'boolean')
diff --git a/plugins/desktop/data/meson.build b/plugins/desktop/data/meson.build
new file mode 100644
index 0000000..c037d41
--- /dev/null
+++ b/plugins/desktop/data/meson.build
@@ -0,0 +1,7 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
+
+desktop_resources = gnome.compile_resources (
+ 'desktop',
+ 'desktop.gresource.xml',
+ c_name: 'resources'
+)
diff --git a/plugins/desktop/meson.build b/plugins/desktop/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/desktop/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/desktop/src/meson.build b/plugins/desktop/src/meson.build
new file mode 100644
index 0000000..be7eb4c
--- /dev/null
+++ b/plugins/desktop/src/meson.build
@@ -0,0 +1,27 @@
+vala_sources = [
+ 'desktop-error.vala',
+ 'desktop-icon.vala',
+ 'desktop-plugin.vala',
+ 'desktop-title.vala',
+ 'desktop-tracker-uri-query.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesDesktop"'
+]
+
+gio_unix_dep = dependency ('gio-unix-2.0')
+
+dependencies = [
+ gnome_games_dep,
+ gio_unix_dep,
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources + desktop_resources,
+ dependencies: dependencies,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/dreamcast/data/meson.build b/plugins/dreamcast/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/dreamcast/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/dreamcast/meson.build b/plugins/dreamcast/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/dreamcast/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/dreamcast/src/meson.build b/plugins/dreamcast/src/meson.build
new file mode 100644
index 0000000..c3e9d2e
--- /dev/null
+++ b/plugins/dreamcast/src/meson.build
@@ -0,0 +1,18 @@
+vala_sources = [
+ 'dreamcast-header.vala',
+ 'dreamcast-plugin.vala',
+ 'dreamcast-uid.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesDreamcast"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/game-cube/data/meson.build b/plugins/game-cube/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/game-cube/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/game-cube/meson.build b/plugins/game-cube/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/game-cube/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/game-cube/src/meson.build b/plugins/game-cube/src/meson.build
new file mode 100644
index 0000000..b88ad44
--- /dev/null
+++ b/plugins/game-cube/src/meson.build
@@ -0,0 +1,18 @@
+vala_sources = [
+ 'game-cube-header.vala',
+ 'game-cube-plugin.vala',
+ 'game-cube-uid.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesGameCube"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/libretro/data/meson.build b/plugins/libretro/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/libretro/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/libretro/meson.build b/plugins/libretro/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/libretro/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/libretro/src/meson.build b/plugins/libretro/src/meson.build
new file mode 100644
index 0000000..e8569b9
--- /dev/null
+++ b/plugins/libretro/src/meson.build
@@ -0,0 +1,22 @@
+vala_sources = [
+ 'libretro-error.vala',
+ 'libretro-icon.vala',
+ 'libretro-plugin.vala',
+ 'libretro-title.vala',
+ 'libretro-uid.vala',
+ 'libretro-uri-iterator.vala',
+ 'libretro-uri-source.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesLibretro"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/love/data/meson.build b/plugins/love/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/love/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/love/meson.build b/plugins/love/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/love/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/love/src/meson.build b/plugins/love/src/meson.build
new file mode 100644
index 0000000..55d8cfb
--- /dev/null
+++ b/plugins/love/src/meson.build
@@ -0,0 +1,27 @@
+vala_sources = [
+ 'love-error.vala',
+ 'love-icon.vala',
+ 'love-package.vala',
+ 'love-plugin.vala',
+ 'love-title.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesLOVE"'
+]
+
+libarchive_dep = dependency ('libarchive')
+
+dependencies = [
+ gnome_games_dep,
+ libarchive_dep,
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: dependencies,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/mame/data/meson.build b/plugins/mame/data/meson.build
new file mode 100644
index 0000000..0be96ae
--- /dev/null
+++ b/plugins/mame/data/meson.build
@@ -0,0 +1,7 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
+
+mame_resources = gnome.compile_resources (
+ 'mame',
+ 'mame.gresource.xml',
+ c_name: 'resources'
+)
diff --git a/plugins/mame/meson.build b/plugins/mame/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/mame/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/mame/src/meson.build b/plugins/mame/src/meson.build
new file mode 100644
index 0000000..17f1269
--- /dev/null
+++ b/plugins/mame/src/meson.build
@@ -0,0 +1,19 @@
+vala_sources = [
+ 'mame-error.vala',
+ 'mame-game-info.vala',
+ 'mame-game-uri-adapter.vala',
+ 'mame-plugin.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesMAME"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources + mame_resources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/meson.build b/plugins/meson.build
new file mode 100644
index 0000000..53265cf
--- /dev/null
+++ b/plugins/meson.build
@@ -0,0 +1,22 @@
+plugins = [
+ 'desktop',
+ 'dreamcast',
+ 'game-cube',
+ 'libretro',
+ 'love',
+ 'mame',
+ 'nintendo-ds',
+ 'playstation',
+ 'sega-cd',
+ 'sega-saturn',
+ 'steam',
+ 'turbografx-cd',
+ 'virtual-boy',
+ 'wii',
+]
+
+foreach plugin_name : plugins
+ if get_option (plugin_name +'-plugin')
+ subdir (plugin_name)
+ endif
+endforeach
diff --git a/plugins/nintendo-ds/data/meson.build b/plugins/nintendo-ds/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/nintendo-ds/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/nintendo-ds/meson.build b/plugins/nintendo-ds/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/nintendo-ds/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/nintendo-ds/src/meson.build b/plugins/nintendo-ds/src/meson.build
new file mode 100644
index 0000000..0313ac9
--- /dev/null
+++ b/plugins/nintendo-ds/src/meson.build
@@ -0,0 +1,21 @@
+vala_sources = [
+ 'nintendo-ds-icon.vala',
+ 'nintendo-ds-plugin.vala',
+]
+
+c_sources = [
+ 'nintendo-ds-icon-extract.c',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesNintendoDS"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources + c_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/playstation/data/meson.build b/plugins/playstation/data/meson.build
new file mode 100644
index 0000000..ebd9887
--- /dev/null
+++ b/plugins/playstation/data/meson.build
@@ -0,0 +1,19 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
+
+sed = find_program ('sed')
+
+# TODO Game titles in the gameinfo file are meant to be localized
+gameinfo = custom_target (
+ 'playstation.gameinfo',
+ output: 'playstation.gameinfo.xml',
+ input: 'playstation.gameinfo.xml.in',
+ command: [sed, '-e', 's|<_title>|<title>|g;s|</_title>|</title>|g', '@INPUT@'],
+ capture: true
+)
+
+playstation_resources = gnome.compile_resources (
+ 'org.gnome.Games.plugin.playstation',
+ 'org.gnome.Games.plugin.playstation.gresource.xml',
+ c_name: 'resources',
+ dependencies: gameinfo
+)
diff --git a/plugins/playstation/meson.build b/plugins/playstation/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/playstation/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/playstation/src/meson.build b/plugins/playstation/src/meson.build
new file mode 100644
index 0000000..1871682
--- /dev/null
+++ b/plugins/playstation/src/meson.build
@@ -0,0 +1,27 @@
+vala_sources = [
+ 'playstation-error.vala',
+ 'playstation-game-factory.vala',
+ 'playstation-header.vala',
+ 'playstation-plugin.vala',
+ 'playstation-uid.vala',
+]
+
+c_sources = [
+ 'disc-file-info.c',
+ 'disc-image.c',
+ 'disc-image-time.c',
+ 'playstation-disc-image.c',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesPlayStation"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources + c_sources + playstation_resources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/sega-cd/data/meson.build b/plugins/sega-cd/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/sega-cd/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/sega-cd/meson.build b/plugins/sega-cd/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/sega-cd/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/sega-cd/src/meson.build b/plugins/sega-cd/src/meson.build
new file mode 100644
index 0000000..4ce8102
--- /dev/null
+++ b/plugins/sega-cd/src/meson.build
@@ -0,0 +1,18 @@
+vala_sources = [
+ 'sega-cd-header.vala',
+ 'sega-cd-plugin.vala',
+ 'sega-cd-system.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesSegaCD"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/sega-saturn/data/meson.build b/plugins/sega-saturn/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/sega-saturn/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/sega-saturn/meson.build b/plugins/sega-saturn/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/sega-saturn/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/sega-saturn/src/meson.build b/plugins/sega-saturn/src/meson.build
new file mode 100644
index 0000000..5bb3efa
--- /dev/null
+++ b/plugins/sega-saturn/src/meson.build
@@ -0,0 +1,19 @@
+vala_sources = [
+ 'sega-saturn-error.vala',
+ 'sega-saturn-header.vala',
+ 'sega-saturn-plugin.vala',
+ 'sega-saturn-uid.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesSegaSaturn"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/steam/data/meson.build b/plugins/steam/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/steam/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/steam/meson.build b/plugins/steam/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/steam/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/steam/src/meson.build b/plugins/steam/src/meson.build
new file mode 100644
index 0000000..2dd2f0c
--- /dev/null
+++ b/plugins/steam/src/meson.build
@@ -0,0 +1,23 @@
+vala_sources = [
+ 'steam-cover.vala',
+ 'steam-error.vala',
+ 'steam-icon.vala',
+ 'steam-plugin.vala',
+ 'steam-registry.vala',
+ 'steam-title.vala',
+ 'steam-uri-iterator.vala',
+ 'steam-uri-source.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesSteam"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/turbografx-cd/data/meson.build b/plugins/turbografx-cd/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/turbografx-cd/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/turbografx-cd/meson.build b/plugins/turbografx-cd/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/turbografx-cd/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/turbografx-cd/src/meson.build b/plugins/turbografx-cd/src/meson.build
new file mode 100644
index 0000000..7cb6ca1
--- /dev/null
+++ b/plugins/turbografx-cd/src/meson.build
@@ -0,0 +1,17 @@
+vala_sources = [
+ 'turbografx-cd-error.vala',
+ 'turbografx-cd-plugin.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesTurboGrafxCD"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/virtual-boy/data/meson.build b/plugins/virtual-boy/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/virtual-boy/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/virtual-boy/meson.build b/plugins/virtual-boy/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/virtual-boy/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/virtual-boy/src/meson.build b/plugins/virtual-boy/src/meson.build
new file mode 100644
index 0000000..d72f275
--- /dev/null
+++ b/plugins/virtual-boy/src/meson.build
@@ -0,0 +1,17 @@
+vala_sources = [
+ 'virtual-boy-header.vala',
+ 'virtual-boy-plugin.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesVirtualBoy"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/plugins/wii/data/meson.build b/plugins/wii/data/meson.build
new file mode 100644
index 0000000..0d4b6c4
--- /dev/null
+++ b/plugins/wii/data/meson.build
@@ -0,0 +1 @@
+install_data (plugin_name + '.plugin', install_dir: plugins_dir)
diff --git a/plugins/wii/meson.build b/plugins/wii/meson.build
new file mode 100644
index 0000000..d7e8490
--- /dev/null
+++ b/plugins/wii/meson.build
@@ -0,0 +1,2 @@
+subdir ('data')
+subdir ('src')
diff --git a/plugins/wii/src/meson.build b/plugins/wii/src/meson.build
new file mode 100644
index 0000000..ebaa6ce
--- /dev/null
+++ b/plugins/wii/src/meson.build
@@ -0,0 +1,18 @@
+vala_sources = [
+ 'wii-header.vala',
+ 'wii-plugin.vala',
+ 'wii-uid.vala',
+]
+
+c_args = [
+ '-DG_LOG_DOMAIN="GamesWii"'
+]
+
+shared_module (
+ 'games-' + plugin_name + '-plugin',
+ vala_sources,
+ dependencies: gnome_games_dep,
+ c_args: c_args,
+ install: true,
+ install_dir: plugins_dir
+)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..b2e9e42
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext (meson.project_name (), preset: 'glib')
diff --git a/src/config.vapi b/src/config.vapi
new file mode 100644
index 0000000..275a7b3
--- /dev/null
+++ b/src/config.vapi
@@ -0,0 +1,8 @@
+[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
+namespace Config {
+ public const string GETTEXT_PACKAGE;
+ public const string GNOMELOCALEDIR;
+ public const string OPTIONS_DIR;
+ public const string PLUGINS_DIR;
+ public const string VERSION;
+}
diff --git a/src/core/plugin-register-iterator.vala b/src/core/plugin-register-iterator.vala
index 5448336..3cc1f14 100644
--- a/src/core/plugin-register-iterator.vala
+++ b/src/core/plugin-register-iterator.vala
@@ -16,7 +16,7 @@ private class Games.PluginRegisterIterator {
public bool next () {
try {
- var directory = File.new_for_path (PLUGINS_DIR);
+ var directory = File.new_for_path (Config.PLUGINS_DIR);
if (enumerator == null) {
enumerator = directory.enumerate_children (FileAttribute.STANDARD_NAME, 0);
}
diff --git a/src/core/plugin-registrar.vala b/src/core/plugin-registrar.vala
index cf82b9c..8c4f97c 100644
--- a/src/core/plugin-registrar.vala
+++ b/src/core/plugin-registrar.vala
@@ -19,7 +19,7 @@ private class Games.PluginRegistrar : TypeModule {
var keyfile = new KeyFile ();
keyfile.load_from_file (plugin_filename, KeyFileFlags.NONE);
var module_name = keyfile.get_string ("Plugin", "Module");
- module_path = Module.build_path (PLUGINS_DIR, module_name);
+ module_path = Module.build_path (Config.PLUGINS_DIR, module_name);
name = keyfile.get_string ("Plugin", "Name");
description = keyfile.get_string ("Plugin", "Description");
}
diff --git a/src/main.vala b/src/main.vala
index bb7d78c..accb61f 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -1,12 +1,9 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-private extern const string GETTEXT_PACKAGE;
-private extern const string GNOMELOCALEDIR;
-
int main (string[] args) {
- Intl.bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- Intl.textdomain (GETTEXT_PACKAGE);
+ Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.GNOMELOCALEDIR);
+ Intl.bind_textdomain_codeset (Config.GETTEXT_PACKAGE, "UTF-8");
+ Intl.textdomain (Config.GETTEXT_PACKAGE);
Grl.init (ref args);
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..535b387
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,192 @@
+vapi_dir = join_paths (datadir, 'vala', 'vapi')
+gamepad_dir = join_paths (srcdir, 'gamepad')
+
+vala_args = [
+ '--vapidir', vapi_dir,
+]
+
+c_args = [
+ '-I' + gamepad_dir,
+ '-DG_LOG_DOMAIN="Games"',
+]
+
+vala_sources = [
+ 'command/command-error.vala',
+ 'command/command-runner.vala',
+
+ 'core/cover.vala',
+ 'core/game.vala',
+ 'core/game-callback.vala',
+ 'core/game-collection.vala',
+ 'core/game-uri-adapter.vala',
+ 'core/icon.vala',
+ 'core/input-capabilities.vala',
+ 'core/media.vala',
+ 'core/media-info.vala',
+ 'core/media-set/media-set.vala',
+ 'core/media-set/media-set-error.vala',
+ 'core/plugin.vala',
+ 'core/plugin-register.vala',
+ 'core/plugin-register-iterator.vala',
+ 'core/plugin-registrar.vala',
+ 'core/runner.vala',
+ 'core/title.vala',
+ 'core/uid.vala',
+ 'core/uri-game-factory.vala',
+ 'core/uri-iterator.vala',
+ 'core/uri-source.vala',
+
+ 'database/database.vala',
+ 'database/database-error.vala',
+ 'database/database-uri-iterator.vala',
+ 'database/database-uri-source.vala',
+
+ 'dummy/dummy-cover.vala',
+ 'dummy/dummy-game.vala',
+ 'dummy/dummy-icon.vala',
+ 'dummy/dummy-runner.vala',
+
+ 'gameinfo/gameinfo-doc.vala',
+ 'gameinfo/gameinfo-error.vala',
+ 'gameinfo/gameinfo-disc-id-disc-title.vala',
+ 'gameinfo/gameinfo-disc-id-game-title.vala',
+ 'gameinfo/gameinfo-disc-id-input-capabilities.vala',
+
+ 'gamepad/gamepad-dpad.vala',
+ 'gamepad/gamepad-input.vala',
+ 'gamepad/gamepad-mapping-builder.vala',
+
+ 'generic/generic-game.vala',
+ 'generic/generic-game-uri-adapter.vala',
+ 'generic/generic-title.vala',
+ 'generic/generic-uid.vala',
+ 'generic/generic-uri-game-factory.vala',
+
+ 'grilo/grilo-cover.vala',
+ 'grilo/grilo-media.vala',
+
+ 'keyboard/keyboard-mapping-builder.vala',
+ 'keyboard/keyboard-mapping-manager.vala',
+
+ 'retro/retro-core-source.vala',
+ 'retro/retro-error.vala',
+ 'retro/retro-gamepad.vala',
+ 'retro/retro-input-manager.vala',
+ 'retro/retro-options.vala',
+ 'retro/retro-platform.vala',
+ 'retro/retro-runner.vala',
+ 'retro/retro-simple-game-uri-adapter.vala',
+ 'retro/retro-simple-type.vala',
+ 'retro/retro-simple-types.vala',
+
+ 'tracker/mime-type-tracker-uri-query.vala',
+ 'tracker/tracker-error.vala',
+ 'tracker/tracker-uri-iterator.vala',
+ 'tracker/tracker-uri-query.vala',
+ 'tracker/tracker-uri-source.vala',
+
+ 'ui/application.vala',
+ 'ui/application-window.vala',
+ 'ui/checkmark-item.vala',
+ 'ui/collection-box.vala',
+ 'ui/collection-icon-view.vala',
+ 'ui/collection-header-bar.vala',
+ 'ui/display-box.vala',
+ 'ui/display-header-bar.vala',
+ 'ui/dummy-display.vala',
+ 'ui/empty-collection.vala',
+ 'ui/error-display.vala',
+ 'ui/error-info-bar.vala',
+ 'ui/gamepad-configurer.vala',
+ 'ui/gamepad-mapper.vala',
+ 'ui/gamepad-tester.vala',
+ 'ui/gamepad-view.vala',
+ 'ui/game-icon-view.vala',
+ 'ui/game-thumbnail.vala',
+ 'ui/gamepad-view-configuration.vala',
+ 'ui/keyboard-configurer.vala',
+ 'ui/keyboard-mapper.vala',
+ 'ui/keyboard-tester.vala',
+ 'ui/konami-code.vala',
+ 'ui/media-selector.vala',
+ 'ui/media-menu-button.vala',
+ 'ui/preferences-page.vala',
+ 'ui/preferences-page-controllers.vala',
+ 'ui/preferences-page-plugins.vala',
+ 'ui/preferences-page-plugins-item.vala',
+ 'ui/preferences-page-video.vala',
+ 'ui/preferences-window.vala',
+ 'ui/quit-dialog.vala',
+ 'ui/remote-display.vala',
+ 'ui/reset-controller-mapping-dialog.vala',
+ 'ui/resume-dialog.vala',
+ 'ui/resume-failed-dialog.vala',
+ 'ui/search-bar.vala',
+ 'ui/shortcuts-window.vala',
+ 'ui/ui-state.vala',
+
+ 'utils/composite-cover.vala',
+ 'utils/composite-title.vala',
+ 'utils/cue-sheet/cue-sheet.vala',
+ 'utils/cue-sheet/cue-sheet-error.vala',
+ 'utils/cue-sheet/cue-sheet-file-format.vala',
+ 'utils/cue-sheet/cue-sheet-file-node.vala',
+ 'utils/cue-sheet/cue-sheet-track-mode.vala',
+ 'utils/cue-sheet/cue-sheet-track-node.vala',
+ 'utils/directory.vala',
+ 'utils/filename-title.vala',
+ 'utils/fingerprint.vala',
+ 'utils/grep.vala',
+ 'utils/local-cover.vala',
+ 'utils/string-input-stream.vala',
+ 'utils/unicode.vala',
+ 'utils/uri.vala',
+ 'utils/uri-error.vala',
+ 'utils/xml-doc.vala',
+
+ 'credits.vala',
+ 'main.vala',
+]
+
+dependencies = [
+ config_dep,
+ gio_dep,
+ glib_dep,
+ grilo_dep,
+ gtk_dep,
+ manette_dep,
+ retro_gtk_dep,
+ rsvg_dep,
+ soup_dep,
+ sqlite_dep,
+ tracker_sparql_dep,
+ xml_dep,
+ valac.find_library ('linux'),
+ valac.find_library ('posix'),
+ valac.find_library ('event-codes', dirs: gamepad_dir),
+]
+
+gnome_games_exec = executable (
+ 'gnome-games',
+ vala_sources + resources,
+ dependencies: dependencies,
+ vala_args: vala_args,
+ c_args: c_args,
+ include_directories: confinc,
+ export_dynamic: true,
+ install: true
+)
+
+plugin_dependencies = [
+ gio_dep,
+ glib_dep,
+ gtk_dep,
+ retro_gtk_dep,
+ tracker_sparql_dep,
+]
+
+gnome_games_dep = declare_dependency (
+ dependencies: plugin_dependencies,
+ link_with: gnome_games_exec,
+ include_directories: srcinc
+)
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 14ab325..a868077 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -377,7 +377,7 @@ public class Games.RetroRunner : Object, Runner {
var options_name = basename.split (".")[0];
options_name = options_name.replace ("_libretro", "");
- return @"$OPTIONS_DIR/$options_name.options";
+ return @"$(Config.OPTIONS_DIR)/$options_name.options";
}
private string get_save_directory_path () throws Error {
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 8f47808..3887d95 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -1,7 +1,5 @@
// This file is part of GNOME Games. License: GPL-3.0+.
-private extern const string VERSION;
-
public class Games.Application : Gtk.Application {
const string HELP_URI = "https://wiki.gnome.org/Apps/Games/Documentation";
@@ -356,7 +354,7 @@ public class Games.Application : Gtk.Application {
dialog.program_name = _("GNOME Games");
dialog.logo_icon_name = "org.gnome.Games";
dialog.comments = _("A video game player for GNOME");
- dialog.version = VERSION;
+ dialog.version = Config.VERSION;
dialog.website = "https://wiki.gnome.org/Apps/Games";
dialog.website_label = _("Learn more about GNOME Games");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]