From: Nabil Ghodbane Date: Thu, 20 Jun 2024 09:42:33 +0000 (+0200) Subject: spns #41965: meshio: use /usr/bin/env python3 instead of absolute Python path X-Git-Tag: V9_13_0rc2~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=13d86c455d011e589702fe385f8fe7399234feeb;p=tools%2Fsat_salome.git spns #41965: meshio: use /usr/bin/env python3 instead of absolute Python path --- diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index c6aa6ba..96ad50f 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -91,9 +91,9 @@ APPLICATION : medfile : '4.1.1' mesa : '19.0.8' MeshGems : '2.15-1' - meshio : '5.3.5' - mpi4py: {tag: '3.1.0', base: 'no', section : 'version_3_1_0_no_pip'} - metis : '5.1.0' + meshio : {tag: '5.3.5' , base: 'no', section : 'version_5_3_5_no_pip'} + mpi4py : {tag: '3.1.0', base: 'no', section : 'version_3_1_0_no_pip'} + metis : '5.1.0' netgen : '5.3.1_with_CAS_7.8' # comment out line above and uncomment the line below to use Netgen 6. #netgen : '6.2.2101' diff --git a/products/compil_scripts/meshio-5.3.5.sh b/products/compil_scripts/meshio-5.3.5.sh index 62bb011..898f73e 100755 --- a/products/compil_scripts/meshio-5.3.5.sh +++ b/products/compil_scripts/meshio-5.3.5.sh @@ -26,5 +26,18 @@ for WHEEL in "${WHEELS[@]}"; do fi done +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 + echo echo "########## END"