build: Use fs.copyfile() instead of configure_file()

Because Meson complains about using `configure_file(copy: true)`.

Includes improvements by Xavier Claessens.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-11-16 15:52:09 +00:00
parent 7e3e591d43
commit 19353017a7
5 changed files with 25 additions and 24 deletions

View File

@ -155,11 +155,7 @@ if get_option('gtk_doc')
command : [concat_files_helper, '@OUTPUT@', '@INPUT@'],
)
configure_file(
output : 'gio-docs-platform.xml',
input : platform_file,
copy : true,
)
fs.copyfile(platform_file, 'gio-docs-platform.xml')
content_files = [
'overview.xml',

View File

@ -28,18 +28,17 @@ meson.override_find_program('gdbus-codegen', gdbus_codegen)
codegen_dir = join_paths(glib_datadir, 'glib-2.0', 'codegen')
gdbus_codegen_built_files = []
gdbus_codegen_built_files += configure_file(input : 'config.py.in',
gdbus_codegen_depend_files = configure_file(input : 'config.py.in',
output : 'config.py',
install_dir : codegen_dir,
install_tag : 'bin-devel',
configuration : gdbus_codegen_conf)
gdbus_codegen_depends = []
foreach f : gdbus_codegen_files
# Copy these into the builddir so that gdbus-codegen can be used uninstalled
# and then install it too so that it can be used after installation
gdbus_codegen_built_files += configure_file(input : f, output : f,
gdbus_codegen_depends += fs.copyfile(f,
install_dir : codegen_dir,
install_tag : 'bin-devel',
copy : true)
install_tag : 'bin-devel')
endforeach

View File

@ -240,7 +240,8 @@ xdp_dbus_generated = custom_target('xdp-dbus',
'org.freedesktop.portal.ProxyResolver.xml',
'org.freedesktop.portal.Trash.xml'],
output : ['xdp-dbus.h', 'xdp-dbus.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-prefix', 'org.freedesktop.portal.',
'--output-directory', '@OUTDIR@',
@ -252,7 +253,8 @@ xdp_dbus_generated = custom_target('xdp-dbus',
gdbus_daemon_generated = custom_target('gdbus-daemon-generated',
input : ['dbus-daemon.xml'],
output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-prefix', 'org.',
'--output-directory', '@OUTDIR@',

View File

@ -308,7 +308,8 @@ if host_machine.system() != 'windows'
input : ['test-codegen.xml'],
output : ['gdbus-test-codegen-generated.h',
'gdbus-test-codegen-generated.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-prefix', 'org.project.',
'--output-directory', '@OUTDIR@',
@ -324,7 +325,8 @@ if host_machine.system() != 'windows'
input : ['test-codegen.xml'],
output : ['gdbus-test-codegen-generated-min-required-2-64.h',
'gdbus-test-codegen-generated-min-required-2-64.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--glib-min-required', '2.64',
'--interface-prefix', 'org.project.',
@ -340,7 +342,8 @@ if host_machine.system() != 'windows'
custom_target('gdbus-test-codegen-generated-interface-info-h',
input : ['test-codegen.xml'],
output : ['gdbus-test-codegen-generated-interface-info.h'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-info-header',
annotate_args,
@ -349,7 +352,8 @@ if host_machine.system() != 'windows'
custom_target('gdbus-test-codegen-generated-interface-info-c',
input : ['test-codegen.xml'],
output : ['gdbus-test-codegen-generated-interface-info.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-info-body',
annotate_args,
@ -457,7 +461,8 @@ if host_machine.system() != 'windows'
input : ['../org.freedesktop.portal.Documents.xml'],
output : ['fake-document-portal-generated.h',
'fake-document-portal-generated.c'],
depend_files : gdbus_codegen_built_files,
depends : gdbus_codegen_depends,
depend_files : gdbus_codegen_depend_files,
command : [python, gdbus_codegen,
'--interface-prefix', 'org.freedesktop.portal.',
'--output-directory', '@OUTDIR@',
@ -737,6 +742,9 @@ if not meson.is_cross_build()
output : ['gresource-big-test.txt'],
command : [python, '@INPUT0@', '@OUTPUT@'])
# referenced by test.gresource.xml
test_generated_txt = fs.copyfile('test1.txt', 'test-generated.txt')
test_gresource = custom_target('test.gresource',
input : 'test.gresource.xml',
output : 'test.gresource',
@ -747,6 +755,7 @@ if not meson.is_cross_build()
'--sourcedir=' + meson.current_build_dir(),
'--internal',
'@INPUT@'],
depends: test_generated_txt,
install_dir : installed_tests_execdir,
install_tag : 'tests',
install : installed_tests_enabled)
@ -816,12 +825,6 @@ if not meson.is_cross_build()
'--manual-register',
'@INPUT@'])
# referenced by test.gresource.xml
test_generated_txt = configure_file(input : 'test1.txt',
output : 'test-generated.txt',
copy : true,
)
resources_extra_sources = [
test_gresource,
test_resources_c,

View File

@ -2349,6 +2349,7 @@ if want_systemtap and enable_dtrace
enable_systemtap = true
endif
fs = import('fs')
pkg = import('pkgconfig')
windows = import('windows')
subdir('tools')