Skip to content

Commit

Permalink
Migrate to [email protected]
Browse files Browse the repository at this point in the history
Homebrew is migrating formulas to [email protected]
Homebrew/homebrew-core#47274
Our homebrew dependencies have already migrated as well.

Also, properly install the six python package.
  • Loading branch information
dbogdanov committed May 28, 2020
1 parent 65000aa commit ce066be
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions essentia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class Essentia < Formula
depends_on "gaia" => :optional
depends_on "tensorflow" => :optional

option "without-python", "Build without python3 support"
option "without-python", "Build without Python 3.8 support"

depends_on "python" if build.with? "python"
depends_on "python@3.8" if build.with? "python"
depends_on "numpy" if build.with? "python"

resource "six" do
url "https://files.pythonhosted.org/packages/16/d8/bc6316cf98419719bd59c91742194c111b6f2e85abac88e496adefaf7afe/six-1.11.0.tar.gz"
sha256 "70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9"
url "https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz"
sha256 "236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"
end

def install
Expand All @@ -44,9 +44,9 @@ def install
build_flags += ["--with-tensorflow"]
end

system "python3", "waf", "configure", *build_flags
system "python3", "waf"
system "python3", "waf", "install"
system Formula["[email protected]"].opt_bin/"python3", "waf", "configure", *build_flags
system Formula["[email protected]"].opt_bin/"python3", "waf"
system Formula["[email protected]"].opt_bin/"python3", "waf", "install"

python_flags = [
"--mode=release",
Expand All @@ -58,9 +58,18 @@ def install
ENV['PKG_CONFIG_PATH'] = "#{prefix}/lib/pkgconfig:" + ENV['PKG_CONFIG_PATH']

if build.with? "python"
system "python3", "waf", "configure", *python_flags
system "python3", "waf"
system "python3", "waf", "install"
system Formula["[email protected]"].opt_bin/"python3", "waf", "configure", *python_flags
system Formula["[email protected]"].opt_bin/"python3", "waf"
system Formula["[email protected]"].opt_bin/"python3", "waf", "install"

resource("six").stage do
system Formula["[email protected]"].opt_bin/"python3", *Language::Python.setup_install_args(libexec)
end

version = Language::Python.major_minor_version Formula["[email protected]"].opt_bin/"python3"
site_packages = "lib/python#{version}/site-packages"
pth_contents = "import site; site.addsitedir('#{libexec/site_packages}')\n"
(prefix/site_packages/"homebrew-essentia.pth").write pth_contents
end
end

Expand All @@ -76,7 +85,7 @@ def install
EOS

if build.with? "python"
system "python3", "-c", "#{py_test}"
system Formula["[email protected]"].opt_bin/"python3", "-c", "#{py_test}"
end
end
end

0 comments on commit ce066be

Please sign in to comment.