Files
tigerbrew/Library/Formula/python.rb
T
Max Howell 68108e1098 Dependency resolution with fancy syntax
Is it a DSL? No. But people call it that apparently.

To add a dependency:

class Doe <Formula
  depends_on 'ray'
  depends_on 'mee' => :optional
  depends_on 'far' => :recommended
  depends_on Sew.new
end

Sew would be a formula you have defined in this Formula file. This is useful,
eg. see Python's formula. Formula specified in this fashion cannot be linked
into the HOMEBREW_PREFIX, they are considered private libraries. This allows
you to create custom installations that are very specific to your formula.

More features to come, like specifying versions
2009-09-21 18:27:48 +01:00

47 lines
1.4 KiB
Ruby

require 'brewkit'
class Readline <Formula
@url='ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz'
@homepage='http://tiswww.case.edu/php/chet/readline/rltop.html'
@md5='e39331f32ad14009b9ff49cc10c5e751'
def patches
(1..14).collect {|n| "ftp://ftp.gnu.org/gnu/readline/readline-5.2-patches/readline52-%03d"%n}
end
def keg_only?
true
end
def install
system "./configure", "--prefix=#{prefix}",
"--mandir=#{man}",
"--infodir=#{info}"
system "make install"
end
end
class Python <Formula
@url='http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2'
@homepage='http://www.python.org/'
@md5='245db9f1e0f09ab7e0faaa0cf7301011'
# You can build Python without readline, but you really don't want to.
depends_on Readline.new
def skip_clean? path
path == bin+'python' or path == bin+'python2.6' or # if you strip these, it can't load modules
path == lib+'python2.6' # save a lot of time
end
def install
system "./configure --prefix='#{prefix}' --with-framework-name=/Developer/SDKs/MacOSX10.5.sdk"
system "make"
system "make install"
# lib/python2.6/config contains a copy of libpython.a; make this a link instead
(lib+'python2.6/config/libpython2.6.a').unlink
(lib+'python2.6/config/libpython2.6.a').make_link lib+'libpython2.6.a'
end
end