From 5baaa47d9876c029bc0e8ac2165876f39994ee63 Mon Sep 17 00:00:00 2001 From: Chris Lucas Date: Fri, 20 Sep 2013 22:30:08 -0700 Subject: [PATCH 1/2] initial commit for SPIM --- Library/Formula/spim.rb | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Library/Formula/spim.rb diff --git a/Library/Formula/spim.rb b/Library/Formula/spim.rb new file mode 100644 index 000000000000..39c5028deced --- /dev/null +++ b/Library/Formula/spim.rb @@ -0,0 +1,50 @@ +require 'stringio' + +require 'formula' + +class Spim < Formula + homepage 'http://spimsimulator.sourceforge.net/' + # No source code tarball exists + url 'http://svn.code.sf.net/p/spimsimulator/code', :revision => 606 + version '9.1.9' + + def install + bin.mkpath + system 'cd spim && make' + system 'cd spim && make install' + end + + def patches + # modify Makefile so files install to proper HomeBrew directories + data = DATA.read + data.gsub!('$(bin)', bin) + data.gsub!('$(share)', share) + data.gsub!('$(man1)', man1) + + StringIO.new(data) + end + +end +__END__ +diff --git a/spim/Makefile b/spim/Makefile +index be676a0..a8eded2 100755 +--- a/spim/Makefile ++++ b/spim/Makefile +@@ -66,13 +66,13 @@ DOC_DIR = ../Documentation + + + # Full path for the directory that will hold the executable files: +-BIN_DIR = $(DESTDIR)/usr/bin ++BIN_DIR = $(bin) + + # Full path for the directory that will hold the exception handler: +-EXCEPTION_DIR = $(DESTDIR)/usr/share/spim ++EXCEPTION_DIR = $(share) + + # Full path for the directory that will hold the man files: +-MAN_DIR = $(DESTDIR)/usr/share/man/man1 ++MAN_DIR = $(man1) + + + # If you have flex, use it instead of lex. If you use flex, define this + From 03511d7f9d35993bccd0b39543fe1cad17fc39fb Mon Sep 17 00:00:00 2001 From: Chris Lucas Date: Fri, 20 Sep 2013 23:37:09 -0700 Subject: [PATCH 2/2] removed patch, set variables via system call instead --- Library/Formula/spim.rb | 42 ++++------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/Library/Formula/spim.rb b/Library/Formula/spim.rb index 39c5028deced..c4beab6edaf8 100644 --- a/Library/Formula/spim.rb +++ b/Library/Formula/spim.rb @@ -1,5 +1,3 @@ -require 'stringio' - require 'formula' class Spim < Formula @@ -10,41 +8,9 @@ class Spim < Formula def install bin.mkpath - system 'cd spim && make' - system 'cd spim && make install' - end - - def patches - # modify Makefile so files install to proper HomeBrew directories - data = DATA.read - data.gsub!('$(bin)', bin) - data.gsub!('$(share)', share) - data.gsub!('$(man1)', man1) - - StringIO.new(data) + cd 'spim' do + system "make", "EXCEPTION_DIR=#{share}" + system "make", "install", "BIN_DIR=#{bin}", "EXCEPTION_DIR=#{share}", "MAN_DIR=#{man1}" + end end - end -__END__ -diff --git a/spim/Makefile b/spim/Makefile -index be676a0..a8eded2 100755 ---- a/spim/Makefile -+++ b/spim/Makefile -@@ -66,13 +66,13 @@ DOC_DIR = ../Documentation - - - # Full path for the directory that will hold the executable files: --BIN_DIR = $(DESTDIR)/usr/bin -+BIN_DIR = $(bin) - - # Full path for the directory that will hold the exception handler: --EXCEPTION_DIR = $(DESTDIR)/usr/share/spim -+EXCEPTION_DIR = $(share) - - # Full path for the directory that will hold the man files: --MAN_DIR = $(DESTDIR)/usr/share/man/man1 -+MAN_DIR = $(man1) - - - # If you have flex, use it instead of lex. If you use flex, define this -