git: 35fb1d00124f - main - french/aster: switch to HDF5-1.10

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Fri, 16 Sep 2022 11:11:58 UTC
The branch main has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=35fb1d00124f54c95c798525f67fcd8877c136b0

commit 35fb1d00124f54c95c798525f67fcd8877c136b0
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-09-16 11:01:42 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-09-16 11:07:05 +0000

    french/aster: switch to HDF5-1.10
    
    Note: this port should be upgraded to a newer release, WIP.
    
    PR:             265152
---
 french/aster/Makefile                       |  7 +++---
 french/aster/files/patch-as_setup.py        | 12 ++++++++--
 french/aster/files/patch-products.py        | 35 ++++++++++++++++++++++++++++-
 french/aster/files/patch-products__data.py  | 17 ++++++++++++--
 french/aster/files/pkg-message.in           |  4 ++--
 french/aster/files/pkg-message.sans-astk.in |  4 ++--
 6 files changed, 67 insertions(+), 12 deletions(-)

diff --git a/french/aster/Makefile b/french/aster/Makefile
index e39c63462a75..b7116ce818ea 100644
--- a/french/aster/Makefile
+++ b/french/aster/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	aster
 DISTVERSION=	${ASTER_DISTVERSION}
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	french cad
 
 MAINTAINER=	thierry@FreeBSD.org
@@ -34,7 +34,7 @@ BUILD_DEPENDS+=	astk-serveur>0:cad/astk-serveur	\
 		${PYNUMPY}	\
 		${PYTHON_PKGNAMEPREFIX}sympy>0:math/py-sympy@${PY_FLAVOR}
 #		pylupdate5:textproc/py-qt5-xml
-LIB_DEPENDS+=	libhdf5.so:science/hdf5				\
+LIB_DEPENDS+=	libhdf5-110.so:science/hdf5-110			\
 		libscotch.so:cad/scotch				\
 		libmetis.so:math/metis				\
 		libmed.so:french/med				\
@@ -52,6 +52,7 @@ USE_QT=		linguisttools:build
 #CONFLICTS_BUILD=${PYTHON_PKGNAMEPREFIX}cysignals-1.*
 
 HAS_CONFIGURE=	yes
+CFLAGS+=	-I${LOCALBASE}/include/hdf5-110
 MAKE_ENV=	INCLUDES="${LOCALBASE}/include"	\
 		INCLUDEDIR="${LOCALBASE}/include"	\
 		LD_PRELOAD="${LOCALBASE}/lib/gcc${_GCC_VER}/libgcc_s.so.1"	\
@@ -255,7 +256,7 @@ pre-configure:
 	${ECHO_CMD} "HOME_GMSH = '${LOCALBASE}'"		>> ${WRKSRC}/setup.cfg
 	${ECHO_CMD} "HOME_GIBI = '${LOCALBASE}'"		>> ${WRKSRC}/setup.cfg
 	${ECHO_CMD} "HOME_HOMARD = '${LOCALBASE}'"		>> ${WRKSRC}/setup.cfg
-	${ECHO_CMD} "INCLUDEDIR = ['${LOCALBASE}/include', '${LOCALBASE}/include/metis', ]"\
+	${ECHO_CMD} "INCLUDEDIR = ['${LOCALBASE}/include/hdf5-110', '${LOCALBASE}/include', '${LOCALBASE}/include/metis', ]"\
 			>> ${WRKSRC}/setup.cfg
 	${ECHO_CMD} "HOME_MUMPS = '${LOCALBASE}'"		>> ${WRKSRC}/setup.cfg
 	${ECHO_CMD} "HOME_MFRONT = '${LOCALBASE}'"		>> ${WRKSRC}/setup.cfg
diff --git a/french/aster/files/patch-as_setup.py b/french/aster/files/patch-as_setup.py
index 2175b43e8fb3..cb6459f293d7 100644
--- a/french/aster/files/patch-as_setup.py
+++ b/french/aster/files/patch-as_setup.py
@@ -1,6 +1,6 @@
 --- as_setup.py.orig	2020-10-26 15:54:27 UTC
 +++ as_setup.py
