From 6a8e077fb1f3ae83980509b5269a1cc388af6580 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sun, 9 Mar 2014 14:00:39 -0700 Subject: [PATCH] pyside: install sphinx at build-time to build docs Also provide an option to skip building docs, though it doesn't seem to save much time overall and may be removed. Closes Homebrew/homebrew#27228. --- Formula/pyside.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Formula/pyside.rb b/Formula/pyside.rb index 3dda9c97769..2ea12f518a6 100644 --- a/Formula/pyside.rb +++ b/Formula/pyside.rb @@ -8,6 +8,8 @@ class Pyside < Formula head 'git://gitorious.org/pyside/pyside.git' + option "without-docs", "Skip building documentation" + depends_on 'cmake' => :build depends_on 'shiboken' depends_on 'qt' @@ -16,7 +18,27 @@ class Pyside < Formula DATA # Fix moc_qpytextobject.cxx not found (https://codereview.qt-project.org/62479) end + resource 'sphinx' do + url 'https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz' + sha1 '9e424b03fe1f68e0326f3905738adcf27782f677' + end + def install + if build.with? "docs" + (buildpath/"sphinx").mkpath + + resource("sphinx").stage do + system "python", "setup.py", "install", + "--prefix=#{buildpath}/sphinx", + "--record=installed.txt", + "--single-version-externally-managed" + end + + ENV.prepend_path "PATH", (buildpath/"sphinx/bin") + else + rm buildpath/"doc/CMakeLists.txt" + end + # Add out of tree build because one of its deps, shiboken, itself needs an # out of tree build in shiboken.rb. mkdir "macbuild" do