2014-08-18 17:24:41 +00:00
|
|
|
class Ldc < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Portable D programming language compiler"
|
2016-04-17 22:27:05 +00:00
|
|
|
homepage "https://wiki.dlang.org/LDC"
|
2016-01-14 21:03:50 +00:00
|
|
|
|
2016-06-06 08:56:46 +00:00
|
|
|
stable do
|
|
|
|
url "https://github.com/ldc-developers/ldc/releases/download/v1.0.0/ldc-1.0.0-src.tar.gz"
|
|
|
|
sha256 "3740ee6d5871e953aeb03b11f9d8c951286a55884892b51981bfe579b8fe571d"
|
2016-02-26 23:46:31 +00:00
|
|
|
|
|
|
|
resource "ldc-lts" do
|
2016-05-18 13:25:36 +00:00
|
|
|
url "https://github.com/ldc-developers/ldc/releases/download/v0.17.1/ldc-0.17.1-src.tar.gz"
|
|
|
|
sha256 "8f5453e4e0878110ab03190ae9313ebbb323884090e6e7db87b02e5ed6a1c8b0"
|
2016-02-26 23:46:31 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-06-06 08:56:46 +00:00
|
|
|
bottle do
|
2016-06-06 09:12:59 +00:00
|
|
|
sha256 "202cc64a372c558e2f752d64446eacd46c1b9e791a26e93016ffdccde3350a12" => :el_capitan
|
|
|
|
sha256 "70bf744992f230abb734bc42597b8480c8199378897433804f0ef8798a68d386" => :yosemite
|
|
|
|
sha256 "2be73f41697c5e86f0c71974f02339f35e51fe52f130ac191d6c0a5e0f49006b" => :mavericks
|
2016-06-06 08:56:46 +00:00
|
|
|
end
|
|
|
|
|
2016-02-26 23:46:31 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/ldc-developers/ldc.git", :shallow => false
|
|
|
|
|
|
|
|
resource "ldc-lts" do
|
|
|
|
url "https://github.com/ldc-developers/ldc.git", :shallow => false, :branch => "ltsmaster"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-15 10:24:25 +00:00
|
|
|
needs :cxx11
|
|
|
|
|
2014-08-18 17:24:41 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "llvm" => :build
|
|
|
|
depends_on "libconfig"
|
|
|
|
|
|
|
|
def install
|
2014-12-15 10:24:25 +00:00
|
|
|
ENV.cxx11
|
2016-06-06 08:56:46 +00:00
|
|
|
(buildpath/"ldc-lts").install resource("ldc-lts")
|
|
|
|
cd "ldc-lts" do
|
2016-02-26 23:46:31 +00:00
|
|
|
mkdir "build" do
|
2016-06-06 08:56:46 +00:00
|
|
|
system "cmake", "..", *std_cmake_args
|
2016-02-26 23:46:31 +00:00
|
|
|
system "make"
|
|
|
|
end
|
2014-08-18 17:24:41 +00:00
|
|
|
end
|
2016-06-06 08:56:46 +00:00
|
|
|
mkdir "build" do
|
|
|
|
system "cmake", "..", "-DINCLUDE_INSTALL_DIR=#{include}/dlang/ldc", "-DD_COMPILER=#{buildpath}/ldc-lts/build/bin/ldmd2", *std_cmake_args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
2014-08-18 17:24:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.d").write <<-EOS.undent
|
|
|
|
import std.stdio;
|
|
|
|
void main() {
|
|
|
|
writeln("Hello, world!");
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
2015-07-26 21:59:28 +00:00
|
|
|
system "#{bin}/ldc2", "test.d"
|
2014-08-18 17:24:41 +00:00
|
|
|
system "./test"
|
2015-07-26 21:59:28 +00:00
|
|
|
system "#{bin}/ldmd2", "test.d"
|
2014-08-18 17:24:41 +00:00
|
|
|
system "./test"
|
|
|
|
end
|
|
|
|
end
|