2016-04-15 22:40:59 +00:00
|
|
|
class Micropython < Formula
|
|
|
|
desc "Python implementation for microcontrollers and constrained systems"
|
|
|
|
homepage "https://www.micropython.org/"
|
2016-07-11 10:46:56 +00:00
|
|
|
url "https://github.com/micropython/micropython.git",
|
2016-11-10 14:22:08 +00:00
|
|
|
:tag => "v1.8.6",
|
|
|
|
:revision => "5a1d63fc14dae788f705403a43c2d8639b7dd9cd"
|
2016-04-15 22:40:59 +00:00
|
|
|
|
2016-04-15 22:54:18 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2016-11-10 14:54:26 +00:00
|
|
|
sha256 "1fa57e4d571f8a36358a28318a4f56d78783ff4ddb7487c89d826aa30e3fa0b3" => :sierra
|
|
|
|
sha256 "484eb47c223be42fdad80de0e946c95e0611b1b6cff47cb798153903a9823e13" => :el_capitan
|
|
|
|
sha256 "81a4250412985d5a3a47f790e8bf8a33706071217c183d14f63930555ca580a2" => :yosemite
|
2016-04-15 22:54:18 +00:00
|
|
|
end
|
|
|
|
|
2016-04-15 22:40:59 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2016-10-02 05:53:52 +00:00
|
|
|
depends_on "libffi" # Requires libffi v3 closure API; macOS version is too old
|
2016-04-15 22:40:59 +00:00
|
|
|
|
2016-08-10 23:26:46 +00:00
|
|
|
def install
|
2016-04-15 22:40:59 +00:00
|
|
|
cd "unix" do
|
2016-07-11 10:46:56 +00:00
|
|
|
system "make", "axtls"
|
2016-04-15 22:40:59 +00:00
|
|
|
system "make", "install", "PREFIX=#{prefix}", "V=1"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
# Test the FFI module
|
|
|
|
(testpath/"ffi-hello.py").write <<-EOS.undent
|
|
|
|
import ffi
|
|
|
|
|
|
|
|
libc = ffi.open("libc.dylib")
|
|
|
|
printf = libc.func("v", "printf", "s")
|
|
|
|
printf("Hello!\\n")
|
|
|
|
EOS
|
|
|
|
|
2016-07-11 10:46:56 +00:00
|
|
|
system bin/"micropython", "ffi-hello.py"
|
2016-04-15 22:40:59 +00:00
|
|
|
end
|
|
|
|
end
|