2009-12-01 08:52:29 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-10-28 19:29:50 +00:00
|
|
|
class UniversalPcre < Requirement
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
pcre must be build universal for uwsgi to work.
|
|
|
|
You will need to:
|
|
|
|
brew rm pcre
|
|
|
|
brew install --universal pcre
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def fatal?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def satisfied?
|
|
|
|
f = Formula.factory('pcre')
|
|
|
|
f.installed? && archs_for_command(f.lib/'libpcre.dylib').universal?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Uwsgi < Formula
|
2009-12-01 08:52:29 +00:00
|
|
|
homepage 'http://projects.unbit.it/uwsgi/'
|
2012-09-09 22:32:06 +00:00
|
|
|
url 'http://projects.unbit.it/downloads/uwsgi-1.2.6.tar.gz'
|
|
|
|
sha1 '61996a4bc7d745dc3ed849c78310c4e1c5c70ee1'
|
2010-01-13 11:06:52 +00:00
|
|
|
|
2012-10-28 19:29:50 +00:00
|
|
|
depends_on UniversalPcre.new
|
|
|
|
depends_on 'pcre'
|
2012-04-17 23:24:55 +00:00
|
|
|
|
2009-12-01 08:52:29 +00:00
|
|
|
def install
|
2011-03-19 16:50:37 +00:00
|
|
|
# Find the arch for the Python we are building against.
|
2010-04-18 23:07:55 +00:00
|
|
|
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
|
|
|
|
archs = archs_for_command("python")
|
2011-03-19 16:50:37 +00:00
|
|
|
archs.remove_ppc!
|
2012-04-17 03:53:51 +00:00
|
|
|
arch_flags = archs.as_arch_flags
|
2010-04-18 23:07:55 +00:00
|
|
|
|
2012-04-17 03:53:51 +00:00
|
|
|
ENV.append 'CFLAGS', arch_flags
|
|
|
|
ENV.append 'LDFLAGS', arch_flags
|
2010-06-29 00:20:27 +00:00
|
|
|
|
2012-04-17 23:24:55 +00:00
|
|
|
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 21:33:53 +00:00
|
|
|
end
|