Skip to content

Instantly share code, notes, and snippets.

@fritschy
Last active August 29, 2015 14:20
Show Gist options
  • Save fritschy/24dda06290dcc4e705e7 to your computer and use it in GitHub Desktop.
Save fritschy/24dda06290dcc4e705e7 to your computer and use it in GitHub Desktop.
Install Pebble SDK on a Debian SID x86-64 (status 2015-05-04)
#!/bin/zsh
# Install pebble SDK in ~/opt/$pebble-sdk-rootdir-name and apply some patches
# This method of installing still worked as of 20150-05-04
# Usage: $0 "$pebble-sdk-tarball"
set -e
tar -C ~/opt -xvf "$1"
tar -tf "$1" | head -n1 | read d
cd ~/opt/$d
tc=http://assets.getpebble.com.s3-website-us-east-1.amazonaws.com/sdk/arm-cs-tools-ubuntu-universal.tar.gz
sdkp=${1:h}/${tc:t}
test -e ${sdkp} || wget -O${sdkp} $tc
tar xzvf ${sdkp}
sudo apt install python-pip python2.7-dev python-virtualenv
virtualenv --no-site-packages .env
source .env/bin/activate
pip install -r requirements.txt
deactivate
# emulator deps, not needed everywhere
#sudo apt-get install libsdl1.2debian libfdt1 libpixman-1-0
pushd .env/lib/python2.7/site-packages
patch -p0 << -EOF
--- sh.py.orig 2015-05-01 11:03:25.101938091 +0200
+++ sh.py 2015-05-01 11:05:35.298583701 +0200
@@ -192,7 +192,7 @@
def which(program):
def is_exe(fpath):
- return os.path.exists(fpath) and os.access(fpath, os.X_OK)
+ return os.path.exists(fpath) and os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
-EOF
popd
@fritschy
Copy link
Author

As of SDK beta11 the gevent ssl patch is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment