summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2018-07-11 14:16:41 +0000
committerPatrick Griffis <tingping@tingping.se>2018-07-11 14:16:41 +0000
commit1de523dc54a5914f23f1e2540392cd14f91c06aa (patch)
tree553c6068b0a428e1dd43450c1e8bc22347bb6d1b
parent067965edffdb7814abcd8d7ab9a6d9d73f771e62 (diff)
downloadepiphany-1de523dc54a5914f23f1e2540392cd14f91c06aa.tar.gz
build: Slight cleanup of mkenums usage
-rw-r--r--data/meson.build44
1 files changed, 15 insertions, 29 deletions
diff --git a/data/meson.build b/data/meson.build
index 492890e56..5c3a9d641 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -19,44 +19,30 @@ i18n.merge_file('appdata-file',
po_dir: '../po'
)
-# We need three custom_target() calls because Meson doesn't have very
-# good support for GSettings yet. First, generate our GSettings enums
-# in the build directory. Then, copy the gschema into the build
-# directory to ensure it is in the same place as the enums file. Then
-# we can run glib-compile-schemas on it. We have to compile schemas in
-# the build directory to ensure that our tests don't fail if run on a
-# system where epiphany is not already installed. epiphany will also
-# look for schemas here if built in developer mode.
-#
-# https://github.com/mesonbuild/meson/issues/1687
-generate_enums = custom_target('gsettings-enums',
- input: '../lib/ephy-prefs.h',
- output: 'org.gnome.Epiphany.enums.xml',
- install: true,
+generate_enums = gnome.mkenums('org.gnome.Epiphany.enums.xml',
+ sources: '../lib/ephy-prefs.h',
+ comments: '<!-- @comment@ -->',
+ fhead: '<schemalist>',
+ vhead: ' <@type@ id="org.gnome.Epiphany.@EnumName@">',
+ vprod: ' <value nick="@valuenick@" value="@valuenum@"/>',
+ vtail: ' </@type@>',
+ ftail: '</schemalist>',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas'),
- capture: true,
- command: [find_program('glib-mkenums'),
- '--comments', '<!-- @comment@ -->',
- '--fhead', '<schemalist>',
- '--vhead', ' <@type@ id="org.gnome.Epiphany.@EnumName@">',
- '--vprod', ' <value nick="@valuenick@" value="@valuenum@"/>',
- '--vtail', ' </@type@>',
- '--ftail', '</schemalist>',
- '@INPUT@'
- ]
)
-copy_gschema = custom_target('copy-gschema-to-builddir',
+# Copy file from source into build for glib-compile-schemas
+# https://github.com/mesonbuild/meson/issues/2219
+# gnome.compile_schemas() also needs a dependencies arg
+configure_file(
input: 'org.gnome.epiphany.gschema.xml',
- output: 'renamed-hack.gschema.xml',
- command: ['cp', '@INPUT@', '@OUTPUT@']
+ output: 'org.gnome.epiphany.gschema.xml',
+ configuration: configuration_data()
)
compile_schemas = custom_target('glib-compile-schemas',
output: 'gschemas.compiled',
- install: false,
command: [find_program('glib-compile-schemas'),
meson.current_build_dir()
],
- depends: [generate_enums, copy_gschema]
+ depends: [generate_enums]
)
install_data('org.gnome.epiphany.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')