homebrew-core/Formula/python.rb

47 lines
1.6 KiB
Ruby
Raw Normal View History

require 'formula'
2009-07-30 01:25:18 +00:00
class Python <Formula
url 'http://python.org/ftp/python/2.6.4/Python-2.6.4.tar.bz2'
2009-10-02 04:00:15 +00:00
homepage 'http://www.python.org/'
md5 'fee5408634a54e721a93531aba37f8c1'
2009-07-30 01:25:18 +00:00
# You can build Python without readline, but you really don't want to.
2009-09-21 18:40:27 +00:00
depends_on 'readline' => :recommended
def patches
# don't append space after completion
{:p0 => ["http://bugs.python.org/file14599/python-2.6-readline.patch"]}
end
2009-10-02 04:00:15 +00:00
def options
[
["--framework", "Do a 'Framework' build instead of a UNIX-style build."],
["--universal", "Build for both 32 & 64 bit Intel."]
2009-10-02 04:00:15 +00:00
]
end
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
2009-07-30 01:25:18 +00:00
def install
2009-10-02 04:00:15 +00:00
args = ["--prefix=#{prefix}"]
2009-12-02 01:39:24 +00:00
args << "--enable-framework" if ARGV.include? '--framework'
args << "--with-universal-archs=intel" << "--enable-universalsdk=/" if ARGV.include? '--universal' \
or ARGV.include? '--intel' # the old flag, preserved for back-compat
2009-10-02 04:00:15 +00:00
2009-10-21 18:24:28 +00:00
# Speed up creation of libpython.a, backported from Unladen Swallow:
# http://code.google.com/p/unladen-swallow/source/detail?r=856
inreplace "Makefile.pre.in", "$(AR) cr", "$(AR) cqS"
2009-10-02 04:00:15 +00:00
system "./configure", *args
2009-07-30 01:25:18 +00:00
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'
2009-07-30 01:25:18 +00:00
end
end