From d266e500bb6b21f2b4465a87d39b348bf0cc5d08 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 16 Sep 2013 19:21:20 -0500 Subject: [PATCH] erlang: use resources --- Formula/erlang.rb | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/Formula/erlang.rb b/Formula/erlang.rb index 559c4268e2..1259d3982e 100644 --- a/Formula/erlang.rb +++ b/Formula/erlang.rb @@ -1,25 +1,5 @@ require 'formula' -class ErlangManuals < Formula - url 'http://erlang.org/download/otp_doc_man_R16B01.tar.gz' - sha1 '57ef01620386108db83ef13921313e600d351d44' -end - -class ErlangHtmls < Formula - url 'http://erlang.org/download/otp_doc_html_R16B01.tar.gz' - sha1 '6741e15e0b3e58736987e38fb8803084078ff99f' -end - -class ErlangHeadManuals < Formula - url 'http://erlang.org/download/otp_doc_man_R16B01.tar.gz' - sha1 '57ef01620386108db83ef13921313e600d351d44' -end - -class ErlangHeadHtmls < Formula - url 'http://erlang.org/download/otp_doc_html_R16B01.tar.gz' - sha1 '6741e15e0b3e58736987e38fb8803084078ff99f' -end - # Major releases of erlang should typically start out as separate formula in # Homebrew-versions, and only be merged to master when things like couchdb and # elixir are compatible. @@ -38,6 +18,16 @@ class Erlang < Formula sha1 '65f9b0d2ea1a7d12d0477f51e3d5cc0415361789' => :snow_leopard end + resource 'man' do + url 'http://erlang.org/download/otp_doc_man_R16B01.tar.gz' + sha1 '57ef01620386108db83ef13921313e600d351d44' + end + + resource 'html' do + url 'http://erlang.org/download/otp_doc_html_R16B01.tar.gz' + sha1 '6741e15e0b3e58736987e38fb8803084078ff99f' + end + option 'disable-hipe', "Disable building hipe; fails on various OS X systems" option 'halfword', 'Enable halfword emulator (64-bit builds only)' option 'time', '`brew test --time` to include a time-consuming test' @@ -93,10 +83,8 @@ class Erlang < Formula system "make install" unless build.include? 'no-docs' - manuals = build.head? ? ErlangHeadManuals : ErlangManuals - manuals.new.brew { (lib/'erlang').install 'man' } - htmls = build.head? ? ErlangHeadHtmls : ErlangHtmls - htmls.new.brew { doc.install Dir['*'] } + resource('man').stage { (lib/'erlang').install 'man' } + doc.install resource('html') end end