-@@ -45,6 +45,8 @@ import tarfile
+@@ -45,6 +45,8 @@ import pprint
  import compileall
  import imp
  import pprint
@@ -17,7 +17,7 @@
        self._print(self._fmt_title % _('Extraction'))
        if kargs.get('external')!=None:
           self._call_external(**kargs)
-@@ -518,6 +521,88 @@ class SETUP:
+@@ -518,6 +521,96 @@ class SETUP:
        os.chdir(prev)
        if iextr_as:
           self.Clean(to_delete=path)
@@ -31,6 +31,14 @@
 +         if nl > 0:
 +            ligne =ligne.replace("self.check_cc", "# self.check_cc")
 +         sys.stdout.write(ligne)
++      file2patch = os.path.join(self.workdir, self.content, 'waftools/med.py')
++      self._print('FreeBSD patch: use hdf5-110 ' + file2patch)
++      for ligne in fileinput.input(file2patch, inplace=1):
++         nl = 0
++         nl = ligne.find("self.env.INCLUDEDIR, 'hdf5'")
++         if nl > 0:
++            ligne =ligne.replace("'hdf5'", "'hdf5-110'")
++         sys.stdout.write(ligne)
 + #     file2patch = os.path.join(self.workdir, self.content, 'bibcxx/wscript')
 + #     self._print('FreeBSD patch: explicit link with libc++ required since Gcc 4.9 => modify ' + file2patch)
 + #     for ligne in fileinput.input(file2patch, inplace=1):
diff --git a/french/aster/files/patch-products.py b/french/aster/files/patch-products.py
index 8716b06abfe5..e6c402ae1fe0 100644
--- a/french/aster/files/patch-products.py
+++ b/french/aster/files/patch-products.py
@@ -1,6 +1,26 @@
 --- products.py.orig	2020-10-26 15:54:27 UTC
 +++ products.py
