This update of boswars catches up on about 10 years of development.

Some big improvements upstram:
- scons support was removed
- Python 3 support was added
- no more need to fix the images with optipng as upstream makde a fix

The game launched on my amd64 laptop and I played through a few minutes 
without any problems.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/games/boswars/Makefile,v
diff -u -p -u -r1.32 Makefile
--- Makefile    18 Feb 2025 22:30:15 -0000      1.32
+++ Makefile    31 Aug 2026 02:09:57 -0000
@@ -1,11 +1,10 @@
 COMMENT=       real-time strategy game
 
-V=             2.7
+V=             2.8
 DISTNAME=      boswars-${V}-src
 PKGNAME=       boswars-${V}
 CATEGORIES=    games x11
 SITES=         https://www.boswars.org/dist/releases/
-REVISION=      4
 
 HOMEPAGE=      https://www.boswars.org/
 
@@ -17,14 +16,11 @@ WANTLIB += ${MODLUA_WANTLIB}
 
 COMPILER =     base-clang ports-gcc
 
-MODULES=       devel/scons \
-               lang/lua
-MODSCONS_FLAGS=        CPPPATH="${LOCALBASE}/include ${X11BASE}/include" \
-               CXX="c++ -std=gnu++14" \
-               opengl=1
+MODULES=       lang/lua \
+               lang/python
+
+MODPY_RUNDEP=  No
 
-BUILD_DEPENDS= devel/sdl-image \
-               graphics/optipng
 LIB_DEPENDS=   devel/sdl \
                multimedia/libtheora \
                audio/libvorbis \
@@ -36,20 +32,19 @@ NO_TEST=    Yes
 DATA_DIR=      campaigns graphics intro languages maps patches \
                scripts sounds units
 
-# the shipped images are considered broken by newer libpng: use opting
-# to fix them
 pre-configure:
