From a28a6399cb4c7361bd85b8f99cfa5a742681eb25 Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Tue, 18 Dec 2018 15:49:53 -0600 Subject: [PATCH] GTK+: Add appdatadir to meson build for Snes9x-only files. --- gtk/data/meson.build | 3 +-- gtk/meson.build | 14 +++++++++----- gtk/meson_options.txt | 1 + 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gtk/data/meson.build b/gtk/data/meson.build index 40ff25b6..54727456 100644 --- a/gtk/data/meson.build +++ b/gtk/data/meson.build @@ -1,5 +1,4 @@ -datadir = join_paths(get_option('prefix'), get_option('datadir')) -install_data('../../data/cheats.bml') +install_data('../../data/cheats.bml', install_dir: appdatadir) install_data('snes9x.desktop', install_dir: join_paths(datadir, 'applications')) hicolor = join_paths(datadir, 'icons', 'hicolor') diff --git a/gtk/meson.build b/gtk/meson.build index 7c687fd0..43090642 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -5,9 +5,6 @@ project('snes9x-gtk', 'buildtype=release', 'strip=true']) -subdir('po') -subdir('data') - args = [ '-DSNES9X_GTK', '-DUNZIP_SUPPORT', '-DNETPLAY_SUPPORT', '-DJMA_SUPPORT', '-Wall', '-W', '-Wno-unused-parameter' ] srcs = [] deps = [] @@ -15,8 +12,15 @@ includes = [ '../apu/bapu', '../', 'src' ] prefix = get_option('prefix') localedir = join_paths(prefix, get_option('localedir')) -datadir = join_paths(prefix, get_option('datadir'), 'snes9x') -args += [ '-DDATADIR="' + datadir + '"', '-DSNES9XLOCALEDIR="' + localedir + '"' ] +datadir = get_option('datadir') +appdatadir = get_option ('appdatadir') +if appdatadir == '' + appdatadir = join_paths(prefix, datadir, 'snes9x') +endif +args += [ '-DDATADIR="' + appdatadir + '"', '-DSNES9XLOCALEDIR="' + localedir + '"' ] + +subdir('data') +subdir('po') glib_dep = dependency('glib-2.0', version: '> 2.28') gthread_dep = dependency('gthread-2.0', version: '>= 2.6') diff --git a/gtk/meson_options.txt b/gtk/meson_options.txt index f3eaffba..9ee2f08c 100644 --- a/gtk/meson_options.txt +++ b/gtk/meson_options.txt @@ -14,3 +14,4 @@ option('gtk3', type: 'boolean', value: true, description: 'Build wit option('wayland', type: 'boolean', value: true, description: 'Build support for Wayland') option('gtk2', type: 'boolean', value: false, description: 'Build with GTK+ 2.0 as the toolkit') option('dangerous-hacks', type: 'boolean', value: false, description: 'Allow dangerous hacks to be enabled') +option('appdatadir', type: 'string' , value: '', description: 'Snes9x-only data directory')