-@@ -658,7 +658,8 @@ def setup_mumps(dep, summary, **kargs):
+@@ -136,8 +136,8 @@ def setup_hdf5(dep, summary, **kargs):
+ 
+       actions=(
+          ('IsInstalled', { 'filename' :
+-             [osp.join('__setup.installdir__', 'lib', 'libhdf5.a'),
+-              osp.join('__setup.installdir__', 'include', 'hdf5.h')]
++             [osp.join('__setup.installdir__', 'lib', 'libhdf5-110.a'),
++              osp.join('__setup.installdir__', 'include/hdf5-110', 'hdf5.h')]
+          } ),
+          ('Extract'  , {}),
+          # gcc>=4.9 not supported by configure, should not use -ansi
+@@ -651,14 +651,15 @@ def setup_mumps(dep, summary, **kargs):
+          ('Configure', {
+             'command'   : '%(PYTHON_ALIAS)s ; CC=%(CC)s FC=%(F90)s '
+                           'LIBPATH="%(HOME_SCOTCH)s/lib %(HOME_METIS)s/lib" '
+-                          'INCLUDES="%(HOME_SCOTCH)s/include %(HOME_METIS)s/include" '
++                          'INCLUDES="%(HOME_HDF)s/include/hdf5-110 %(HOME_SCOTCH)s/include %(HOME_METIS)s/include" '
+                           'OPTLIB_FLAGS="%(MATHLIB)s %(OTHERLIB)s" '
+-                          './waf configure --maths-libs="" '
++                          './waf configure --maths-libs="" --hdf5-libs="hdf5-110"'
+                           '   --prefix=%(HOME_MUMPS)s --install-tests' % cfg,
              'capturestderr' : False,
           }),
           ('Make'     , {
@@ -20,3 +40,16 @@
        set=['LIBPATH_HDF', 'LIBPATH_MED', 'LIBPATH_METIS', 'LIBPATH_SCOTCH',
             'LIBPATH_MUMPS', 'LIBPATH_MFRONT'],
        reqobj=['file:?ASTER_ROOT?/bin/as_run',
+@@ -736,9 +738,9 @@ def setup_aster(dep, summary, **kargs):
+    os.environ['DEVTOOLS_COMPUTER_ID'] = cfg['DEVTOOLS_COMPUTER_ID']
+    if cfg['ASTER_NUMVERS'] < (15, 2):
+       WAF_ENV = ""
+-      WAF_CONFIGURE = ("./waf configure"
+-                       " --use-config=aster_full_config"
+-                       " --install-tests --prefix=%(ASTER_VERSION_DIR)s")
++      WAF_CONFIGURE = ('./waf configure'
++                       ' --use-config=aster_full_config --hdf5-libs="hdf5-110"'
++                       ' --install-tests --prefix=%(ASTER_VERSION_DIR)s')
+    else:
+       WAF_ENV = ". env.d/aster_full_std.sh ; "
+       WAF_CONFIGURE = ("./waf configure"
diff --git a/french/aster/files/patch-products__data.py b/french/aster/files/patch-products__data.py
index 9c8798c1d5f9..cdecfc5160f3 100644
--- a/french/aster/files/patch-products__data.py
+++ b/french/aster/files/patch-products__data.py
@@ -1,7 +1,20 @@
 --- products_data.py.orig	2020-10-26 15:54:27 UTC
 +++ products_data.py
-@@ -130,10 +130,8 @@ def configure(self):
-         '%(HOME_HDF)s/include',
+@@ -48,7 +48,7 @@ export LIBPATH_HDF5="%(LIBPATH_HDF)s"
+ export PYPATH_ASRUN="%(ASTER_ROOT)s/lib/python%(PYTHON_XY)s/site-packages"
+ 
+ export LIBPATH_HDF5="%(LIBPATH_HDF)s"
+-export INCLUDES_HDF5="%(HOME_HDF)s/include"
++export INCLUDES_HDF5="%(HOME_HDF)s/include/hdf5-110"
+ 
+ export LIBPATH_MED="%(LIBPATH_MED)s"
+ export INCLUDES_MED="%(HOME_MED)s/include"
+@@ -127,13 +127,11 @@ def configure(self):
+     ])
+ 
+     self.env.append_value('INCLUDES', [
+-        '%(HOME_HDF)s/include',
++        '%(HOME_HDF)s/include/hdf5-110',
          '%(HOME_MED)s/include',
          '%(HOME_MUMPS)s/include',
 -        '%(HOME_MUMPS)s/include_seq',
diff --git a/french/aster/files/pkg-message.in b/french/aster/files/pkg-message.in
index 681be696d208..74acde3ab3b0 100644
--- a/french/aster/files/pkg-message.in
+++ b/french/aster/files/pkg-message.in
@@ -4,8 +4,8 @@
 To run Code_Aster through ASTK, type:
 %%tools_dir%%/astk
 
-On i386 or amd64 platforms, we suggest you install the ports french/gibi
-and french/homard, two additional meshing tools.
+On i386 or amd64 platforms, we suggest you install the port french/homard,
+an additional meshing tool.
 EOM
 }
 ]
diff --git a/french/aster/files/pkg-message.sans-astk.in b/french/aster/files/pkg-message.sans-astk.in
index 4dd8b0fd588e..f14a1dcc93bd 100644
--- a/french/aster/files/pkg-message.sans-astk.in
+++ b/french/aster/files/pkg-message.sans-astk.in
@@ -5,8 +5,8 @@ After Code_Aster installation you could install ASTK
 [cad/astk-serveur and cad/astk-client].
 ASTK is a graphic interface to run Code_Aster.
 
-On i386 platform, we suggest you install the ports french/gibi and
-french/homard, two additional meshing tools.
+On i386 platform, we suggest you install the port french/homard,
+an additional meshing tool.
 EOM
 }
 ]