aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/uwsgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/uwsgi.rb')
-rw-r--r--Library/Formula/uwsgi.rb55
1 files changed, 43 insertions, 12 deletions
diff --git a/Library/Formula/uwsgi.rb b/Library/Formula/uwsgi.rb
index dc2a1dd7c..0b39342b0 100644
--- a/Library/Formula/uwsgi.rb
+++ b/Library/Formula/uwsgi.rb
@@ -11,7 +11,6 @@ class Uwsgi < Formula
sha1 "8ae9b2775e1d9fd0f4025e2ffc14e0c7c8b7b3dd" => :lion
end
- depends_on "libyaml"
depends_on "pcre"
depends_on "yajl" if build.without? "jansson"
@@ -21,6 +20,7 @@ class Uwsgi < Formula
depends_on "jansson" => :optional
depends_on "libffi" => :optional
depends_on "libxslt" => :optional
+ depends_on "libyaml" => :optional
depends_on "lua" => :optional
depends_on "mongodb" => :optional
depends_on "mongrel2" => :optional
@@ -28,6 +28,7 @@ class Uwsgi < Formula
depends_on "nagios" => :optional
depends_on "postgresql" => :optional
depends_on "pypy" => :optional
+ depends_on "python3" => :optional
depends_on "rrdtool" => :optional
depends_on "rsyslog" => :optional
depends_on "tcc" => :optional
@@ -35,26 +36,46 @@ class Uwsgi < Formula
depends_on "zeromq" => :optional
option "with-java", "Compile with Java support"
+ option "with-php", "Compile with PHP support (PHP must be built for embedding)"
option "with-ruby", "Compile with Ruby support"
def install
%w{CFLAGS LDFLAGS}.each { |e| ENV.append e, "-arch #{MacOS.preferred_arch}" }
- system "python", "uwsgiconfig.py", "--build", "core"
+ json = "yajl"
+ if build.with? "jansson"
+ json = "jansson"
+ end
+
+ yaml = "embedded"
+ if build.with? "libyaml"
+ yaml = "libyaml"
+ end
+
+ (buildpath/"buildconf/brew.ini").write <<-EOS.undent
+ [uwsgi]
+ json = #{json}
+ yaml = #{yaml}
+ inherit = base
+ plugin_dir = #{libexec}/uwsgi
+ embedded_plugins = null
+ EOS
+
+ system "python", "uwsgiconfig.py", "--build", "brew"
plugins = ["airbrake", "alarm_curl", "alarm_speech", "asyncio", "cache",
"carbon", "cgi", "cheaper_backlog2", "cheaper_busyness",
"corerouter", "curl_cron", "cplusplus", "dumbloop", "dummy",
"echo", "emperor_amqp", "fastrouter", "forkptyrouter", "gevent",
"http", "logcrypto", "logfile", "ldap", "logpipe", "logsocket",
- "msgpack", "notfound", "pam", "ping", "psgi", "pty", "python",
- "rawrouter", "router_basicauth", "router_cache",
- "router_expires", "router_hash", "router_http",
- "router_memcached", "router_metrics", "router_radius",
- "router_redirect", "router_redis", "router_rewrite",
- "router_static", "router_uwsgi", "router_xmldir", "rpc",
- "signal", "spooler", "sqlite3", "sslrouter",
- "stats_pusher_file", "stats_pusher_socket", "symcall", "syslog",
+ "msgpack", "notfound", "pam", "ping", "psgi", "pty", "rawrouter",
+ "router_basicauth", "router_cache", "router_expires",
+ "router_hash", "router_http", "router_memcached",
+ "router_metrics", "router_radius", "router_redirect",
+ "router_redis", "router_rewrite", "router_static",
+ "router_uwsgi", "router_xmldir", "rpc", "signal", "spooler",
+ "sqlite3", "sslrouter", "stats_pusher_file",
+ "stats_pusher_socket", "symcall", "syslog",
"transformation_chunked", "transformation_gzip",
"transformation_offload", "transformation_tofile",
"transformation_toupper","ugreen", "webdav", "zergpool"]
@@ -76,6 +97,7 @@ class Uwsgi < Formula
plugins << "mono" if build.with? "mono"
plugins << "nagios" if build.with? "nagios"
plugins << "pypy" if build.with? "pypy"
+ plugins << "php" if build.with? "php"
plugins << "rack" if build.with? "ruby"
plugins << "rbthreads" if build.with? "ruby"
plugins << "ring" if build.with? "java"
@@ -86,12 +108,18 @@ class Uwsgi < Formula
plugins << "v8" if build.with? "v8"
plugins << "xslt" if build.with? "libxslt"
+ (libexec/"uwsgi").mkpath
plugins.each do |plugin|
- system "python", "uwsgiconfig.py", "--plugin", "plugins/#{plugin}", "core"
+ system "python", "uwsgiconfig.py", "--plugin", "plugins/#{plugin}", "brew"
+ end
+
+ python_versions = ["python", "python2"]
+ python_versions << "python3" if build.with? "python3"
+ python_versions.each do |v|
+ system "python", "uwsgiconfig.py", "--plugin", "plugins/python", "brew", v
end
bin.install "uwsgi"
- (libexec/"uwsgi").install Dir["*_plugin.so"]
end
plist_options :manual => 'uwsgi'
@@ -114,6 +142,9 @@ class Uwsgi < Formula
<string>_www</string>
<string>--gid</string>
<string>_www</string>
+ <string>--master</string>
+ <string>--die-on-term</string>
+ <string>--autoload</string>
<string>--logto</string>
<string>#{HOMEBREW_PREFIX}/var/log/uwsgi.log</string>
<string>--emperor</string>