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"
|
2014-08-18 17:24:41 +00:00
|
|
|
homepage "http://wiki.dlang.org/LDC"
|
2016-02-14 18:17:59 +00:00
|
|
|
url "https://github.com/ldc-developers/ldc/releases/download/v0.17.0/ldc-0.17.0-src.tar.gz"
|
|
|
|
sha256 "6c80086174ca87281413d7510641caf99dc630e6cf228a619d0d989bbf53bdd2"
|
2016-01-14 21:03:50 +00:00
|
|
|
|
2014-08-18 17:41:27 +00:00
|
|
|
bottle do
|
2016-02-14 18:34:03 +00:00
|
|
|
sha256 "c2ff6360645d4deb2ec135b262d257e85228df95e7765adb9e3a625b76250923" => :el_capitan
|
|
|
|
sha256 "551a58a74107f93620af10964ef3128642ae4575ad2be31c618935ced420cd47" => :yosemite
|
|
|
|
sha256 "6d9d60e0a1711a12e03729f273459363873286ce77977801cfbbfc517fc7af1a" => :mavericks
|
2014-08-18 17:41:27 +00:00
|
|
|
end
|
|
|
|
|
2016-02-26 23:46:31 +00:00
|
|
|
devel do
|
|
|
|
url "https://github.com/ldc-developers/ldc/releases/download/v1.0.0-alpha1/ldc-1.0.0-alpha1-src.tar.gz"
|
|
|
|
sha256 "b656437d0d7568c5ac4ef4366376184c06013e79f3dd5a512b18ca9f20df4b63"
|
|
|
|
version "1.0.0-alpha1"
|
|
|
|
|
|
|
|
resource "ldc-lts" do
|
|
|
|
url "https://github.com/ldc-developers/ldc/releases/download/v0.17.0/ldc-0.17.0-src.tar.gz"
|
|
|
|
sha256 "6c80086174ca87281413d7510641caf99dc630e6cf228a619d0d989bbf53bdd2"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
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-02-26 23:46:31 +00:00
|
|
|
if build.stable?
|
|
|
|
mkdir "build" do
|
|
|
|
system "cmake", "..", "-DINCLUDE_INSTALL_DIR=#{include}/dlang/ldc", *std_cmake_args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
else
|
|
|
|
(buildpath/"ldc-lts").install resource("ldc-lts")
|
|
|
|
cd "ldc-lts" do
|
|
|
|
mkdir "build" do
|
|
|
|
system "cmake", "..", *std_cmake_args
|
|
|
|
system "make"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
mkdir "build" do
|
|
|
|
system "cmake", "..", "-DINCLUDE_INSTALL_DIR=#{include}/dlang/ldc", "-DD_COMPILER=../ldc-lts/build/bin/ldmd2", *std_cmake_args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
2014-08-18 17:24:41 +00:00
|
|
|
end
|
|
|
|
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
|