From 1492a07a512686fc8094c4205674c7b940afdac7 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 18 Sep 2013 10:49:13 -0500 Subject: pgplot: use resource --- Library/Formula/pgplot.rb | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'Library/Formula/pgplot.rb') diff --git a/Library/Formula/pgplot.rb b/Library/Formula/pgplot.rb index 670002bf6..eb378f32d 100644 --- a/Library/Formula/pgplot.rb +++ b/Library/Formula/pgplot.rb @@ -1,11 +1,5 @@ require 'formula' -class Button < Formula - url 'http://www.ucm.es/info/Astrof/software/button/button.tar.gz' - sha1 'd1bfcb51a9ce5819e00d5d1a1d8c658691193f11' - version '1.0' -end - class Pgplot < Formula homepage 'http://www.astro.caltech.edu/~tjp/pgplot/' url 'ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot522.tar.gz' @@ -17,6 +11,12 @@ class Pgplot < Formula depends_on :x11 depends_on :fortran + resource 'button' do + url 'http://www.ucm.es/info/Astrof/software/button/button.tar.gz' + sha1 'd1bfcb51a9ce5819e00d5d1a1d8c658691193f11' + version '1.0' + end + def patches # from MacPorts: https://trac.macports.org/browser/trunk/dports/graphics/pgplot/files {:p0 => [ @@ -87,13 +87,10 @@ class Pgplot < Formula (prefix/'examples').install Dir['*demo*', '../examples/pgdemo*.f', '../cpg/cpgdemo*.c', '../drivers/*/pg*demo.*'] end - # install libbutton - if build.include? 'with-button' - Button.new.brew do - inreplace 'Makefile', 'f77', "#{ENV.fc} #{ENV.fcflags}" - system "make" - lib.install 'libbutton.a' - end - end + resource('button').stage do + inreplace 'Makefile', 'f77', "#{ENV.fc} #{ENV.fcflags}" + system "make" + lib.install 'libbutton.a' + end if build.with? 'button' end end -- cgit v1.2.3