From 18e46969b74e0ef6d86ccd81effdb22056fe1b18 Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 6 Aug 2020 19:30:19 +0400 Subject: [PATCH] Workaround for configure_file(copy:true) The `copy` keyword argument of `configure_file()` first appears in meson 0.47. Now performing file copy via python. --- test/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/meson.build b/test/meson.build index 10f01c4e3..e203bc74d 100644 --- a/test/meson.build +++ b/test/meson.build @@ -28,9 +28,25 @@ if gtest_dep.found() and not meson.is_cross_build() 'corner_cases.zim' ] foreach file : data_files + # configure_file(input : 'data/' + file, + # output : file, + # copy: true ) + # + # Above (commented) command doesn't work with Meson versions below 0.47 + # (in which the 'copy' keyword was first introduced). We want to keep + # compatibility with Ubuntu 18.04 Bionic (which has Meson version 0.45) + # until its EOL. + # + # Below is a python based workaround. configure_file(input : 'data/' + file, output : file, - copy: true ) + command: [ + find_program('python3'), + '-c', + 'import sys; import shutil; shutil.copy(sys.argv[1], sys.argv[2])', + '@INPUT@', + '@OUTPUT@' + ]) endforeach foreach test_name : tests