Skip to content

Instantly share code, notes, and snippets.

@txomon
Last active December 28, 2015 23:58
Show Gist options
  • Save txomon/7582355 to your computer and use it in GitHub Desktop.
Save txomon/7582355 to your computer and use it in GitHub Desktop.
Activator for python environment
alias activate="source activate_environment"

Files

.bash_aliases should be cat-ed >> to the .bash_aliases
activate_environment should be copied to a $PATH dir
activate.patch should be aplied to the bin/activate script
--- bin/activate 2013-11-25 20:52:47.237686899 +0100
+++ bin/activate 2013-10-25 02:37:31.005159153 +0200
@@ -46,2 +46,22 @@ export PATH
+LD_LIBRARY_PATH="$VIRTUAL_ENV/lib"
+export LD_LIBRARY_PATH
+
+CMAKE_PREFIX_PATH="$VIRTUAL_ENV"
+export CMAKE_PREFIX_PATH
+
+CMAKE_INSTALL_PREFIX="$VIRTUAL_ENV"
+export CMAKE_INSTALL_PREFIX
+
+C_INCLUDE_PATH="$VIRTUAL_ENV/include"
+export C_INCLUDE_PATH
+
+CMAKE_LIBRARY_PATH="$VIRTUAL_ENV/lib"
+export CMAKE_LIBRARY_PATH
+
+LIBRARY_PATH="$VIRTUAL_ENV/lib"
+export LIBRARY_PATH
+
+alias cmake="cmake -D CMAKE_INSTALL_PREFIX='$CMAKE_INSTALL_PREFIX' "
+
# unset PYTHONHOME if set
oldpwd=$PWD
while true; do
if [ -f "$PWD/bin/activate" ]; then
source $PWD/bin/activate
break
elif [ -f "$PWD/ve/bin/activate" ]; then
source $PWD/ve/bin/activate
break
else
cd ..
if [ "$PWD" == "/" ]; then
break
fi
fi
done
cd $oldpwd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment