diff options
| author | Jack Nagel | 2011-12-11 21:45:20 -0600 |
|---|---|---|
| committer | Jack Nagel | 2011-12-11 21:46:04 -0600 |
| commit | 9791aa9dd52103b6a48217b517a3682b415aeeda (patch) | |
| tree | 1e98ee37f46299322e6f47733a51f7e38a75e1af /Library/Formula | |
| parent | 193f9ebb827c0cfab4fae45003fab86ce78809f4 (diff) | |
| download | homebrew-9791aa9dd52103b6a48217b517a3682b415aeeda.tar.bz2 | |
Formula idioms
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/field3d.rb | 39 | ||||
| -rw-r--r-- | Library/Formula/vcftools.rb | 12 |
2 files changed, 29 insertions, 22 deletions
diff --git a/Library/Formula/field3d.rb b/Library/Formula/field3d.rb index a7fda67b6..aff6f8e57 100644 --- a/Library/Formula/field3d.rb +++ b/Library/Formula/field3d.rb @@ -20,31 +20,38 @@ class Field3d < Formula env.Replace(CC = "#{ENV.cc}") env.Replace(CXX = "#{ENV.cxx}") EOS - # Set the systemIncludePaths and systemLibPaths that get searched. - inreplace 'BuildSupport.py', '/opt/local/include', "#{HOMEBREW_PREFIX}/include" - inreplace 'BuildSupport.py', '/opt/local/lib', "#{HOMEBREW_PREFIX}/lib" - # Merge Homebrew's CFLAGS into the build's CCFLAGS passed to CC and CXX. - inreplace 'BuildSupport.py', - 'env.Append(CCFLAGS = ["-Wall"])', - "env.MergeFlags(['#{ENV.cflags}'])" + + inreplace 'BuildSupport.py' do |s| + s.gsub! '/opt/local/include', "#{HOMEBREW_PREFIX}/include" + s.gsub! '/opt/local/lib', "#{HOMEBREW_PREFIX}/lib" + # Merge Homebrew's CFLAGS into the build's CCFLAGS passed to CC and CXX + s.gsub! 'env.Append(CCFLAGS = ["-Wall"])', "env.MergeFlags(['#{ENV.cflags}'])" + end # Build the software with scons. - system "scons" unless MacOS.prefer_64_bit? - system "scons do64=1" if MacOS.prefer_64_bit? + if MacOS.prefer_64_bit? + system "scons do64=1" + else + system "scons" + end + # Build the docs with cmake mkdir 'macbuild' Dir.chdir 'macbuild' do system "cmake .." system "make doc" end + # Install the libraries and docs. - b = 'install/darwin/m64/release/' if MacOS.prefer_64_bit? - b = 'install/darwin/m32/release/' unless MacOS.prefer_64_bit? - l = b+'lib/*' - i = b+'include/*' - lib.install Dir[l] - include.install Dir[i] - prefix.install %w{ README CHANGES COPYING } + b = if MacOS.prefer_64_bit? + 'install/darwin/m64/release/' + else + 'install/darwin/m32/release/' + end + + lib.install Dir[b+'lib/*'] + include.install Dir[b+'include/*'] + prefix.install 'CHANGES' doc.install Dir['docs/html/*'] end end diff --git a/Library/Formula/vcftools.rb b/Library/Formula/vcftools.rb index 725c8b615..e3a7401be 100644 --- a/Library/Formula/vcftools.rb +++ b/Library/Formula/vcftools.rb @@ -5,6 +5,12 @@ class Vcftools < Formula homepage 'http://vcftools.sourceforge.net/index.html' md5 'd3e68027a7fe40d3f8cb28c3006c7248' + def patches + # Install Perl modules to /lib/perl5/site_perl and ensure VcfStats.pm is installed + # This is fixed in vcf source tree, will not be needed after version 0.1.7 + DATA + end + def install system "make install PREFIX=#{prefix} CPP=#{ENV.cxx}" end @@ -19,12 +25,6 @@ class Vcftools < Formula export PERL5LIB=#{HOMEBREW_PREFIX}/lib/perl5/site_perl:${PERL5LIB} EOS end - - def patches - # Install Perl modules to /lib/perl5/site_perl and ensure VcfStats.pm is installed - # This is fixed in vcf source tree, will not be needed after version 0.1.7 - DATA - end end __END__ |
