offlineimap: use #!/usr/bin/python shebangs

and make system Python dependency explicit

Fixes #24809.

Closes #24823.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ilovezfs 2018-03-04 09:45:58 -08:00
parent 4be053ba21
commit 70a668a976

View file

@ -3,6 +3,7 @@ class Offlineimap < Formula
homepage "https://www.offlineimap.org/"
url "https://github.com/OfflineIMAP/offlineimap/archive/v7.1.5.tar.gz"
sha256 "8e28e786a00768e8a97d9f049406744829212cffb69903ffbb15faa1479d43e1"
revision 1
head "https://github.com/OfflineIMAP/offlineimap.git"
bottle do
@ -15,6 +16,7 @@ class Offlineimap < Formula
depends_on "asciidoc" => :build
depends_on "docbook-xsl" => :build
depends_on "sphinx-doc" => :build
depends_on "python@2" if MacOS.version <= :snow_leopard
resource "six" do
url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz"
@ -27,6 +29,9 @@ class Offlineimap < Formula
man1.install "docs/offlineimap.1"
man7.install "docs/offlineimapui.7"
inreplace ["offlineimap/bundled_imaplib2.py", "bin/offlineimap"],
%r{^#!/usr/bin/env python$}, "#!/usr/bin/python"
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages"
resource("six").stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")