pebble-sdk 2.0.2

- added pypng resource
- removed the dependency from virtualenv
master
Alessio Bogon 2014-03-20 19:23:01 +01:00 committed by Mike McQuaid
parent 9b7f8e93f5
commit 80bba09240
1 changed files with 29 additions and 12 deletions

View File

@ -2,17 +2,19 @@ require 'formula'
class PebbleSdk < Formula
homepage 'https://developer.getpebble.com/2/'
url 'https://s3.amazonaws.com/assets.getpebble.com/sdk2/PebbleSDK-2.0.1.tar.gz'
sha1 'fc9ee49dd1773e4690488328b05bea3a5cbab88e'
url 'https://s3.amazonaws.com/assets.getpebble.com/sdk2/PebbleSDK-2.0.2.tar.gz'
sha1 'c6e2cefb638ebcfffae31c6cc3b175d3e62b3c44'
depends_on 'freetype' => :recommended
depends_on 'mpfr'
depends_on 'gmp'
depends_on 'libmpc'
depends_on 'libelf'
depends_on 'texinfo'
depends_on :macos => :mountain_lion
depends_on :python
depends_on 'freetype' => :recommended
depends_on 'mpfr' => :build
depends_on 'gmp' => :build
depends_on 'libmpc' => :build
depends_on 'libelf' => :build
depends_on 'texinfo' => :build
# List of resources can be obtained from requirements.txt
resource 'pillow' do
url 'https://pypi.python.org/packages/source/P/Pillow/Pillow-2.3.0.zip'
sha1 '0d3fdaa9a8a40a59a66c6057b9f91a3553db852e'
@ -48,20 +50,33 @@ class PebbleSdk < Formula
sha1 '39e6d9a37b826c48eab6959591a174135fc2873c'
end
resource 'pypng' do
url 'https://pypi.python.org/packages/source/p/pypng/pypng-0.0.16.tar.gz'
sha1 'f90a1f88a7875f019b1fc0addde5410ce6daf2dd'
end
resource 'pebble-arm-toolchain' do
url 'https://github.com/pebble/arm-eabi-toolchain/archive/v2.0.tar.gz'
sha1 '7085c6ef371213e3e766a1cbd7e6e1951ccf1d87'
end
def install
# This replacement fixes a path that gets messed up because of the
# bin.env_script_all_files call (which relocates actual pebble.py script
# to libexec/, causing problems with the absolute path expected below).
inreplace 'bin/pebble', /^script_path = .*?$/m, "script_path = '#{libexec}/../tools/pebble.py'"
inreplace 'bin/pebble' do |s|
# This replacement fixes a path that gets messed up because of the
# bin.env_script_all_files call (which relocates actual pebble.py script
# to libexec/, causing problems with the absolute path expected below).
s.gsub! /^script_path = .*?$/m, "script_path = '#{libexec}/../tools/pebble.py'"
# This replacement removes environment settings that were needed only
# if installation was done with the official script
s.gsub! /^local_python_env.*?=.*?\(.*?\)$/m, ""
s.gsub! /^process = subprocess\.Popen\(args, shell=False, env=local_python_env\)/, "process = subprocess.Popen(args, shell=False)"
end
ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
install_args = [ "setup.py", "install", "--prefix=#{libexec}" ]
ENV.append_to_cflags '-Qunused-arguments'
resource('pillow').stage { system "python", *install_args }
resource('freetype-py').stage { system "python", *install_args }
resource('sh').stage { system "python", *install_args }
@ -69,6 +84,8 @@ class PebbleSdk < Formula
resource('autobahn').stage { system "python", *install_args }
resource('websocket-client').stage { system "python", *install_args }
resource('pyserial').stage { system "python", *install_args }
resource('pypng').stage { system "python", *install_args }
ENV.remove_from_cflags '-Qunused-arguments'
prefix.install %w[Documentation Examples Pebble PebbleKit-Android
PebbleKit-iOS bin tools requirements.txt version.txt]