2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-07-30 01:25:18 +00:00
|
|
|
|
|
|
|
class Python <Formula
|
2010-03-31 21:37:06 +00:00
|
|
|
url 'http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2'
|
2009-10-02 04:00:15 +00:00
|
|
|
homepage 'http://www.python.org/'
|
2010-03-31 21:37:06 +00:00
|
|
|
md5 '6bef0417e71a1a1737ccf5750420fdb3'
|
2009-07-30 01:25:18 +00:00
|
|
|
|
2010-03-31 21:37:06 +00:00
|
|
|
# Python 2.6.5 will build against OS X's libedit,
|
|
|
|
# but let's keep using GNU readline.
|
|
|
|
depends_on 'readline' => :optional
|
2010-03-12 18:20:11 +00:00
|
|
|
# http://docs.python.org/library/gdbm.html
|
|
|
|
depends_on 'gdbm' => :optional
|
|
|
|
# http://docs.python.org/library/sqlite3.html
|
|
|
|
depends_on 'sqlite' => :optional
|
2009-12-13 18:25:07 +00:00
|
|
|
|
2009-10-02 04:00:15 +00:00
|
|
|
def options
|
|
|
|
[
|
|
|
|
["--framework", "Do a 'Framework' build instead of a UNIX-style build."],
|
2009-12-21 23:30:51 +00:00
|
|
|
["--universal", "Build for both 32 & 64 bit Intel."]
|
2009-10-02 04:00:15 +00:00
|
|
|
]
|
|
|
|
end
|
2009-09-17 20:56:49 +00:00
|
|
|
|
2009-08-03 22:22:04 +00:00
|
|
|
def skip_clean? path
|
2009-08-10 10:45:25 +00:00
|
|
|
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
|
2009-08-03 22:22:04 +00:00
|
|
|
end
|
2009-08-01 18:44:16 +00:00
|
|
|
|
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'
|
2010-03-12 18:20:11 +00:00
|
|
|
|
2010-03-31 21:37:06 +00:00
|
|
|
# Note --intel is an old flag, supported here for back compat.
|
2010-03-12 18:20:11 +00:00
|
|
|
if ARGV.include? '--universal' or ARGV.include? '--intel'
|
2010-03-31 21:37:06 +00:00
|
|
|
args.push "--enable-universalsdk=/", "--with-universal-archs=intel"
|
2010-03-12 18:20:11 +00:00
|
|
|
end
|
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"
|
2010-05-25 21:37:44 +00:00
|
|
|
ENV.j1 # Framework builds need to be installed serialized
|
2009-07-30 01:25:18 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|