2009-12-01 08:52:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Uwsgi <Formula
|
2010-09-20 13:51:11 +00:00
|
|
|
url 'http://projects.unbit.it/downloads/uwsgi-0.9.6.2.tar.gz'
|
2009-12-01 08:52:29 +00:00
|
|
|
homepage 'http://projects.unbit.it/uwsgi/'
|
2010-09-20 13:51:11 +00:00
|
|
|
md5 'eab88c552e4c7c4ecb5188cdefc43390'
|
2010-01-13 11:06:52 +00:00
|
|
|
|
2009-12-01 08:52:29 +00:00
|
|
|
def install
|
2010-04-18 23:07:55 +00:00
|
|
|
# Find the archs of the Python we are building against.
|
|
|
|
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
|
|
|
|
archs = archs_for_command("python")
|
|
|
|
archs.delete :ppc7400
|
|
|
|
archs.delete :ppc64
|
|
|
|
|
|
|
|
flags = archs.collect{ |a| "-arch #{a}" }.join(' ')
|
|
|
|
|
2010-06-29 00:20:27 +00:00
|
|
|
ENV.append 'CFLAGS', flags
|
|
|
|
ENV.append 'LDFLAGS', flags
|
|
|
|
|
|
|
|
inreplace 'uwsgiconfig.py', "PYLIB_PATH = ''", "PYLIB_PATH = '#{%x[python-config --ldflags].chomp[/-L(.*?) -l/, 1]}'"
|
|
|
|
|
|
|
|
system "python uwsgiconfig.py --build"
|
2010-06-22 02:55:03 +00:00
|
|
|
bin.install "uwsgi"
|
2009-12-01 08:52:29 +00:00
|
|
|
end
|
2010-06-22 02:55:03 +00:00
|
|
|
|
2010-06-22 21:33:53 +00:00
|
|
|
def caveats
|
|
|
|
<<-EOS.undent
|
|
|
|
NOTE: "brew install -v uwsgi" will fail!
|
|
|
|
You must install in non-verbose mode for this to succeed.
|
|
|
|
Patches to fix this are welcome.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|