summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile.in7
-rw-r--r--meson.build6
-rw-r--r--meson_options.txt3
3 files changed, 12 insertions, 4 deletions
diff --git a/GNUmakefile.in b/GNUmakefile.in
index 30553b2a950..cf6e759486e 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -87,6 +87,9 @@ update-unicode: | submake-generated-headers submake-libpgport
distdir = postgresql-$(VERSION)
dummy = =install=
+# git revision to be packaged
+PG_GIT_REVISION = HEAD
+
GIT = git
dist: $(distdir).tar.gz $(distdir).tar.bz2
@@ -102,10 +105,10 @@ distdir-location:
# on, Unix machines.
$(distdir).tar.gz:
- $(GIT) -C $(srcdir) -c core.autocrlf=false archive --format tar.gz -9 --prefix $(distdir)/ HEAD -o $(abs_top_builddir)/$@
+ $(GIT) -C $(srcdir) -c core.autocrlf=false archive --format tar.gz -9 --prefix $(distdir)/ $(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
$(distdir).tar.bz2:
- $(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/ HEAD -o $(abs_top_builddir)/$@
+ $(GIT) -C $(srcdir) -c core.autocrlf=false -c tar.tar.bz2.command='$(BZIP2) -c' archive --format tar.bz2 --prefix $(distdir)/ $(PG_GIT_REVISION) -o $(abs_top_builddir)/$@
distcheck: dist
rm -rf $(dummy)
diff --git a/meson.build b/meson.build
index cdfd31377d1..1c0579d5a6b 100644
--- a/meson.build
+++ b/meson.build
@@ -3469,6 +3469,8 @@ bzip2 = find_program('bzip2', required: false, native: true)
distdir = meson.project_name() + '-' + meson.project_version()
+pg_git_revision = get_option('PG_GIT_REVISION')
+
# Note: core.autocrlf=false is needed to avoid line-ending conversion
# in case the environment has a different setting. Without this, a
# tarball created on Windows might be different than on, and unusable
@@ -3483,7 +3485,7 @@ tar_gz = custom_target('tar.gz',
'-9',
'--prefix', distdir + '/',
'-o', join_paths(meson.build_root(), '@OUTPUT@'),
- 'HEAD', '.'],
+ pg_git_revision],
output: distdir + '.tar.gz',
)
@@ -3497,7 +3499,7 @@ if bzip2.found()
'--format', 'tar.bz2',
'--prefix', distdir + '/',
'-o', join_paths(meson.build_root(), '@OUTPUT@'),
- 'HEAD', '.'],
+ pg_git_revision],
output: distdir + '.tar.bz2',
)
else
diff --git a/meson_options.txt b/meson_options.txt
index 249ecc5ffdf..246cecf3827 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -55,6 +55,9 @@ option('atomics', type: 'boolean', value: true,
option('spinlocks', type: 'boolean', value: true,
description: 'Use spinlocks')
+option('PG_GIT_REVISION', type: 'string', value: 'HEAD',
+ description: 'git revision to be packaged by pgdist target')
+
# Compilation options