livestreamer: move to Python 3

This commit is contained in:
FX Coudert 2018-10-11 13:59:42 +02:00
parent 7a73313826
commit 5333e34a9b

View file

@ -3,6 +3,7 @@ class Livestreamer < Formula
homepage "https://livestreamer.io/" homepage "https://livestreamer.io/"
url "https://files.pythonhosted.org/packages/ee/d6/efbe3456160a2c62e3dd841c5d9504d071c94449a819148bb038b50d862a/livestreamer-1.12.2.tar.gz" url "https://files.pythonhosted.org/packages/ee/d6/efbe3456160a2c62e3dd841c5d9504d071c94449a819148bb038b50d862a/livestreamer-1.12.2.tar.gz"
sha256 "ef3e743d0cabc27d8ad906c356e74370799e25ba46c94d3b8d585af77a258de0" sha256 "ef3e743d0cabc27d8ad906c356e74370799e25ba46c94d3b8d585af77a258de0"
revision 1
bottle do bottle do
cellar :any_skip_relocation cellar :any_skip_relocation
@ -14,38 +15,29 @@ class Livestreamer < Formula
sha256 "b91f4e0f5a293dbb12134bc5be6b2d4ec7c80e309fca8d4901376e15c8b5df87" => :mavericks sha256 "b91f4e0f5a293dbb12134bc5be6b2d4ec7c80e309fca8d4901376e15c8b5df87" => :mavericks
end end
depends_on "python@2" depends_on "python"
resource "futures" do
url "https://files.pythonhosted.org/packages/c0/12/927b89a24dcb336e5af18a8fbf581581c36e9620ae963a693a2522b2d340/futures-2.2.0.tar.gz"
sha256 "151c057173474a3a40f897165951c0e33ad04f37de65b6de547ddef107fd0ed3"
end
resource "requests" do resource "requests" do
url "https://files.pythonhosted.org/packages/49/6f/183063f01aae1e025cf0130772b55848750a2f3a89bfa11b385b35d7329d/requests-2.10.0.tar.gz" url "https://files.pythonhosted.org/packages/49/6f/183063f01aae1e025cf0130772b55848750a2f3a89bfa11b385b35d7329d/requests-2.10.0.tar.gz"
sha256 "63f1815788157130cee16a933b2ee184038e975f0017306d723ac326b5525b54" sha256 "63f1815788157130cee16a933b2ee184038e975f0017306d723ac326b5525b54"
end end
resource "singledispatch" do
url "https://files.pythonhosted.org/packages/d9/e9/513ad8dc17210db12cb14f2d4d190d618fb87dd38814203ea71c87ba5b68/singledispatch-3.4.0.3.tar.gz"
sha256 "5b06af87df13818d14f08a028e42f566640aef80805c3b50c5056b086e3c2b9c"
end
resource "six" do resource "six" do
url "https://files.pythonhosted.org/packages/11/3f/2b3c217c5427cdd12619024b1ee1b04d49e27fde5c29df2a0b92c26677c2/six-1.8.0.tar.gz" url "https://files.pythonhosted.org/packages/11/3f/2b3c217c5427cdd12619024b1ee1b04d49e27fde5c29df2a0b92c26677c2/six-1.8.0.tar.gz"
sha256 "047bbbba41bac37c444c75ddfdf0573dd6e2f1fbd824e6247bb26fa7d8fa3830" sha256 "047bbbba41bac37c444c75ddfdf0573dd6e2f1fbd824e6247bb26fa7d8fa3830"
end end
def install def install
ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python2.7/site-packages" xy = Language::Python.major_minor_version "python3"
%w[futures requests singledispatch six].each do |r| ENV.prepend_create_path "PYTHONPATH", libexec/"vendor/lib/python#{xy}/site-packages"
resource(r).stage do resources.each do |r|
system "python", *Language::Python.setup_install_args(libexec/"vendor") r.stage do
system "python3", *Language::Python.setup_install_args(libexec/"vendor")
end end
end end
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages" ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python#{xy}/site-packages"
system "python", *Language::Python.setup_install_args(libexec) system "python3", *Language::Python.setup_install_args(libexec)
bin.install Dir[libexec/"bin/*"] bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])