summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2018-07-14 12:34:31 -0500
committerMichael Catanzaro <mcatanzaro@igalia.com>2018-07-14 12:35:36 -0500
commit4e66fbc9404a75ff0a8a8a00ddbf8e9b5b6cd1e9 (patch)
treea88eb4273d9d7ca3fa6461ada5feb02fb92b6247
parent109680d33482ffcb098957c47dc7c90f54f3e238 (diff)
downloadepiphany-4e66fbc9404a75ff0a8a8a00ddbf8e9b5b6cd1e9.tar.gz
Revert recent mkenums changes
This fixes #64. See the discussion in !18.
-rw-r--r--data/meson.build44
1 files changed, 29 insertions, 15 deletions
diff --git a/data/meson.build b/data/meson.build
index 5202ec786..492890e56 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -19,30 +19,44 @@ i18n.merge_file('appdata-file',
po_dir: '../po'
)
-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>',
+# 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,
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 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(
+copy_gschema = custom_target('copy-gschema-to-builddir',
input: 'org.gnome.epiphany.gschema.xml',
- output: 'org.gnome.epiphany.gschema.xml',
- configuration: configuration_data()
+ output: 'renamed-hack.gschema.xml',
+ command: ['cp', '@INPUT@', '@OUTPUT@']
)
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
+ depends: [generate_enums, copy_gschema]
)
install_data('org.gnome.epiphany.gschema.xml',
install_dir: join_paths(datadir, 'glib-2.0', 'schemas')