gio: Add dtdsdir pointing to the directory of gresource.xml

This allows third party projects to look up the location of installed
DTDs without having to hard-code it.
This commit is contained in:
JCWasmx86
2023-08-16 18:58:48 +02:00
committed by Philip Withnall
parent f10bb13314
commit 0b4a9db4a7

View File

@@ -863,6 +863,7 @@ else
endif endif
schemas_subdir = join_paths('glib-2.0', 'schemas') schemas_subdir = join_paths('glib-2.0', 'schemas')
dtds_subdir = join_paths('glib-2.0', 'dtds')
libgio_dep = declare_dependency(link_with : libgio, libgio_dep = declare_dependency(link_with : libgio,
dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep],
@@ -870,6 +871,7 @@ libgio_dep = declare_dependency(link_with : libgio,
variables : [ variables : [
'schemasdir=' + join_paths(glib_datadir, schemas_subdir), 'schemasdir=' + join_paths(glib_datadir, schemas_subdir),
'giomoduledir=' + glib_giomodulesdir, 'giomoduledir=' + glib_giomodulesdir,
'dtdsdir=' + join_paths(glib_datadir, dtds_subdir)
], ],
) )
@@ -878,6 +880,7 @@ pkg.generate(libgio,
variables : [ variables : [
'datadir=' + '${prefix}' / get_option('datadir'), 'datadir=' + '${prefix}' / get_option('datadir'),
'schemasdir=' + '${datadir}' / schemas_subdir, 'schemasdir=' + '${datadir}' / schemas_subdir,
'dtdsdir=' + '${datadir}' / dtds_subdir,
'bindir=' + '${prefix}' / get_option('bindir'), 'bindir=' + '${prefix}' / get_option('bindir'),
'giomoduledir=' + pkgconfig_giomodulesdir, 'giomoduledir=' + pkgconfig_giomodulesdir,
'gio=' + '${bindir}' / 'gio', 'gio=' + '${bindir}' / 'gio',
@@ -1021,7 +1024,7 @@ glib_compile_resources = executable('glib-compile-resources',
link_args : noseh_link_args, link_args : noseh_link_args,
dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep, gvdb_dep]) dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep, gvdb_dep])
install_data('gresource.dtd', install_data('gresource.dtd',
install_dir: get_option('datadir') / 'glib-2.0/dtds', install_dir: get_option('datadir') / dtds_subdir,
install_tag: 'devel', install_tag: 'devel',
) )