poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Integrate git-version-gen.


From: Arsen Arsenović
Subject: [PATCH] Integrate git-version-gen.
Date: Tue, 24 Jan 2023 12:43:14 +0100

* etc/hacking.org (Building Release Tarballs): Add some notes
about how to get correct versioning information.
* configure.ac: Invoke git-version-gen to compute version value.
* bootstrap.conf (gnulib_modules): Add git-version-gen.
* Makefile.am (EXTRA_DIST): Add ``.version''.
(BUILT_SOURCES): Ditto.
($(top_srcdir)/.version): store current $(VERSION) value.
(dist-hook): Store version as .tarball-version.
* .gitignore: Ignore .version
* HACKING: Regenerate.
---
Hi,

This patchset integrates git-version-gen into the poke build system.  It
should be applied at the time of the next prerelease.

It contains updated documentation on generating releases also.  I expect
more questions to arise in this regard, so I can expand it further
should there be a need.

Thanks in advance, have a great day.

 .gitignore      |  1 +
 ChangeLog       | 14 ++++++++++++++
 HACKING         | 15 +++++++++++++++
 Makefile.am     | 11 ++++++++++-
 bootstrap.conf  |  1 +
 configure.ac    |  9 ++++++++-
 etc/hacking.org | 15 +++++++++++++++
 7 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index bdd339c4..cdbcec19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -85,6 +85,7 @@ config.h.in
 /poke.pc.in
 /poke-uninstalled.pc
 /poke-uninstalled.sh
+/.version
 
 ## Tag files created by ctags
 tags
diff --git a/ChangeLog b/ChangeLog
index 9586bb69..eaf53d5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2023-01-24  Arsen Arsenović  <arsen@aarsen.me>
+
+       Integrate git-version-gen.
+       * etc/hacking.org (Building Release Tarballs): Add some notes
+       about how to get correct versioning information.
+       * configure.ac: Invoke git-version-gen to compute version value.
+       * bootstrap.conf (gnulib_modules): Add git-version-gen.
+       * Makefile.am (EXTRA_DIST): Add ``.version''.
+       (BUILT_SOURCES): Ditto.
+       ($(top_srcdir)/.version): store current $(VERSION) value.
+       (dist-hook): Store version as .tarball-version.
+       * .gitignore: Ignore .version
+       * HACKING: Regenerate.
+
 2023-01-23  Jose E. Marchesi  <jemarch@gnu.org>
 
        * libpoke/pvm.jitter (PVM_BINOP_SL): Do not trigger left-shit UB.
diff --git a/HACKING b/HACKING
index 123dbc57..5325092d 100644
--- a/HACKING
+++ b/HACKING
@@ -234,6 +234,21 @@ with GNU poke.  If not, see 
<https://www.gnu.org/licenses/>.
   The standard target `make distcheck' builds a distributable sources
   tarball, and tests that it can be built and tested properly.
 
+  Note that if you're working on a checkout that is not fresh (i.e. it
+  has had commits or tags since you last ran `./autogen.sh'), it is
+  desirable to re-run `./autogen.sh', or otherwise regenerate
+  `configure', to get updated version information.  This version will be
+  stored in the newly-generated dist tarball.
+
+  Keep in mind that, when regenerating, a dirty tree, including
+  differently dated submodules, will cause the version to be suffixed
+  with `-dirty'.  Should this happen, and you want to go through with
+  the release anyway, `git stash' your changes and `git submodule
+  update' submodules, so that they get checked out to in-tree revisions.
+  This also ensures that you're testing the version of the tree that
+  will make it into a release, rather than something with a potentially
+  uncommitted fix, or suchlike.
+
 
 2.6 Installing Obvious Changes
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Makefile.am b/Makefile.am
index 83bce1ac..d6bf5480 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,8 @@ ACLOCAL_AMFLAGS = -I m4 -I m4/libpoke
 SUBDIRS = jitter gl maps pickles gl-libpoke libpoke poke poked utils \
           doc man testsuite etc po
 
-EXTRA_DIST = INSTALL.generic DEPENDENCIES
+EXTRA_DIST = INSTALL.generic DEPENDENCIES $(top_srcdir)/.version
+BUILT_SOURCES = $(top_srcdir)/.version
 
 noinst_SCRIPTS = run
 
@@ -47,4 +48,12 @@ update-hacking:
        emacs ${srcdir}/etc/hacking.org --batch -f org-ascii-export-to-ascii 
--kill
        mv -f ${srcdir}/etc/hacking.txt ${srcdir}/HACKING
 
+# Support for git-version-gen
+$(top_srcdir)/.version:
+       echo '$(VERSION)' > $@-t
+       mv $@-t $@
+
+dist-hook:
+       echo '$(VERSION)' > $(distdir)/.tarball-version
+
 .PHONY = update-hacking
diff --git a/bootstrap.conf b/bootstrap.conf
index abd82a1b..4990defa 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -33,6 +33,7 @@ gnulib_modules="
   getline
   getsockname
   getopt-gnu
+  git-version-gen
   glob
   host-cpu-c-abi
   isatty
diff --git a/configure.ac b/configure.ac
index d7fb469a..a4db914d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,14 @@ dnl
 dnl You should have received a copy of the GNU General Public License
 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([GNU poke], [2.90.0], [poke-devel@gnu.org], [poke],
+m4_define([poke_version],
+          [m4_esyscmd([build-aux/git-version-gen \
+                               --prefix 'releases\/poke-' \
+                               .tarball-version])])
+
+AC_INIT([GNU poke],
+        [poke_version()],
+       [poke-devel@gnu.org], [poke],
         [http://www.jemarch.net/poke.html])
 
 AC_CONFIG_AUX_DIR([build-aux])
diff --git a/etc/hacking.org b/etc/hacking.org
index 98f5c9bf..ed625fc8 100644
--- a/etc/hacking.org
+++ b/etc/hacking.org
@@ -110,6 +110,21 @@ Arsen Arsenović            <arsen@aarsen.me>
    The standard target =make distcheck= builds a distributable sources
    tarball, and tests that it can be built and tested properly.
 
+   Note that if you're working on a checkout that is not fresh (i.e. it
+   has had commits or tags since you last ran =./autogen.sh=), it is
+   desirable to re-run =./autogen.sh=, or otherwise regenerate
+   =configure=, to get updated version information.  This version will
+   be stored in the newly-generated dist tarball.
+
+   Keep in mind that, when regenerating, a dirty tree, including
+   differently dated submodules, will cause the version to be suffixed
+   with =-dirty=.  Should this happen, and you want to go through with
+   the release anyway, =git stash= your changes and =git submodule
+   update= submodules, so that they get checked out to in-tree
+   revisions.  This also ensures that you're testing the version of the
+   tree that will make it into a release, rather than something with a
+   potentially uncommitted fix, or suchlike.
+
 ** Installing Obvious Changes
 
    Anyone having write access to the git repository is allowed to push
-- 
2.39.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]