diff options
| author | Kyungdahm Yun | 2014-07-27 23:32:38 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2014-07-28 09:55:29 +0100 |
| commit | 5770b3b01e59f85941da2c207f787daa76f53d0d (patch) | |
| tree | 1dff9b9525b310cc182e2b7d33a71308e30e278f /Library/Formula | |
| parent | b8250a9105a6c66abf4c0f37e75e5a2f367bba9f (diff) | |
| download | homebrew-5770b3b01e59f85941da2c207f787daa76f53d0d.tar.bz2 | |
fpc 2.6.4 (new formula)
Added a new formula for Free Pascal compiler.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/fpc.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Library/Formula/fpc.rb b/Library/Formula/fpc.rb new file mode 100644 index 000000000..60851677d --- /dev/null +++ b/Library/Formula/fpc.rb @@ -0,0 +1,35 @@ +require "formula" + +class Fpc < Formula + homepage "http://www.freepascal.org/" + url "https://downloads.sourceforge.net/project/freepascal/Source/2.6.4/fpc-2.6.4.source.tar.gz" + sha1 "60eeadf65db25b10b174627457a5799bf0fd0d52" + + resource "bootstrap" do + url "https://downloads.sourceforge.net/project/freepascal/Bootstrap/2.6.4/universal-macosx-10.5-ppcuniversal.tar.bz2" + sha1 "1476a19ad7f901868fcbe3dc49e6d46a5865f722" + end + + def install + fpc_bootstrap = buildpath/"bootstrap" + resource("bootstrap").stage { fpc_bootstrap.install Dir["*"] } + + fpc_compiler = fpc_bootstrap/"ppcuniversal" + system "make", "build", "PP=#{fpc_compiler}" + system "make", "install", "PP=#{fpc_compiler}", "PREFIX=#{prefix}" + + bin.install_symlink lib/"#{name}/#{version}/ppcx64" + end + + test do + hello = <<-EOS.undent + program Hello; + begin + writeln('Hello Homebrew') + end. + EOS + (testpath/"hello.pas").write(hello) + system "#{bin}/fpc", "hello.pas" + assert_equal "Hello Homebrew", `./hello`.strip + end +end |
