2014-02-02 10:07:25 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Plan9port < Formula
|
|
|
|
homepage "http://swtch.com/plan9port/"
|
2014-03-15 02:34:13 +00:00
|
|
|
url "https://plan9port.googlecode.com/files/plan9port-20140306.tgz"
|
|
|
|
sha1 "b778a96558e2b67be28ae80cab4482ef3082ec0e"
|
2014-02-02 10:07:25 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["PLAN9_TARGET"] = libexec
|
|
|
|
system "./INSTALL"
|
|
|
|
|
|
|
|
libexec.install Dir["*"]
|
|
|
|
bin.install_symlink Dir["#{libexec}/bin/9"]
|
2014-02-02 18:10:57 +00:00
|
|
|
prefix.install Dir["#{libexec}/mac/*.app"]
|
2014-02-02 10:07:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
return printf("Hello World\\n");
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/9", "9c", "test.c"
|
|
|
|
system "#{bin}/9", "9l", "-o", "test", "test.o"
|
|
|
|
assert_equal "Hello World\n", `./test`
|
|
|
|
end
|
|
|
|
end
|