On 2021/10/30 20:26, Omar Polo wrote:
> Hello ports,
>
> Here's another attempt at updating devel/scons. The third time is the
> charm, right? :D
>
> Attaching:
>
> - a tarball for a "new" devel/scons2: it's the current scons ports with
> REVISION and MAINTAINER dropped and HOMEPAGE switched to https; this
> way we can still build databases/mongodb and games/thedarkmod
I only just noticed that 3.x has python 2 support as well, so I wonder
if it would make sense to call the port py2-scons instead of scons2?
That would leave it open to changing it to 3.x without the version
getting out of sync with the directory name if we ever wanted to.
We might not want to but it's easier to avoid any possible need to
rename the directory later as it's a bit of a pain to do.
> - `modscons-usev2.diff': adds a MODSCONS_USE_V2 variable to
> scons.ports.mk that makes MODSCONS use devel/scons2 instead of scons
> if set to 'Yes' and sets it for mongodb and thedarkmod so they build.
> Suggestion for a better name are welcome :)
I think that's fine.
> - `scons-update.diff': updates devel/scons to 4.2.0
>
> - `scons-fallout.diff': fixes the failures due to the scons update.
> Most of them are straightforward, except for games/dangerdeep where
> 2to3 doesn't work really well. I know that reviewing those bits
> won't be a pleasure, I'm sorry!
missing -w on the 2to3 line for dangerdeep :) replacement patch for
dangerdeep below.
>
> (note that this time I haven't tried to build mongodb or tdm, I just
> ensured that the right scons was picked.)
>
> devel/scons and devel/scons2 mark each others as @conflict: they both
> install bin/scons and I don't feel comfortable enough to patch scons2
> furthermore. It's not bad I guess, scons2 is meant only to build
> our old mongodb and thedarkmod (until gets updated.) Hope it doesn't
> cause problems in bulk builds thought.
That is a problem for bulks, but it's easily fixed. Let's just install
the XXX-${VERSION} scripts for the old version skipping the unversioned
names, and rename the manpages according to the version number.
New tar attached for this. Any OK to import that (either as scons2,
or as py2-scons)?
Then we just set MODSCONS_BIN depending on the MODSCONS_USE_V2 setting.
Index: devel/scons/scons.port.mk
===================================================================
RCS file: /cvs/ports/devel/scons/scons.port.mk,v
retrieving revision 1.7
diff -u -p -r1.7 scons.port.mk
--- devel/scons/scons.port.mk 29 Aug 2021 19:46:17 -0000 1.7
+++ devel/scons/scons.port.mk 30 Oct 2021 19:56:38 -0000
@@ -1,8 +1,14 @@
# $OpenBSD: scons.port.mk,v 1.7 2021/08/29 19:46:17 kirby Exp $
-BUILD_DEPENDS+= devel/scons
+MODSCONS_USE_V2?= No
+.if ${MODSCONS_USE_V2:L} == "yes"
+BUILD_DEPENDS+= devel/scons2
+MODSCONS_BIN= ${LOCALBASE}/bin/scons-2.5.1
+.else
+BUILD_DEPENDS+= devel/scons
MODSCONS_BIN= ${LOCALBASE}/bin/scons
+.endif
MODSCONS_ENV?= CC="${CC}" \
CXX="${CXX}" \
> - I took the chance to give games/boswars' Makefile a bit of love, I
> don't know if it's preferred to commit those edits in a separate step
> (the only thing strictly required is the pre-patch target)
they're simple enough so I'm ok with them being together.
Index: games/dangerdeep/Makefile
===================================================================
RCS file: /cvs/ports/games/dangerdeep/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- games/dangerdeep/Makefile 14 Jul 2019 00:39:36 -0000 1.9
+++ games/dangerdeep/Makefile 30 Oct 2021 19:56:38 -0000
@@ -44,6 +44,9 @@ MODSCONS_FLAGS = debug=1 \
datadir=${TRUEPREFIX}/share/dangerdeep \
installbindir=${PREFIX}/bin
+pre-patch:
+ 2to3 -w ${WRKSRC}/SConstruct
+
pre-configure:
${SUBST_CMD} ${WRKSRC}/SConstruct
Index: games/dangerdeep/patches/patch-SConstruct
===================================================================
RCS file: /cvs/ports/games/dangerdeep/patches/patch-SConstruct,v
retrieving revision 1.2
diff -u -p -r1.2 patch-SConstruct
--- games/dangerdeep/patches/patch-SConstruct 12 Jan 2018 20:13:31 -0000
1.2
+++ games/dangerdeep/patches/patch-SConstruct 30 Oct 2021 19:56:38 -0000
@@ -1,6 +1,90 @@
$OpenBSD: patch-SConstruct,v 1.2 2018/01/12 20:13:31 kili Exp $
---- SConstruct.orig Sat May 8 03:41:20 2010
-+++ SConstruct Sat Jun 1 11:12:50 2013
+Index: SConstruct
+--- SConstruct.orig
++++ SConstruct
+@@ -79,9 +79,9 @@ elif sys.platform == 'darwin':
+ datadir = './data' # use slashes as separator always. C/C++ want
it so.
+ build_dir = 'macosx'
+ osspecificsrc = Split("""Mac/SDLMain.m""")
+- if (debug == 1):
+- env.Append(CCFLAGS = '-g')
+- env.Append(CPPDEFINES = ['DEBUG'])
++ if (debug == 1):
++ env.Append(CCFLAGS = '-g')
++ env.Append(CPPDEFINES = ['DEBUG'])
+ elif (sys.platform == 'freebsd5') or (sys.platform == 'freebsd6') or
(sys.platform == 'freebsd7'):
+ print("Compiling for FreeBSD Environment")
+ env = Environment(ENV = os.environ)
+@@ -99,43 +99,43 @@ elif (sys.platform == 'freebsd5') or (sys.platform ==
+ cpuinfol = cpuinfof.readlines()
+ mmxsupported = False
+ ssesupported = False
+- for i in cpuinfol:
++ for i in cpuinfol:
+ if i == '1\n':
+ mmxsupported = True
+ ssesupported = True
+ if (usex86sse == 0) and (mmxsupported and ssesupported):
+- usex86sse = 1
+- if usex86sse >= 1:
++ usex86sse = 1
++ if usex86sse >= 1:
+ env.Append(CCFLAGS = '-msse')
+- env.Append(CPPDEFINES = ['USE_SSE'])
+- osspecificsrc += []
+- print('Using x86 SSE/MMX optimizations.')
++ env.Append(CPPDEFINES = ['USE_SSE'])
++ osspecificsrc += []
++ print('Using x86 SSE/MMX optimizations.')
+
+- env.Replace(CCFLAGS = os.environ['CFLAGS'])
++ env.Replace(CCFLAGS = os.environ['CFLAGS'])
+ if (debug == 1):
+ env.Append(CCFLAGS = '-g')
+ env.Append(CPPDEFINES = ['DEBUG'])
+- env.Replace(CXXFLAGS = os.environ['CXXFLAGS'] + ' `' + SDL_CONFIG + '
--cflags`')
+- env.Append(LINKFLAGS = '`' + SDL_CONFIG + ' --libs`')
+- datadir = '/usr/local/share/dangerdeep'
+- build_dir = 'freebsd'
++ env.Replace(CXXFLAGS = os.environ['CXXFLAGS'] + ' `' + SDL_CONFIG + '
--cflags`')
++ env.Append(LINKFLAGS = '`' + SDL_CONFIG + ' --libs`')
++ datadir = '/usr/local/share/dangerdeep'
++ build_dir = 'freebsd'
+
+- if (checkconf == True and os.system('grep glBindProgram ' + X11BASE +
'/include/GL/gl*.h > /dev/null') == 0):
+- gllibdirs = [X11BASE + '/lib/', '/usr/lib/', LOCALBASE +
'/lib/']
+- gllibdir = ''
+- for i in gllibdirs:
+- if (os.system('test -f '+i+'libGL.so') == 0):
+- gllibdir = i
+- break
+- if (gllibdir == ''):
+- print('ERROR: no libGL.so detected!')
+- else:
++ if (checkconf == True and os.system('grep glBindProgram ' + X11BASE +
'/include/GL/gl*.h > /dev/null') == 0):
++ gllibdirs = [X11BASE + '/lib/', '/usr/lib/', LOCALBASE +
'/lib/']
++ gllibdir = ''
++ for i in gllibdirs:
++ if (os.system('test -f '+i+'libGL.so') == 0):
++ gllibdir = i
++ break
++ if (gllibdir == ''):
++ print('ERROR: no libGL.so detected!')
++ else:
+ print('Found GL library "'+gllibdir+'libGL.so"')
+- if (os.system('grep glBindProgram '+gllibdir+'libGL.so >
/dev/null') != 0):
+- print('GL headers declare glBindProgram, but libGL.so
has no such symbol! Ignoring all undefined symbols...')
+- # I'm not sure which option will hopefully fix the
problem... so i use both...
+- env.Append(LINKFLAGS =
'--unresolved-symbols=ignore-all')
+- env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols
-Xlinker ignore-all')
++ if (os.system('grep glBindProgram '+gllibdir+'libGL.so >
/dev/null') != 0):
++ print('GL headers declare glBindProgram, but libGL.so
has no such symbol! Ignoring all undefined symbols...')
++ # I'm not sure which option will hopefully fix the
problem... so i use both...
++ env.Append(LINKFLAGS =
'--unresolved-symbols=ignore-all')
++ env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols
-Xlinker ignore-all')
+ elif 0 != mingw32:
+ print("Compiling for mingw32 Environment")
+ env = Environment(ENV = os.environ, tools = ['mingw'])
@@ -207,8 +207,6 @@ else:
# Set libpath for real
libpath = [archlib, archlib + '/X11', '/usr/X11R6/lib']
@@ -32,12 +116,12 @@ $OpenBSD: patch-SConstruct,v 1.2 2018/01
gllibdir = i
break
if (gllibdir == ''):
- print 'ERROR: no libGL.so detected!'
+ print('ERROR: no libGL.so detected!')
else:
- print 'Found GL library "'+gllibdir+'libGL.so"'
+ print('Found GL library "'+gllibdir+'libGL.so"')
- if (os.system('grep glBindProgram '+gllibdir+'libGL.so >
/dev/null') != 0):
+ if (os.system('grep glBindProgram '+gllibdir+'libGL.so* >
/dev/null') != 0):
- print 'GL headers declare glBindProgram, but libGL.so
has no such symbol! Ignoring all undefined symbols...'
+ print('GL headers declare glBindProgram, but libGL.so
has no such symbol! Ignoring all undefined symbols...')
# I'm not sure which option will hopefully fix the
problem... so i use both...
env.Append(LINKFLAGS =
'--unresolved-symbols=ignore-all')
@@ -289,6 +286,12 @@ target_dir = '#build' + os.sep + build_dir
@@ -53,3 +137,12 @@ $OpenBSD: patch-SConstruct,v 1.2 2018/01
################ configure
if(checkconf == True):
+@@ -347,7 +350,7 @@ Export('env', 'gfxlibs', 'alllibs', 'installbindir', '
+
+ SConscript(source_base_dir + os.sep + 'SConscript', build_dir = target_dir,
duplicate = 0)
+
+-BuildDir(target_dir, source_base_dir, duplicate=0)
++VariantDir(target_dir, source_base_dir, duplicate=0)
+
+ ############### Helper functions
+ def findSVN(basedir):