From f91e71236cbb420a1ee46ca23c0c750e03e46b7d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Dec 2025 11:42:15 +0000 Subject: [PATCH 1/2] Refactor build support files into build_support directory --- .github/workflows/tools.yml | 2 +- Makefile.am | 10 +++++----- GAMBIT_VERSION => build_support/GAMBIT_VERSION | 0 gambit.wxs => build_support/gambit.wxs | 0 gambit.wxs.in => build_support/gambit.wxs.in | 2 +- {contrib => build_support}/mac/Info.plist | 0 {contrib => build_support}/mac/Info.plist.in | 2 +- configure.ac | 4 ++-- doc/conf.py | 2 +- doc/developer.contributing.rst | 4 ++-- pyproject.toml | 2 +- src/pygambit/__init__.py | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) rename GAMBIT_VERSION => build_support/GAMBIT_VERSION (100%) rename gambit.wxs => build_support/gambit.wxs (100%) rename gambit.wxs.in => build_support/gambit.wxs.in (99%) rename {contrib => build_support}/mac/Info.plist (100%) rename {contrib => build_support}/mac/Info.plist.in (99%) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 1156547ca..91c38c37a 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -91,7 +91,7 @@ jobs: run: | mkdir installer cp gambit* installer - "${WIX}bin/candle" gambit.wxs + "${WIX}bin/candle" build_support/gambit.wxs "${WIX}bin/light" -ext WixUIExtension gambit.wixobj - uses: actions/upload-artifact@v5 with: diff --git a/Makefile.am b/Makefile.am index de2b39f8f..27726e4a7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,8 +23,8 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = \ - gambit.wxs \ - contrib/mac/Info.plist \ + build_support/gambit.wxs \ + build_support/mac/Info.plist \ contrib/mac/gambit.icns \ src/labenski/README.txt \ src/labenski/art/grab.xpm \ @@ -373,7 +373,7 @@ bin_PROGRAMS += gambit endif # Read version from GAMBIT_VERSION file for use in compilation -GAMBIT_VERSION = $(shell cat $(top_srcdir)/GAMBIT_VERSION) +GAMBIT_VERSION = $(shell cat $(top_srcdir)/build_support/GAMBIT_VERSION) # Define VERSION for all C++ compilations and set include paths AM_CPPFLAGS = -I$(top_srcdir)/src -DVERSION=\"$(GAMBIT_VERSION)\" @@ -623,7 +623,7 @@ osx-bundle: -mkdir Gambit.app/Contents -mkdir Gambit.app/Contents/MacOS -mkdir Gambit.app/Contents/Resources - cp ${top_srcdir}/contrib/mac/Info.plist Gambit.app/Contents + cp ${top_srcdir}/build_support/mac/Info.plist Gambit.app/Contents cp ${top_srcdir}/contrib/mac/gambit.icns Gambit.app/Contents/Resources/gambit.icns echo -n 'APPL????' > Gambit.app/Contents/PkgInfo cp gambit Gambit.app/Contents/MacOS/gambit @@ -639,7 +639,7 @@ osx-dmg: osx-bundle msw-msi: -mkdir installer cp gambit* installer - candle gambit.wxs + candle build_support/gambit.wxs light -ext WixUIExtension gambit.wixobj clang-tidy: diff --git a/GAMBIT_VERSION b/build_support/GAMBIT_VERSION similarity index 100% rename from GAMBIT_VERSION rename to build_support/GAMBIT_VERSION diff --git a/gambit.wxs b/build_support/gambit.wxs similarity index 100% rename from gambit.wxs rename to build_support/gambit.wxs diff --git a/gambit.wxs.in b/build_support/gambit.wxs.in similarity index 99% rename from gambit.wxs.in rename to build_support/gambit.wxs.in index 975ae55f5..85f20db32 100644 --- a/gambit.wxs.in +++ b/build_support/gambit.wxs.in @@ -64,4 +64,4 @@ - \ No newline at end of file + diff --git a/contrib/mac/Info.plist b/build_support/mac/Info.plist similarity index 100% rename from contrib/mac/Info.plist rename to build_support/mac/Info.plist diff --git a/contrib/mac/Info.plist.in b/build_support/mac/Info.plist.in similarity index 99% rename from contrib/mac/Info.plist.in rename to build_support/mac/Info.plist.in index 4c7c5d8c2..6aa5c91f1 100644 --- a/contrib/mac/Info.plist.in +++ b/build_support/mac/Info.plist.in @@ -84,4 +84,4 @@ - \ No newline at end of file + diff --git a/configure.ac b/configure.ac index 1fb8050bc..2bbe53361 100644 --- a/configure.ac +++ b/configure.ac @@ -145,8 +145,8 @@ AC_SUBST(WX_CXXFLAGS) REZFLAGS=`echo $CXXFLAGS $WX_CXXFLAGS | sed 's/-mthreads//g' | sed 's/-g//g' | sed 's/-O. / /g' | sed 's/-I/--include-dir /g'` AC_SUBST(REZFLAGS) -GAMBIT_VERSION=`cat GAMBIT_VERSION` +GAMBIT_VERSION=`cat build_support/GAMBIT_VERSION` AC_SUBST(GAMBIT_VERSION) -AC_CONFIG_FILES([Makefile contrib/mac/Info.plist gambit.wxs]) +AC_CONFIG_FILES([Makefile build_support/mac/Info.plist build_support/gambit.wxs]) AC_OUTPUT diff --git a/doc/conf.py b/doc/conf.py index 7386eae41..4079391de 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -56,7 +56,7 @@ # built documents. # -_version_file = pathlib.Path(__file__).parent.parent / "GAMBIT_VERSION" +_version_file = pathlib.Path(__file__).parent.parent / "build_support/GAMBIT_VERSION" if _version_file.exists(): _full_version = _version_file.read_text().strip() # The short X.Y version. diff --git a/doc/developer.contributing.rst b/doc/developer.contributing.rst index 6da2e0713..64e5c0ac0 100644 --- a/doc/developer.contributing.rst +++ b/doc/developer.contributing.rst @@ -180,12 +180,12 @@ When making a new release of Gambit, follow these steps: 1. Create a new branch from the latest commit on the ``master`` branch named ``maintX_Y``, where ``X`` is the major version number and ``Y`` is the minor version number of the new release. -2. Update the version number in the ``GAMBIT_VERSION`` file at the root of the repository to ``X.Y.Z``. +2. Update the version number in the ``build_support/GAMBIT_VERSION`` file to ``X.Y.Z``. All other files will automatically use the updated version number: - `pyproject.toml` reads from GAMBIT_VERSION file at build time - - `configure.ac` reads from GAMBIT_VERSION file and substitutes into `Info.plist` and `gambit.wxs` + - `configure.ac` reads from GAMBIT_VERSION file and substitutes into `build_support/mac/Info.plist` and `build_support/gambit.wxs` - `src/pygambit/__init__.py` reads from installed package metadata or GAMBIT_VERSION file - `doc/conf.py` reads from GAMBIT_VERSION file at documentation build time - Documentation pages reference the `|release|` substitution variable to automatically reflect the updated version number. diff --git a/pyproject.toml b/pyproject.toml index 775d3ee63..5f010358b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,4 +86,4 @@ markers = [ ] [tool.setuptools.dynamic] -version = {file = "GAMBIT_VERSION"} \ No newline at end of file +version = {file = "build_support/GAMBIT_VERSION"} diff --git a/src/pygambit/__init__.py b/src/pygambit/__init__.py index d9d407927..727ddf721 100644 --- a/src/pygambit/__init__.py +++ b/src/pygambit/__init__.py @@ -35,5 +35,5 @@ except importlib.metadata.PackageNotFoundError: # Package is not installed, fallback to reading GAMBIT_VERSION file import pathlib - _version_file = pathlib.Path(__file__).parent.parent.parent / "GAMBIT_VERSION" + _version_file = pathlib.Path(__file__).parent.parent.parent / "build_support/GAMBIT_VERSION" __version__ = _version_file.read_text().strip() if _version_file.exists() else "unknown" From 1f8add612caf84e820f0ef1531ae9f1f0b1b738e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 8 Dec 2025 11:56:33 +0000 Subject: [PATCH 2/2] Update GAMBIT_VERSION path in configure.ac to use build_support directory --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 2bbe53361..411959ea0 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl -AC_INIT([gambit],[m4_esyscmd_s([cat GAMBIT_VERSION])]) +AC_INIT([gambit],[m4_esyscmd_s([cat build_support/GAMBIT_VERSION])]) AC_CONFIG_SRCDIR([src/gambit.h]) AM_INIT_AUTOMAKE([subdir-objects foreign]) dnl AC_CONFIG_MACRO_DIR([m4])