Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e522049

Browse files
committed
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
1 parent f13eb16 commit e522049

File tree

28 files changed

+89
-43
lines changed

28 files changed

+89
-43
lines changed

meson.build

+61-15
Original file line numberDiff line numberDiff line change
@@ -2543,6 +2543,7 @@ bin_targets = []
25432543
pl_targets = []
25442544
contrib_targets = []
25452545
testprep_targets = []
2546+
nls_targets = []
25462547

25472548

25482549
# Define the tests to distribute them to the correct test styles later
@@ -2846,21 +2847,6 @@ generated_sources_ac += {'': ['GNUmakefile']}
28462847
testprep_targets += test_install_libs
28472848

28482849

2849-
# command to install files used for tests, which aren't installed by default
2850-
install_test_files_args = [
2851-
install_files,
2852-
'--prefix', dir_prefix,
2853-
'--install', contrib_data_dir, test_install_data,
2854-
'--install', dir_lib_pkg, test_install_libs,
2855-
]
2856-
2857-
# Target installing files required for installcheck of various modules
2858-
run_target('install-test-files',
2859-
command: [python] + install_test_files_args,
2860-
depends: testprep_targets,
2861-
)
2862-
2863-
28642850
# If there are any files in the source directory that we also generate in the
28652851
# build directory, they might get preferred over the newly generated files,
28662852
# e.g. because of a #include "file", which always will search in the current
@@ -2915,6 +2901,64 @@ endif
29152901

29162902

29172903

2904+
###############################################################
2905+
# Install targets
2906+
###############################################################
2907+
2908+
2909+
# We want to define additional install targets beyond what meson provides. For
2910+
# that we need to define targets depending on nearly everything. We collected
2911+
# the results of i18n.gettext() invocations into nls_targets, that also
2912+
# includes maintainer targets though. Collect the ones we want as a dependency.
2913+
#
2914+
# i18n.gettext() doesn't return the dependencies before 0.60 - but the gettext
2915+
# generation happens during install, so that's not a real issue.
2916+
nls_mo_targets = []
2917+
if libintl.found() and meson.version().version_compare('>=0.60')
2918+
# use range() to avoid the flattening of the list that forech() would do
2919+
foreach off : range(0, nls_targets.length())
2920+
# i18n.gettext() list containing 1) list of built .mo files 2) maintainer
2921+
# -pot target 3) maintainer -pot target
2922+
nls_mo_targets += nls_targets[off][0]
2923+
endforeach
2924+
alias_target('nls', nls_mo_targets)
2925+
endif
2926+
2927+
2928+
all_built = [
2929+
backend_targets,
2930+
bin_targets,
2931+
libpq_st,
2932+
pl_targets,
2933+
contrib_targets,
2934+
nls_mo_targets,
2935+
testprep_targets,
2936+
ecpg_targets,
2937+
]
2938+
2939+
# Meson's default install target is quite verbose. Provide one that is quiet.
2940+
install_quiet = custom_target('install-quiet',
2941+
output: 'install-quiet',
2942+
build_always_stale: true,
2943+
build_by_default: false,
2944+
command: meson_args + ['install', '--quiet', '--no-rebuild'],
2945+
depends: all_built,
2946+
)
2947+
2948+
# Target to install files used for tests, which aren't installed by default
2949+
install_test_files_args = [
2950+
install_files,
2951+
'--prefix', dir_prefix,
2952+
'--install', contrib_data_dir, test_install_data,
2953+
'--install', dir_lib_pkg, test_install_libs,
2954+
]
2955+
run_target('install-test-files',
2956+
command: [python] + install_test_files_args,
2957+
depends: testprep_targets,
2958+
)
2959+
2960+
2961+
29182962
###############################################################
29192963
# Test prep
29202964
###############################################################
@@ -3185,6 +3229,7 @@ if meson.version().version_compare('>=0.57')
31853229
endif
31863230

31873231

3232+
31883233
###############################################################
31893234
# Pseudo targets
31903235
###############################################################
@@ -3194,6 +3239,7 @@ alias_target('bin', bin_targets + [libpq_st])
31943239
alias_target('pl', pl_targets)
31953240
alias_target('contrib', contrib_targets)
31963241
alias_target('testprep', testprep_targets)
3242+
alias_target('install-world', install_quiet, installdocs)
31973243

31983244

31993245

src/backend/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('postgres-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('postgres-' + pg_version_major.to_string())]

src/bin/initdb/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('initdb-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('initdb-' + pg_version_major.to_string())]

src/bin/pg_amcheck/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

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

3-
i18n.gettext('pg_archivecleanup-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_archivecleanup-' + pg_version_major.to_string())]

src/bin/pg_basebackup/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_basebackup-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_basebackup-' + pg_version_major.to_string())]

src/bin/pg_checksums/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_checksums-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_checksums-' + pg_version_major.to_string())]

src/bin/pg_config/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_config-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_config-' + pg_version_major.to_string())]

src/bin/pg_controldata/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_controldata-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_controldata-' + pg_version_major.to_string())]

src/bin/pg_ctl/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_ctl-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_ctl-' + pg_version_major.to_string())]

src/bin/pg_dump/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_dump-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_dump-' + pg_version_major.to_string())]

src/bin/pg_resetwal/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_resetwal-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_resetwal-' + pg_version_major.to_string())]

src/bin/pg_rewind/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_rewind-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_rewind-' + pg_version_major.to_string())]

src/bin/pg_test_fsync/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_test_fsync-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_test_fsync-' + pg_version_major.to_string())]

src/bin/pg_test_timing/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_test_timing-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_test_timing-' + pg_version_major.to_string())]

src/bin/pg_upgrade/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

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

3-
i18n.gettext('pg_verifybackup-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_verifybackup-' + pg_version_major.to_string())]

src/bin/pg_waldump/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pg_waldump-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pg_waldump-' + pg_version_major.to_string())]

src/bin/psql/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('psql-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('psql-' + pg_version_major.to_string())]

src/bin/scripts/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

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

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

3-
i18n.gettext('ecpg-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('ecpg-' + pg_version_major.to_string())]

src/interfaces/libpq/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('libpq' + '5' + '-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('libpq' + '5' + '-' + pg_version_major.to_string())]

src/interfaces/libpq/test/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if host_system == 'windows'
1010
'--FILEDESC', 'libpq test program',])
1111
endif
1212

13-
executable('libpq_uri_regress',
13+
testprep_targets += executable('libpq_uri_regress',
1414
libpq_uri_regress_sources,
1515
dependencies: [frontend_code, libpq],
1616
kwargs: default_bin_args + {
@@ -29,7 +29,7 @@ if host_system == 'windows'
2929
'--FILEDESC', 'libpq test program',])
3030
endif
3131

32-
executable('libpq_testclient',
32+
testprep_targets += executable('libpq_testclient',
3333
libpq_testclient_sources,
3434
dependencies: [frontend_code, libpq],
3535
kwargs: default_bin_args + {

src/pl/plperl/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('plperl-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('plperl-' + pg_version_major.to_string())]

src/pl/plpgsql/src/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('plpgsql-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('plpgsql-' + pg_version_major.to_string())]

src/pl/plpython/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('plpython-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('plpython-' + pg_version_major.to_string())]

src/pl/tcl/po/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Copyright (c) 2022-2023, PostgreSQL Global Development Group
22

3-
i18n.gettext('pltcl-' + pg_version_major.to_string())
3+
nls_targets += [i18n.gettext('pltcl-' + pg_version_major.to_string())]

0 commit comments

Comments
 (0)