From faa14f5f3cf49cc8e390f01d06702f44320236ff Mon Sep 17 00:00:00 2001 From: Fred Morcos Date: Wed, 30 Aug 2023 23:29:20 +0200 Subject: [PATCH] Meson: Separate python for apidocfiles and the BIND DNSSEC schema --- meson.build | 1 - meson/python/meson.build | 10 --------- pdns/meson.build | 44 ++++++++++++++++++++++++++-------------- 3 files changed, 29 insertions(+), 26 deletions(-) delete mode 100644 meson/python/meson.build diff --git a/meson.build b/meson.build index 7f04c9136b..80f926c65a 100644 --- a/meson.build +++ b/meson.build @@ -64,7 +64,6 @@ subdir('meson' / 'unit-tests') # Unit Tests subdir('meson' / 'auth-backend-unit-tests') # Auth Backend Unit Tests subdir('meson' / 'reproducible') # Reproducible Builds subdir('meson' / 'fuzz-targets') # Fuzzing Targets -subdir('meson' / 'python') # Python subdir('meson' / 'dlopen') # dlopen subdir('meson' / 'verbose-logging') # Verbose Logging subdir('meson' / 'pkcs11') # PKCS11 diff --git a/meson/python/meson.build b/meson/python/meson.build deleted file mode 100644 index ae1f72aa24..0000000000 --- a/meson/python/meson.build +++ /dev/null @@ -1,10 +0,0 @@ -py = import('python') -python_prog = py.find_installation( - 'python3', - modules: from_git ? ['yaml'] : [], - required: from_git, -) - -summary('Python', python_prog.found(), bool_yn: true, section: 'Python') -summary('Path', python_prog.full_path(), section: 'Python') -summary('Version', python_prog.version(), section: 'Python') diff --git a/pdns/meson.build b/pdns/meson.build index 2e9213c144..5633f6b464 100644 --- a/pdns/meson.build +++ b/pdns/meson.build @@ -305,12 +305,19 @@ libpdns = declare_dependency( ) ) -libpdns_auth_api_swagger = 'apidocfiles.h' -if not fs.is_file('apidocfiles.h') - libpdns_auth_api_swagger = custom_target( - 'pdns-auth-api-swagger', +libpdns_auth_apidocfiles_h = 'apidocfiles.h' +if not fs.is_file(libpdns_auth_apidocfiles_h) + py = import('python') + python = py.find_installation('python3', modules: 'yaml', required: true) + + summary('Python', python.found(), bool_yn: true, section: 'Swagger API') + summary('Path', python.full_path(), section: 'Swagger API') + summary('Version', python.version(), section: 'Swagger API') + + libpdns_auth_apidocfiles_h = custom_target( + 'pdns-auth-apidocfiles-h', command: [ - python_prog, + python, '@INPUT0@', '@INPUT1@', ], @@ -322,8 +329,8 @@ if not fs.is_file('apidocfiles.h') capture: true, ) endif -libpdns_auth_api_swagger = declare_dependency( - sources: [libpdns_auth_api_swagger], +libpdns_auth_apidocfiles_h = declare_dependency( + sources: [libpdns_auth_apidocfiles_h], ) libpdns_auth_main = declare_dependency( @@ -387,18 +394,25 @@ libpdns_auth = declare_dependency( ], dependencies: [ deps, - libpdns_auth_api_swagger, + libpdns_auth_apidocfiles_h, libpdns_auth_lua, ], ) ) -libpdns_bind_dnssec_schema = 'bind-dnssec.schema.sqlite3.sql.h' -if not fs.is_file('bind-dnssec.schema.sqlite3.sql.h') - libpdns_bind_dnssec_schema = custom_target( +libpdns_bind_dnssec_schema_h = 'bind-dnssec.schema.sqlite3.sql.h' +if not fs.is_file(libpdns_bind_dnssec_schema_h) + py = import('python') + python = py.find_installation('python3', required: true) + + summary('Python', python.found(), bool_yn: true, section: 'BIND DNSSEC Schema') + summary('Path', python.full_path(), section: 'BIND DNSSEC Schema') + summary('Version', python.version(), section: 'BIND DNSSEC Schema') + + libpdns_bind_dnssec_schema_h = custom_target( 'pdns-bind-dnssec-schema', command: [ - python_prog, + python, '@INPUT0@', '@INPUT1@', ], @@ -410,8 +424,8 @@ if not fs.is_file('bind-dnssec.schema.sqlite3.sql.h') capture: true, ) endif -libpdns_bind_dnssec_schema = declare_dependency( - sources: [libpdns_bind_dnssec_schema], +libpdns_bind_dnssec_schema_h = declare_dependency( + sources: [libpdns_bind_dnssec_schema_h], ) libpdns_ipcipher = dependency('', required: false) @@ -435,7 +449,7 @@ libpdns_util = declare_dependency( ], dependencies: [ deps, - libpdns_bind_dnssec_schema, + libpdns_bind_dnssec_schema_h, libpdns_ipcipher, ], ) -- 2.47.2