-       @${SUBST_CMD} ${WRKSRC}/SConstruct \
-               ${WRKSRC}/engine/include/stratagus.h
-.for f in maps/antarticum.map/terrain.png graphics/ui/ui_*.png \
-               units/radar/radar*.png units/tree*/tree*.png
-       optipng -force -fix ${WRKSRC}/${f}
-.endfor
+       ${SUBST_CMD} ${WRKSRC}/engine/include/stratagus.h
+
+do-build:
+       cd ${WRKSRC} && ${MODPY_BIN} ./make.py -j ${MAKE_JOBS} release \
+               cc=${CXX} \
+               cflags="${CXXFLAGS} -I${LOCALBASE}/include 
-I${X11BASE}/include" \
+               ldflags="-L${LOCALBASE}/lib -L${X11BASE}/lib"
 
 do-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/boswars
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/boswars/html/scripts
-       ${INSTALL_PROGRAM} ${WRKSRC}/build/boswars-release \
+       ${INSTALL_PROGRAM} ${WRKSRC}/fbuild/release/boswars \
            ${PREFIX}/bin/boswars
        ${INSTALL_DATA} ${WRKSRC}/doc/*.html ${PREFIX}/share/doc/boswars/html
        ${INSTALL_DATA} ${WRKSRC}/doc/scripts/{*.html,*.py} \
Index: distinfo
===================================================================
RCS file: /cvs/ports/games/boswars/distinfo,v
diff -u -p -u -r1.7 distinfo
--- distinfo    24 Sep 2013 04:53:18 -0000      1.7
+++ distinfo    31 Aug 2026 02:09:57 -0000
@@ -1,2 +1,2 @@
-SHA256 (boswars-2.7-src.tar.gz) = 3DcY9THp6kE8834TM7YqTF5p8UBVAtnFm55CRjUTXj4=
-SIZE (boswars-2.7-src.tar.gz) = 77280735
+SHA256 (boswars-2.8-src.tar.gz) = UYUgaZC/Z2XHpdOALObmBIoQh89MMHsJmlaRo+7GuGo=
+SIZE (boswars-2.8-src.tar.gz) = 77240542
Index: patches/patch-SConstruct
===================================================================
RCS file: patches/patch-SConstruct
diff -N patches/patch-SConstruct
--- patches/patch-SConstruct    18 Feb 2025 22:30:15 -0000      1.10
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,166 +0,0 @@
-2to3 and additional fixes
-
-Index: SConstruct
---- SConstruct.orig
-+++ SConstruct
-@@ -32,12 +32,12 @@ SConsignFile()
- 
- def DefineOptions(filename, args):
-    opts = Variables(filename, args)
--   opts.Add('CPPPATH', 'Additional preprocessor paths', 
['/usr/local/include'])
-+   opts.Add('CPPPATH', 'Additional preprocessor paths', 
['/usr/local/include'], Split(''))
-    opts.Add('CPPFLAGS', 'Additional preprocessor flags')
-    opts.Add('CPPDEFINES', 'defined constants', Split(''))
--   opts.Add('LIBPATH', 'Additional library paths', ['/usr/local/lib'])
-+   opts.Add('LIBPATH', 'Additional library paths', ['/usr/local/lib'], 
Split(''))
-    opts.Add('LIBS', 'Additional libraries')
--   opts.Add('CCFLAGS', 'C Compiler flags', Split(ccflags))
-+   opts.Add('CCFLAGS', 'C Compiler flags', Split(ccflags), Split(''))
-    opts.Add('LINKFLAGS', 'Linker Compiler flags')
-    opts.Add('CC', 'C Compiler')
-    opts.Add('CXX', 'C++ Compiler')
-@@ -51,6 +51,9 @@ def DefineOptions(filename, args):
- opts = DefineOptions("build_options.py", ARGUMENTS)
- env = Environment(ENV = {'PATH':os.environ['PATH']}) # for an unknown reason 
Environment(options=opts) doesnt work well
- opts.Update(env) # Needed as Environment(options=opts) doesnt seem to work
-+env['CCFLAGS'] = Split(ccflags) + Split(env['CCFLAGS'])
-+env['CPPPATH'] = Split(env['CPPPATH'])
-+env['LIBPATH'] = Split(env['LIBPATH'])
- Help(opts.GenerateHelpText(env))
- mingw = env.Clone()
- optionsChanged = True
-@@ -122,7 +125,7 @@ def ParseConfig(env, command, function=None):
-                 flags['LINKFLAGS'].append(arg)
-             else:
-                 flags['CCFLAGS'].append(arg)
--        apply(env.Append, (), flags)
-+        env.Append(*(), **flags)
-         return static_libs
- 
-     if function is None:
-@@ -144,6 +147,10 @@ def CheckOpenGL(env, conf):
-       'LIBS': ['GL'], 
-       'LIBPATH': ['/usr/lib', '/usr/X11R6/lib'],
-       'CPPPATH': ['/usr/include']}
-+  opengl['openbsd'] = { 
-+      'LIBS': ['GL'], 
-+      'LIBPATH': ['/usr/X11R6/lib'],
-+      'CPPPATH': ['/usr/X11R6/include']}
-   opengl['cygwin'] = {
-       'LIBS': ['opengl3']}
-   opengl['darwin'] = {
-@@ -155,6 +162,8 @@ def CheckOpenGL(env, conf):
-   else:
-      if sys.platform[:5] == 'linux' or sys.platform.startswith('gnukfreebsd'):
-         platform = 'linux'
-+     if sys.platform[:7] == 'openbsd':
-+        platform = 'openbsd'
-      glconfig = opengl.get(platform, {})
-   for key in glconfig:
-       if key != 'LIBS':
-@@ -168,17 +177,12 @@ def CheckOpenGL(env, conf):
-   return True
- 
- def CheckLuaLib(env, conf):
--  if not 'USE_WIN32' in env['CPPDEFINES']:
--     if env.WhereIs('pkg-config'):
--        for packagename in ['lua5.1', 'lua51', 'lua']:
--           exitcode,_ = ParseConfig(env, 'pkg-config --cflags --libs ' + 
packagename)
--           if exitcode == 0:
--              break
-+  env.ParseConfig('pkg-config --cflags --libs lua51')
-   if conf.CheckLibWithHeader('lua51', 'lua.h', 'c'):
-     return 1
-   if conf.CheckLibWithHeader('lua5.1', 'lua.h', 'c'):
-     return 1
--  if not conf.CheckLibWithHeader('lua', 'lua.h', 'c'):
-+  if not conf.CheckLibWithHeader('lua', 'lualib.h', 'c'):
-     return 0
-   # make sure we have lualib which is included in lua 5.1
-   if conf.CheckFunc('luaopen_base'):
-@@ -189,30 +193,30 @@ def AutoConfigure(env):
-   conf = Configure(env)
- 
-   ## check for required libs ##
--  if not conf.CheckLibWithHeader('png', 'png.h', 'c'):
--     print 'Did not find png library or headers, exiting!'
--     Exit(1)
-   if not conf.CheckLibWithHeader('z', 'zlib.h', 'c'):
--     print 'Did not find the zlib library or headers, exiting!'
-+     print('Did not find the zlib library or headers, exiting!')
-      Exit(1)
--  if not 'USE_WIN32' in env['CPPDEFINES'] and not 
sys.platform.startswith('freebsd'):
-+  if not conf.CheckLibWithHeader('png', 'png.h', 'c'):
-+     print('Did not find png library or headers, exiting!')
-+     Exit(1)
-+  if not 'USE_WIN32' in env['CPPDEFINES'] and not 
sys.platform.startswith('openbsd'):
-      if not conf.CheckLib('dl'):
--        print 'Did not find dl library or header which is needed on some 
systems for lua. Exiting!'
-+        print('Did not find dl library or header which is needed on some 
systems for lua. Exiting!')
-         Exit(1)
-   if not CheckLuaLib(env, conf):
--     print 'Did not find required lua library. Exiting!'
-+     print('Did not find required lua library. Exiting!')
-      Exit(1)
-   if not CheckOpenGL(env, conf):
--     print 'Did not find required OpenGL library. Exiting!'
-+     print('Did not find required OpenGL library. Exiting!')
-      Exit(1)
- 
-   # Check for optional libraries #
-+  if conf.CheckLib('ogg'):
-+     env.Append(CPPDEFINES = 'USE_OGG')
-   if conf.CheckLib('vorbis'):
-      env.Append(CPPDEFINES = 'USE_VORBIS')
-   if conf.CheckLib('theora'):
-      env.Append(CPPDEFINES = 'USE_THEORA')
--  if conf.CheckLib('ogg'):
--     env.Append(CPPDEFINES = 'USE_OGG')
- 
-   # check for optional functions
-   if conf.CheckFunc('strcasestr'):
-@@ -232,7 +236,7 @@ def AutoConfigure(env):
-     env.ParseConfig('sdl-config --libs')
-     if sys.platform != "darwin" and not '-Dmain=SDL_main' in env['CCFLAGS']:
-        if not conf.CheckLibWithHeader('SDL', 'SDL.h', 'c'):
--          print 'Did not find SDL library or headers, exiting!'
-+          print('Did not find SDL library or headers, exiting!')
-           Exit(1)
- 
-   env = conf.Finish()
-@@ -245,14 +249,14 @@ def AutoConfigureIfNeeded(env, name):
-             # Remove outdated cache file
-             os.remove(cachename)
-    if optionsChanged or not os.path.exists(cachename):
--      print cachename + " doesn't exist or out of date."
--      print "Generating new build config cache ..."
-+      print(cachename + " doesn't exist or out of date.")
-+      print("Generating new build config cache ...")
-       cache = DefineOptions(cachename, {})
-       AutoConfigure(env)
-       cache.Save(cachename, env)
-    else:
-       cache = DefineOptions(cachename, {})
--      print "Using " + cachename
-+      print("Using " + cachename)
-       cache.Update(env)
- 
- AutoConfigureIfNeeded(env, '')
-@@ -265,7 +269,7 @@ addBosWarsPaths(env)
- 
- # define the different build environments (variants)
- release = env.Clone()
--release.Append(CCFLAGS = Split('-O2 -pipe -fomit-frame-pointer 
-fexpensive-optimizations -ffast-math'))
-+release.Append(CCFLAGS = Split('-fomit-frame-pointer -ffast-math'))
- 
- if mingw['extrapath']:
-   mingw.Tool('crossmingw', toolpath = ['tools/scons/'])
-@@ -311,7 +315,7 @@ if sys.platform.startswith('linux') or sys.platform.st
- def DefineVariant(venv, v, vv = None):
-    if vv == None:
-       vv = '-' + v
--   BuildDir('build/' + v, engineSourceDir, duplicate = 0)
-+   VariantDir('build/' + v, engineSourceDir, duplicate = 0)
-    r = venv.Program('build/boswars' + vv, buildSourcesList('build/' + v))
-    Alias(v, 'boswars' + vv)
-    return r 
Index: patches/patch-fabricate_py
===================================================================
RCS file: patches/patch-fabricate_py
diff -N patches/patch-fabricate_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-fabricate_py  31 Aug 2026 02:09:57 -0000
@@ -0,0 +1,24 @@
+Python compat for Python 3.8+
+
+Index: fabricate.py
+--- fabricate.py.orig
++++ fabricate.py
+@@ -378,10 +378,6 @@ class AtimesRunner(Runner):
+         """ Run command and return its dependencies and outputs, using before
+             and after access times to determine dependencies. """
+ 
+-        # For Python pre-2.5, ensure os.stat() returns float atimes
+-        old_stat_float = os.stat_float_times()
+-        os.stat_float_times(True)
+-
+         originals = self.file_times()
+         if self.atimes == 2:
+             befores = originals
+@@ -425,7 +421,6 @@ class AtimesRunner(Runner):
+                 if original != afters.get(name, None):
+                     self._utime(name, original[0], original[1])
+ 
+-        os.stat_float_times(old_stat_float)  # restore stat_float_times value
+         return deps, outputs
+ 
+ class StraceProcess(object):
Index: patches/patch-make_py
===================================================================
RCS file: patches/patch-make_py
diff -N patches/patch-make_py
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-make_py       31 Aug 2026 02:09:57 -0000
@@ -0,0 +1,12 @@
+Index: make.py
+--- make.py.orig
++++ make.py
+@@ -55,7 +55,7 @@ sources = find('engine', '*.cpp')
+ 
+ def tolist(x):
+     if isinstance(x, str):
+-        return x.split(' ')
++        return x.split()
+     else:
+         return list(x)
+ 
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/games/boswars/pkg/PLIST,v
diff -u -p -u -r1.8 PLIST
--- pkg/PLIST   11 Mar 2022 19:04:09 -0000      1.8
+++ pkg/PLIST   31 Aug 2026 02:09:57 -0000
@@ -318,6 +318,10 @@ share/boswars/maps/clover.map/
 share/boswars/maps/clover.map/presentation.smp
 share/boswars/maps/clover.map/setup.sms
 share/boswars/maps/clover.map/terrain.lua
+share/boswars/maps/cornered.map/
+share/boswars/maps/cornered.map/presentation.smp
+share/boswars/maps/cornered.map/setup.sms
+share/boswars/maps/cornered.map/terrain.lua
 share/boswars/maps/empty-buildings.map/
 share/boswars/maps/empty-buildings.map/presentation.smp
 share/boswars/maps/empty-buildings.map/setup.sms
@@ -349,6 +353,37 @@ share/boswars/maps/lava-river.map/setup.
 share/boswars/maps/multiple-fronts-total-war.map/
 share/boswars/maps/multiple-fronts-total-war.map/presentation.smp
 share/boswars/maps/multiple-fronts-total-war.map/setup.sms
+share/boswars/maps/oasis/
+share/boswars/maps/oasis/oasis-01.map/
+share/boswars/maps/oasis/oasis-01.map/presentation.smp
+share/boswars/maps/oasis/oasis-01.map/setup.sms
+share/boswars/maps/oasis/oasis-02.map/
+share/boswars/maps/oasis/oasis-02.map/presentation.smp
+share/boswars/maps/oasis/oasis-02.map/setup.sms
+share/boswars/maps/oasis/oasis-03.map/
+share/boswars/maps/oasis/oasis-03.map/presentation.smp
+share/boswars/maps/oasis/oasis-03.map/setup.sms
+share/boswars/maps/oasis/oasis-04.map/
+share/boswars/maps/oasis/oasis-04.map/presentation.smp
+share/boswars/maps/oasis/oasis-04.map/setup.sms
+share/boswars/maps/oasis/oasis-05.map/
+share/boswars/maps/oasis/oasis-05.map/presentation.smp
+share/boswars/maps/oasis/oasis-05.map/setup.sms
+share/boswars/maps/oasis/oasis-06.map/
+share/boswars/maps/oasis/oasis-06.map/presentation.smp
+share/boswars/maps/oasis/oasis-06.map/setup.sms
+share/boswars/maps/oasis/oasis-07.map/
+share/boswars/maps/oasis/oasis-07.map/presentation.smp
+share/boswars/maps/oasis/oasis-07.map/setup.sms
+share/boswars/maps/oasis/oasis-08.map/
+share/boswars/maps/oasis/oasis-08.map/presentation.smp
+share/boswars/maps/oasis/oasis-08.map/setup.sms
+share/boswars/maps/oasis/oasis-09.map/
+share/boswars/maps/oasis/oasis-09.map/presentation.smp
+share/boswars/maps/oasis/oasis-09.map/setup.sms
+share/boswars/maps/oasis/oasis-10.map/
+share/boswars/maps/oasis/oasis-10.map/presentation.smp
+share/boswars/maps/oasis/oasis-10.map/setup.sms
 share/boswars/maps/overpopulation-destroyers.map/
 share/boswars/maps/overpopulation-destroyers.map/presentation.smp
 share/boswars/maps/overpopulation-destroyers.map/setup.sms
@@ -372,6 +407,10 @@ share/boswars/maps/overpopulation-stampe
 share/boswars/maps/patches.map/
 share/boswars/maps/patches.map/presentation.smp
 share/boswars/maps/patches.map/setup.sms
+share/boswars/maps/ringway.map/
+share/boswars/maps/ringway.map/presentation.smp
+share/boswars/maps/ringway.map/setup.sms
+share/boswars/maps/ringway.map/terrain.lua
 share/boswars/maps/river.map/
 share/boswars/maps/river.map/patch.lua
 share/boswars/maps/river.map/presentation.smp
@@ -420,6 +459,10 @@ share/boswars/maps/wetlands02.map/presen
 share/boswars/maps/wetlands02.map/setup.sms
 share/boswars/maps/wetlands02.map/terrain.png
 share/boswars/maps/wetlands02.map/wetlands02-access-water.png
+share/boswars/maps/wormroads.map/
+share/boswars/maps/wormroads.map/presentation.smp
+share/boswars/maps/wormroads.map/setup.sms
+share/boswars/maps/wormroads.map/terrain.lua
 share/boswars/maps/zombies.map/
 share/boswars/maps/zombies.map/presentation.smp
 share/boswars/maps/zombies.map/setup.sms

Reply via email to