Skip to content

Commit

Permalink
docutils: revert to restore venv
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Cho <[email protected]>
  • Loading branch information
cho-m committed Apr 6, 2024
1 parent 1b28866 commit 6cf8eee
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions Formula/d/docutils.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class Docutils < Formula
include Language::Python::Virtualenv

desc "Text processing system for reStructuredText"
homepage "https://docutils.sourceforge.io"
url "https://downloads.sourceforge.net/project/docutils/docutils/0.20.1/docutils-0.20.1.tar.gz"
url "https://files.pythonhosted.org/packages/1f/53/a5da4f2c5739cf66290fac1431ee52aff6851c7c8ffd8264f13affd7bcdd/docutils-0.20.1.tar.gz"
sha256 "f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"
license all_of: [:public_domain, "BSD-2-Clause", "GPL-3.0-or-later", "Python-2.0"]
revision 1
Expand All @@ -17,42 +19,20 @@ class Docutils < Formula
sha256 cellar: :any_skip_relocation, x86_64_linux: "480c0b72303e68588d67dd37efc0b55d3971f67561c765f3947d1af96103d790"
end

depends_on "python-setuptools" => :build
depends_on "[email protected]" => [:build, :test]
depends_on "[email protected]" => [:build, :test]

def pythons
deps.map(&:to_formula)
.select { |f| f.name.start_with?("python@") }
.sort_by(&:version)
end
depends_on "[email protected]"

def install
pythons.each do |python|
python_exe = python.opt_libexec/"bin/python"
system python_exe, "-m", "pip", "install", *std_pip_args, "."
end

virtualenv_install_with_resources
bin.glob("*.py") do |f|
bin.install_symlink f => f.basename(".py")
end
end

def caveats
<<~EOS
To run front-end tools, you may need to `brew install #{pythons.last}`
EOS
end

test do
cp prefix/"README.txt", testpath
mkdir_p testpath/"docs"
touch testpath/"docs"/"header0.txt"
system bin/"rst2man.py", testpath/"README.txt"
system bin/"rst2man", testpath/"README.txt"
pythons.each do |python|
python_exe = python.opt_libexec/"bin/python"
system python_exe, "-c", "import docutils"
end
end
end

0 comments on commit 6cf8eee

Please sign in to comment.