Skip to content

Commit

Permalink
uwsgi: move to Python 3
Browse files Browse the repository at this point in the history
Closes #47058.

Signed-off-by: FX Coudert <[email protected]>
  • Loading branch information
fxcoudert committed Nov 22, 2019
1 parent e4cc1ca commit 81f44ca
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions Formula/uwsgi.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Uwsgi < Formula
desc "Full stack for building hosting services"
homepage "https://uwsgi-docs.readthedocs.org/en/latest/"
revision 1
revision 2
head "https://github.com/unbit/uwsgi.git"

stable do
Expand All @@ -26,16 +26,9 @@ class Uwsgi < Formula
depends_on "pkg-config" => :build
depends_on "[email protected]"
depends_on "pcre"
depends_on "python@2"
depends_on "python"
depends_on "yajl"

# "no such file or directory: '... libpython2.7.a'"
# Reported 23 Jun 2016: https://github.com/unbit/uwsgi/issues/1299
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/726bff4/uwsgi/libpython-tbd-xcode-sdk.diff"
sha256 "d71c879774b32424b5a9051ff47d3ae6e005412e9214675d806857ec906f9336"
end

def install
# Fix file not found errors for /usr/lib/system/libsystem_symptoms.dylib and
# /usr/lib/system/libsystem_darwin.dylib on 10.11 and 10.12, respectively
Expand All @@ -59,7 +52,7 @@ def install
embedded_plugins = null
EOS

system "python", "uwsgiconfig.py", "--verbose", "--build", "brew"
system "python3", "uwsgiconfig.py", "--verbose", "--build", "brew"

plugins = %w[airbrake alarm_curl alarm_speech asyncio cache
carbon cgi cheaper_backlog2 cheaper_busyness
Expand All @@ -80,16 +73,10 @@ def install

(libexec/"uwsgi").mkpath
plugins.each do |plugin|
system "python", "uwsgiconfig.py", "--verbose", "--plugin", "plugins/#{plugin}", "brew"
system "python3", "uwsgiconfig.py", "--verbose", "--plugin", "plugins/#{plugin}", "brew"
end

python_versions = {
"python" => "python2.7",
"python2" => "python2.7",
}
python_versions.each do |k, v|
system v, "uwsgiconfig.py", "--verbose", "--plugin", "plugins/python", "brew", k
end
system "python3", "uwsgiconfig.py", "--verbose", "--plugin", "plugins/python", "brew", "python3"

bin.install "uwsgi"
end
Expand Down Expand Up @@ -137,7 +124,7 @@ def application(env, start_response):
EOS

pid = fork do
exec "#{bin}/uwsgi --http-socket 127.0.0.1:8080 --protocol=http --plugin python -w helloworld"
exec "#{bin}/uwsgi --http-socket 127.0.0.1:8080 --protocol=http --plugin python3 -w helloworld"
end
sleep 2

Expand Down

0 comments on commit 81f44ca

Please sign in to comment.