From: crouzet Date: Thu, 11 Mar 2021 14:31:10 +0000 (+0100) Subject: ajout psutil pour pouvoir tester la branche occ/psutil X-Git-Tag: V9_7_0~87 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77708f68b06e3ad6ec75307b21084da64097e7ea;p=tools%2Fsat_salome.git ajout psutil pour pouvoir tester la branche occ/psutil --- diff --git a/products/compil_scripts/psutil.sh b/products/compil_scripts/psutil.sh new file mode 100755 index 0000000..b45c315 --- /dev/null +++ b/products/compil_scripts/psutil.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +echo "##########################################################################" +echo "psutil" $VERSION +echo "##########################################################################" + + + +echo "*** build in SOURCE directory" +cd $SOURCE_DIR + +# we don't install in python directory -> modify environment as described in INSTALL file +mkdir -p $PRODUCT_INSTALL/lib/python${PYTHON_VERSION:0:3}/site-packages +export PATH=$(pwd)/bin:$PATH +export PYTHONPATH=$(pwd):$PYTHONPATH +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION:0:3}/site-packages:$PYTHONPATH + +echo +echo "*** build and install with $PYTHONBIN" +$PYTHONBIN setup.py install --prefix=$PRODUCT_INSTALL +if [ $? -ne 0 ] +then + echo "ERROR on build/install" + exit 3 +fi + +echo +echo "######psutil END" diff --git a/products/env_scripts/psutil.py b/products/env_scripts/psutil.py new file mode 100644 index 0000000..248ed43 --- /dev/null +++ b/products/env_scripts/psutil.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path, platform + +def set_env(env, prereq_dir, version): + env.set("PSUTIL_ROOT_DIR",prereq_dir) + + versionPython = env.get('PYTHON_VERSION') + if not platform.system() == "Windows" : + env.prepend('PYTHONPATH',os.path.join(prereq_dir, 'lib', 'python' + versionPython, 'site-packages')) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH',os.path.join(prereq_dir, 'bin')) + +def set_nativ_env(env): + pass diff --git a/products/psutil.pyconf b/products/psutil.pyconf new file mode 100755 index 0000000..344e3cf --- /dev/null +++ b/products/psutil.pyconf @@ -0,0 +1,33 @@ +default : +{ + name : "psutil" + build_source : "script" + compil_script : 'pip_install' + $VARS.scriptExtension + get_source : "archive" + system_info : + { + rpm : ["python3-psutil"] + rpm_dev : [] + apt : ["python3-psutil"] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ['Python', 'setuptools'] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties: + { + incremental : "yes" + pip : "yes" + } +} + +default_win : +{ + compil_script : 'pip_install_whl' + $VARS.scriptExtension + archive_info : {archive_name : "psutil-" + $APPLICATION.products.psutil + "_windows.tar.gz"} +}