-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Cho <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 |