Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 257f8ace84
Fetching contributors…

Cannot retrieve contributors at this time

file 31 lines (25 sloc) 0.892 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
require 'formula'

class Uwsgi < Formula
  url 'http://projects.unbit.it/downloads/uwsgi-0.9.9.2.tar.gz'
  homepage 'http://projects.unbit.it/uwsgi/'
  md5 'fafecf7dc86a36f003d2fadaa44483f1'

  def install
    # Find the arch for the Python we are building against.
    # We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
    archs = archs_for_command("python")
    archs.remove_ppc!
    flags = archs.as_arch_flags

    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"
    bin.install "uwsgi"
  end

  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
Something went wrong with that request. Please try again.