Last active
March 27, 2017 06:40
-
-
Save migueldiascosta/a2aa26112142732a35a38490a9f3d66b to your computer and use it in GitHub Desktop.
standalone_easybuild.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOPDIR=standalone_easybuild | |
if [ -d $TOPDIR ] | |
then | |
rm -rf $TOPDIR | |
fi | |
mkdir $TOPDIR | |
VSC_BASE_VERSION=2.5.7 | |
VSC_INSTALL_VERSION=0.10.25 | |
EASYBUILD_VERSION=3.1.0 | |
wget -c https://pypi.io/packages/source/v/vsc-base/vsc-base-$VSC_BASE_VERSION.tar.gz | |
wget -c https://pypi.io/packages/source/v/vsc-install/vsc-install-$VSC_INSTALL_VERSION.tar.gz | |
wget -c https://pypi.io/packages/source/e/easybuild-framework/easybuild-framework-$EASYBUILD_VERSION.tar.gz | |
wget -c https://pypi.io/packages/source/e/easybuild-easyblocks/easybuild-easyblocks-$EASYBUILD_VERSION.tar.gz | |
wget -c https://pypi.io/packages/source/e/easybuild-easyconfigs/easybuild-easyconfigs-$EASYBUILD_VERSION.tar.gz | |
for i in *.tar.gz | |
do | |
tar xf $i --strip-components=1 -C $TOPDIR | |
done | |
PEP8_VERSION=1.7.0 | |
wget -c https://pypi.io/packages/source/p/pep8/pep8-$PEP8_VERSION.tar.gz -P vendored | |
for i in vendored/*.tar.gz | |
do | |
tar xf $i -C vendored | |
done | |
cp vendored/pep8-$PEP8_VERSION/pep8.py $TOPDIR/lib/ | |
# replace setuptools.declare_namespace with pkgutil.extend_path | |
#find . -name __init__.py -exec sed -i '/pkg_resources/d' {} \; | |
find $TOPDIR -name __init__.py -exec sed -i 's/import pkg_resources/from pkgutil import extend_path/' {} \; | |
find $TOPDIR -name __init__.py -exec sed -i \ | |
's/pkg_resources.declare_namespace(__name__)/__path__ = extend_path(__path__, __name__)/' {} \; | |
sed -i 's/import pkg_resources/from pkgutil import extend_path/' $TOPDIR/easybuild/tools/include.py | |
sed -i 's/pkg_resources.declare_namespace(__name__)/__path__ = extend_path(__path__, __name__)/' \ | |
$TOPDIR/easybuild/tools/include.py | |
# inject $PYTHONPATH and run python with -S | |
cp $TOPDIR/eb $TOPDIR/eb.orig | |
head -n -1 $TOPDIR/eb.orig > $TOPDIR/eb | |
echo "export SCRIPTPATH=\$(dirname \$(readlink -f "\$0"))" >> $TOPDIR/eb | |
echo "export PYTHONPATH=\$SCRIPTPATH:\$SCRIPTPATH/lib:\$PYTHONPATH" >> $TOPDIR/eb | |
echo "\$PYTHON -S -m easybuild.main \"\$@\"" >> $TOPDIR/eb | |
# try running eb | |
export EASYBUILD_MODULES_TOOL=EnvironmentModulesC | |
export EASYBUILD_MODULE_SYNTAX=Tcl | |
$TOPDIR/eb --show-config | |
$TOPDIR/eb --review-pr 4334 | |
$TOPDIR/eb --from-pr 4334 --check-style | |
# tests | |
#sed -i '/fixup_namespace_packages/d' $TOPDIR/test/framework/utilities.py | |
#sed -i "s/if os.path.exists(os.path.join(path/if path and os.path.exists(os.path.join(path/g" $TOPDIR/test/framework/utilities.py | |
## try runnning tests (allowing use of system's setuptools) | |
#export TEST_EASYBUILD_MODULES_TOOL=EnvironmentModulesC | |
#export TEST_EASYBUILD_MODULE_SYNTAX=Tcl | |
#cd $TOPDIR | |
#export PYTHONPATH=$(pwd):$(pwd)/lib:$(pwd)/test/framework/sandbox:$PYTHONPATH; python -O -m test.framework.suite |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment