meson: add install-{quiet, world} targets

To define our own install target, we need dependencies on the i18n targets,
which we did not collect so far.

Discussion: https://postgr.es/m/3fc3bb9b-f7f8-d442-35c1-ec82280c564a@enterprisedb.com
This commit is contained in:
Andres Freund 2023-03-23 21:20:18 -07:00
parent f13eb16485
commit e522049f23
28 changed files with 89 additions and 43 deletions

View File

@ -2543,6 +2543,7 @@ bin_targets = []
pl_targets = []
contrib_targets = []
testprep_targets = []
nls_targets = []
# Define the tests to distribute them to the correct test styles later
@ -2846,21 +2847,6 @@ generated_sources_ac += {'': ['GNUmakefile']}
testprep_targets += test_install_libs
# command to install files used for tests, which aren't installed by default
install_test_files_args = [
install_files,
'--prefix', dir_prefix,
'--install', contrib_data_dir, test_install_data,
'--install', dir_lib_pkg, test_install_libs,
]
# Target installing files required for installcheck of various modules
run_target('install-test-files',
command: [python] + install_test_files_args,
depends: testprep_targets,
)
# If there are any files in the source directory that we also generate in the
# build directory, they might get preferred over the newly generated files,
# e.g. because of a #include "file", which always will search in the current
@ -2915,6 +2901,64 @@ endif
###############################################################
# Install targets
###############################################################
# We want to define additional install targets beyond what meson provides. For
# that we need to define targets depending on nearly everything. We collected
# the results of i18n.gettext() invocations into nls_targets, that also
# includes maintainer targets though. Collect the ones we want as a dependency.
#
# i18n.gettext() doesn't return the dependencies before 0.60 - but the gettext
# generation happens during install, so that's not a real issue.
nls_mo_targets = []
if libintl.found() and meson.version().version_compare('>=0.60')
# use range() to avoid the flattening of the list that forech() would do
foreach off : range(0, nls_targets.length())
# i18n.gettext() list containing 1) list of built .mo files 2) maintainer
# -pot target 3) maintainer -pot target
nls_mo_targets += nls_targets[off][0]
endforeach
alias_target('nls', nls_mo_targets)
endif
all_built = [
backend_targets,
bin_targets,
libpq_st,
pl_targets,
contrib_targets,
nls_mo_targets,
testprep_targets,
ecpg_targets,
]
# Meson's default install target is quite verbose. Provide one that is quiet.
install_quiet = custom_target('install-quiet',
output: 'install-quiet',
build_always_stale: true,
build_by_default: false,
command: meson_args + ['install', '--quiet', '--no-rebuild'],
depends: all_built,
)
# Target to install files used for tests, which aren't installed by default
install_test_files_args = [
install_files,
'--prefix', dir_prefix,
'--install', contrib_data_dir, test_install_data,
'--install', dir_lib_pkg, test_install_libs,
]
run_target('install-test-files',
command: [python] + install_test_files_args,
depends: testprep_targets,
)
###############################################################
# Test prep
###############################################################
@ -3185,6 +3229,7 @@ if meson.version().version_compare('>=0.57')
endif
###############################################################
# Pseudo targets
###############################################################
@ -3194,6 +3239,7 @@ alias_target('bin', bin_targets + [libpq_st])
alias_target('pl', pl_targets)
alias_target('contrib', contrib_targets)
alias_target('testprep', testprep_targets)
alias_target('install-world', install_quiet, installdocs)

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('postgres-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('postgres-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('initdb-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('initdb-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_amcheck-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_amcheck-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_archivecleanup-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_archivecleanup-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_basebackup-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_basebackup-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_checksums-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_checksums-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_config-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_config-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_controldata-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_controldata-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_ctl-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_ctl-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_dump-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_dump-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_resetwal-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_resetwal-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_rewind-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_rewind-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_test_fsync-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_test_fsync-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_test_timing-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_test_timing-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_upgrade-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_upgrade-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_verifybackup-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_verifybackup-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pg_waldump-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pg_waldump-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('psql-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('psql-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pgscripts-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pgscripts-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('ecpglib' + '6' + '-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('ecpglib' + '6' + '-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('ecpg-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('ecpg-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('libpq' + '5' + '-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('libpq' + '5' + '-' + pg_version_major.to_string())]

View File

@ -10,7 +10,7 @@ if host_system == 'windows'
'--FILEDESC', 'libpq test program',])
endif
executable('libpq_uri_regress',
testprep_targets += executable('libpq_uri_regress',
libpq_uri_regress_sources,
dependencies: [frontend_code, libpq],
kwargs: default_bin_args + {
@ -29,7 +29,7 @@ if host_system == 'windows'
'--FILEDESC', 'libpq test program',])
endif
executable('libpq_testclient',
testprep_targets += executable('libpq_testclient',
libpq_testclient_sources,
dependencies: [frontend_code, libpq],
kwargs: default_bin_args + {

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('plperl-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('plperl-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('plpgsql-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('plpgsql-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('plpython-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('plpython-' + pg_version_major.to_string())]

View File

@ -1,3 +1,3 @@
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
i18n.gettext('pltcl-' + pg_version_major.to_string())
nls_targets += [i18n.gettext('pltcl-' + pg_version_major.to_string())]