Skip to content

Commit

Permalink
added installers for python 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
soldni committed Jul 7, 2016
1 parent 83ba65c commit d781d77
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
20 changes: 20 additions & 0 deletions install_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CURRENT_DIR=`pwd`

# get the directory of the script (from: http://stackoverflow.com/a/246128)
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

cd $SCRIPT_DIR/swig/python
sh prepare.sh
python setup.py.in build_ext --inplace

mkdir $SCRIPT_DIR/release
cp simstring.py $SCRIPT_DIR/release/
cp _simstring*.so $SCRIPT_DIR/release/

cd $CURRENT_DIR
20 changes: 20 additions & 0 deletions install_python3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CURRENT_DIR=`pwd`

# get the directory of the script (from: http://stackoverflow.com/a/246128)
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SCRIPT_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

cd $SCRIPT_DIR/swig/python
sh prepare.sh
python3 setup.py.in build_ext --inplace

mkdir $SCRIPT_DIR/release
cp simstring.py $SCRIPT_DIR/release/
cp _simstring*.so $SCRIPT_DIR/release/

cd $CURRENT_DIR

0 comments on commit d781d77

Please sign in to comment.