'APPLICATION.products.cmake' : 'native' # TTK requires cmake > 3.21
'APPLICATION.products.cftime' : 'native'
'APPLICATION.products.h5py' : 'native'
- 'APPLICATION.products.meshio' : 'native'
+ 'APPLICATION.products.meshio' : {tag: '5.3.5' , base: 'no', section: 'version_5_3_5_no_pip' }
'APPLICATION.products.netCDF4' : 'native'
'APPLICATION.products.rich' : 'native'
'APPLICATION.products.cminpack' : 'native'
'APPLICATION.products.h5py' : 'native'
'APPLICATION.products.markdown_it_py' : 'native'
'APPLICATION.products.mdurl' : 'native'
- 'APPLICATION.products.meshio' : 'native'
+ 'APPLICATION.products.meshio' : {tag: '5.3.5', base: 'no', section: 'version_5_3_5_no_pip'}
'APPLICATION.products.netCDF4' : 'native'
'APPLICATION.products.rich' : 'native'
'APPLICATION.products.opencv' : {tag: '3.2.0', base: 'no', section: 'version_3_2_0_DB12'}
'APPLICATION.products.h5py' : 'native'
'APPLICATION.products.markdown_it_py' : 'native'
'APPLICATION.products.mdurl' : 'native'
- 'APPLICATION.products.meshio' : 'native'
+ 'APPLICATION.products.meshio' : {tag: '5.3.4', base: 'no', section: 'version_5_3_4_no_pip'}
'APPLICATION.products.netCDF4' : 'native'
'APPLICATION.products.rich' : 'native'
'APPLICATION.products.opencv' : {tag: '3.2.0', base: 'no', section: 'version_3_2_0_DB12'}
;;
esac
+pyVersionMajor=python$($PYTHONBIN -c 'import sys; print(".".join(map(str, sys.version_info[0:1])))')
+if [ $? -ne 0 ]; then
+ echo ERROR: Failed to extract major Python version - assuming Python version equal to 3...
+ pyVersionMajor=python3
+fi
+
+echo INFO: Python version major: ${pyVersionMajor}
+if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/bin/meshio ]; then
+ sed -i "s%#\!.*python[0-9]*%#\!/usr/bin/env ${pyVersionMajor}%#g" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/bin/meshio
+else
+ echo "FATAL: could not find meshio runner!"
+ exit 1
+fi
+
+# bos #42618 - https://github.com/nschloe/meshio/issues/1484
+if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/gmsh/main.py ]; then
+ sed -i '/"gmsh22"/a \ \ \ \ \ \ \ \ "gmsh40": lambda f, m, **kwargs: write(f, m, "4.0", **kwargs),' $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/gmsh/main.py
+else
+ echo "FATAL: could not find gmsh meshio driver!"
+ exit 1
+fi
+
+# spns #42665
+if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py ]; then
+ # retrieve line number
+ l=$(grep -nA0 "raise KeyError" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py|cut -d':' -f1)
+ L=$(($l+2))
+ sed -i 's/raise KeyError(/warn(/g' $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py
+ # move to next cell
+ sed -i "${L}s/)/)\n continue/g" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py
+else
+ echo "FATAL: could not find ansys meshio driver!"
+ exit 1
+fi
+
echo
echo "########## END"
pyVersionMajor=python$($PYTHONBIN -c 'import sys; print(".".join(map(str, sys.version_info[0:1])))')
if [ $? -ne 0 ]; then
- echo ERROR: Failed to extract major Python version - assuming Python version equal to 3...
- pyVersionMajor=python3
+ echo ERROR: Failed to extract major Python version - assuming Python version equal to 3...
+ pyVersionMajor=python3
fi
+
echo INFO: Python version major: ${pyVersionMajor}
if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/bin/meshio ]; then
sed -i "s%#\!.*python[0-9]*%#\!/usr/bin/env ${pyVersionMajor}%#g" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/bin/meshio
exit 1
fi
+# bos #42618 - https://github.com/nschloe/meshio/issues/1484
+if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/gmsh/main.py ]; then
+ sed -i '/"gmsh22"/a \ \ \ \ \ \ \ \ "gmsh40": lambda f, m, **kwargs: write(f, m, "4.0", **kwargs),' $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/gmsh/main.py
+else
+ echo "FATAL: could not find gmsh meshio driver!"
+ exit 1
+fi
+
+# spns #42665
+if [ -f $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py ]; then
+ # retrieve line number
+ l=$(grep -nA0 "raise KeyError" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py|cut -d':' -f1)
+ L=$(($l+2))
+ sed -i 's/raise KeyError(/warn(/g' $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py
+ # move to next cell
+ sed -i "${L}s/)/)\n continue/g" $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages/meshio/ansys/_ansys.py
+else
+ echo "FATAL: could not find ansys meshio driver!"
+ exit 1
+fi
+
echo
echo "########## END"