2014-03-14 10:35:33 +00:00
|
|
|
class Mono < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Cross platform, open source .NET development framework"
|
2014-03-14 10:35:33 +00:00
|
|
|
homepage "http://www.mono-project.com/"
|
2015-08-28 16:44:45 +00:00
|
|
|
url "http://download.mono-project.com/sources/mono/mono-4.2.0.179.tar.bz2"
|
|
|
|
sha256 "fc53c825b8f1e83eaa52a681410261a5b0ac47d36ffd2b58581c476c2690933f"
|
2014-08-08 19:22:00 +00:00
|
|
|
|
|
|
|
# xbuild requires the .exe files inside the runtime directories to
|
|
|
|
# be executable
|
|
|
|
skip_clean "lib/mono"
|
2014-03-14 10:35:33 +00:00
|
|
|
|
2014-03-24 15:13:58 +00:00
|
|
|
bottle do
|
2015-09-14 03:09:23 +00:00
|
|
|
sha256 "a3f48223279dd8b2b468511542319e25ca6c29bc266ae1affd5e06114f32640e" => :el_capitan
|
2015-08-28 21:07:33 +00:00
|
|
|
sha256 "0c18edef9deeb162ff119527a3113ee1d98b308f70d266f6f5d66619ecd12d12" => :yosemite
|
|
|
|
sha256 "8b70a9ae0465cbb4648ef3d7042ed8d7aab7d2eca25ae1b8f686696b37ac28aa" => :mavericks
|
|
|
|
sha256 "d3d9b118a27e3af2455925e83de0c44d4464660886c07fe5d21695f21471377a" => :mountain_lion
|
2014-03-24 15:13:58 +00:00
|
|
|
end
|
|
|
|
|
2014-03-14 10:35:33 +00:00
|
|
|
resource "monolite" do
|
2015-08-28 16:44:45 +00:00
|
|
|
url "http://storage.bos.xamarin.com/mono-dist-4.2.0-release/9b/9b990f2b19b1a534925cce3ddaabb70654b76066/monolite-135-latest.tar.gz"
|
|
|
|
sha256 "1529edbf34ebe498d315464e1211e65531ba25c492ba678a5bb079986a784131"
|
2014-05-14 18:38:33 +00:00
|
|
|
end
|
|
|
|
|
2014-03-14 10:35:33 +00:00
|
|
|
def install
|
|
|
|
# a working mono is required for the the build - monolite is enough
|
|
|
|
# for the job
|
|
|
|
(buildpath+"mcs/class/lib/monolite").install resource("monolite")
|
|
|
|
|
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
2015-03-17 14:05:45 +00:00
|
|
|
--disable-dependency-tracking
|
|
|
|
--disable-silent-rules
|
2014-03-14 10:35:33 +00:00
|
|
|
--enable-nls=no
|
|
|
|
]
|
2015-03-17 14:05:45 +00:00
|
|
|
|
2014-03-14 10:35:33 +00:00
|
|
|
args << "--build=" + (MacOS.prefer_64_bit? ? "x86_64": "i686") + "-apple-darwin"
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
# mono-gdb.py and mono-sgen-gdb.py are meant to be loaded by gdb, not to be
|
|
|
|
# run directly, so we move them out of bin
|
|
|
|
libexec.install bin/"mono-gdb.py", bin/"mono-sgen-gdb.py"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
test_str = "Hello Homebrew"
|
2014-08-08 19:22:00 +00:00
|
|
|
test_name = "hello.cs"
|
2015-01-27 15:06:34 +00:00
|
|
|
(testpath/test_name).write <<-EOS.undent
|
2014-03-14 10:35:33 +00:00
|
|
|
public class Hello1
|
|
|
|
{
|
|
|
|
public static void Main()
|
|
|
|
{
|
|
|
|
System.Console.WriteLine("#{test_str}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOS
|
2015-01-27 15:06:34 +00:00
|
|
|
shell_output "#{bin}/mcs #{test_name}"
|
|
|
|
output = shell_output "#{bin}/mono hello.exe"
|
|
|
|
assert_match test_str, output.strip
|
2014-08-08 19:22:00 +00:00
|
|
|
|
|
|
|
# Tests that xbuild is able to execute lib/mono/*/mcs.exe
|
2015-01-27 15:06:34 +00:00
|
|
|
(testpath/"test.csproj").write <<-EOS.undent
|
2014-08-08 19:22:00 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
|
|
<AssemblyName>HomebrewMonoTest</AssemblyName>
|
2015-04-28 08:44:03 +00:00
|
|
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
2014-08-08 19:22:00 +00:00
|
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<Compile Include="#{test_name}" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Import Project="$(MSBuildBinPath)\\Microsoft.CSharp.targets" />
|
|
|
|
</Project>
|
|
|
|
EOS
|
2015-01-27 15:06:34 +00:00
|
|
|
shell_output "#{bin}/xbuild test.csproj"
|
2014-03-14 10:35:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To use the assemblies from other formulae you need to set:
|
|
|
|
export MONO_GAC_PREFIX="#{HOMEBREW_PREFIX}"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|