168 lines
7.5 KiB
Ruby
168 lines
7.5 KiB
Ruby
class Ford < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Automatic documentation generator for modern Fortran programs"
|
|
homepage "https://github.com/Fortran-FOSS-Programmers/ford"
|
|
url "https://files.pythonhosted.org/packages/e5/f2/96f77514ac210f235e936f4c5676082041b554fc04573b67345ed4ff71e7/FORD-6.1.11.tar.gz"
|
|
sha256 "feb9a88040e717e84c632e4b023904ab36a463fc9a8ff80c8c7f86454e5d8043"
|
|
license "GPL-3.0-or-later"
|
|
head "https://github.com/Fortran-FOSS-Programmers/ford.git", branch: "master"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "b80604113421a307d4671a6c6c6cd37455c8a36319f04ad02139c77fe4d6339d"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "7ba8db183d04e8d4bd100f0cbebc53e5702ba589f711ec11661258fea8ee96b9"
|
|
sha256 cellar: :any_skip_relocation, monterey: "9f8b4a7d91b36c33a8ec40563cddfd7253ac2dd43d33b6f2fc2d1354cc1374ac"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "8af8a8f5e4e18ad5c0b852ea57f651fcbf272948e1c756751d788be538f9bb79"
|
|
sha256 cellar: :any_skip_relocation, catalina: "dd000dcec30f5160699f5fec098a4143c84d3ef2d658011c796f7456a467b8a4"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "6425b45bf22ed09a0f68703bd7aa9826051bfb6d535fcc20a2d1551d8e18af0f"
|
|
end
|
|
|
|
depends_on "graphviz"
|
|
depends_on "python@3.9"
|
|
|
|
uses_from_macos "libxml2"
|
|
uses_from_macos "libxslt"
|
|
|
|
resource "beautifulsoup4" do
|
|
url "https://files.pythonhosted.org/packages/a1/69/daeee6d8f22c997e522cdbeb59641c4d31ab120aba0f2c799500f7456b7e/beautifulsoup4-4.10.0.tar.gz"
|
|
sha256 "c23ad23c521d818955a4151a67d81580319d4bf548d3d49f4223ae041ff98891"
|
|
end
|
|
|
|
resource "graphviz" do
|
|
url "https://files.pythonhosted.org/packages/f6/14/aa3ec10e4ab1524ba69f4742ef9cfa01fd668d0840afe5d5e6f708a95031/graphviz-0.19.1.zip"
|
|
sha256 "09ed0cde452d015fe77c4845a210eb642f28d245f5bc250d4b97808cb8f49078"
|
|
end
|
|
|
|
resource "importlib-metadata" do
|
|
url "https://files.pythonhosted.org/packages/3e/1d/964b27278cfa369fbe9041f604ab09c6e99556f8b7910781b4584b428c2f/importlib_metadata-4.11.3.tar.gz"
|
|
sha256 "ea4c597ebf37142f827b8f39299579e31685c31d3a438b59f469406afd0f2539"
|
|
end
|
|
|
|
resource "Jinja2" do
|
|
url "https://files.pythonhosted.org/packages/89/e3/b36266381ae7a1310a653bb85f4f3658c462a69634fa9b2fef76252a50ed/Jinja2-3.1.1.tar.gz"
|
|
sha256 "640bed4bb501cbd17194b3cace1dc2126f5b619cf068a726b98192a0fde74ae9"
|
|
end
|
|
|
|
resource "Markdown" do
|
|
url "https://files.pythonhosted.org/packages/15/06/d60f21eda994b044cbd496892d4d4c5c708aa597fcaded7d421513cb219b/Markdown-3.3.6.tar.gz"
|
|
sha256 "76df8ae32294ec39dcf89340382882dfa12975f87f45c3ed1ecdb1e8cefc7006"
|
|
end
|
|
|
|
resource "markdown-include" do
|
|
url "https://files.pythonhosted.org/packages/34/ce/289d5d459c274a59379f79af95f3f36ae29cb9d787206ad9b45dda48e3ce/markdown-include-0.6.0.tar.gz"
|
|
sha256 "6f5d680e36f7780c7f0f61dca53ca581bd50d1b56137ddcd6353efafa0c3e4a2"
|
|
end
|
|
|
|
resource "MarkupSafe" do
|
|
url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz"
|
|
sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"
|
|
end
|
|
|
|
resource "Pygments" do
|
|
url "https://files.pythonhosted.org/packages/94/9c/cb656d06950268155f46d4f6ce25d7ffc51a0da47eadf1b164bbf23b718b/Pygments-2.11.2.tar.gz"
|
|
sha256 "4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"
|
|
end
|
|
|
|
resource "python-markdown-math" do
|
|
url "https://files.pythonhosted.org/packages/ec/17/e7e3f3fce951b8adec10987834f4b2fa721ebd9bd6651ce2a4f39c4c544d/python-markdown-math-0.8.tar.gz"
|
|
sha256 "8564212af679fc18d53f38681f16080fcd3d186073f23825c7ce86fadd3e3635"
|
|
end
|
|
|
|
resource "soupsieve" do
|
|
url "https://files.pythonhosted.org/packages/e1/25/a3005eedafb34e1258458e8a4b94900a60a41a2b4e459e0e19631648a2a0/soupsieve-2.3.1.tar.gz"
|
|
sha256 "b8d49b1cd4f037c7082a9683dfa1801aa2597fb11c3a1155b7a5b94829b4f1f9"
|
|
end
|
|
|
|
resource "toposort" do
|
|
url "https://files.pythonhosted.org/packages/b2/be/67bec9a73041616dd359f06e997d56c9c99d252460a3f035411d97c96c48/toposort-1.7.tar.gz"
|
|
sha256 "ddc2182c42912a440511bd7ff5d3e6a1cabc3accbc674a3258c8c41cbfbb2125"
|
|
end
|
|
|
|
resource "tqdm" do
|
|
url "https://files.pythonhosted.org/packages/98/2a/838de32e09bd511cf69fe4ae13ffc748ac143449bfc24bb3fd172d53a84f/tqdm-4.64.0.tar.gz"
|
|
sha256 "40be55d30e200777a307a7585aee69e4eabb46b4ec6a4b4a5f2d9f11e7d5408d"
|
|
end
|
|
|
|
resource "zipp" do
|
|
url "https://files.pythonhosted.org/packages/cc/3c/3e8c69cd493297003da83f26ccf1faea5dd7da7892a0a7c965ac3bcba7bf/zipp-3.8.0.tar.gz"
|
|
sha256 "56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
doc.install "2008standard.pdf", "2003standard.pdf"
|
|
pkgshare.install "example/example-project-file.md"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test-project.md").write <<~EOS
|
|
project_dir: ./src
|
|
output_dir: ./doc
|
|
project_github: https://github.com/cmacmackin/futility
|
|
project_website: https://github.com
|
|
summary: Some Fortran program which I wrote.
|
|
author: John Doe
|
|
author_description: I program stuff in Fortran.
|
|
github: https://github.com/cmacmackin
|
|
email: john.doe@example.com
|
|
predocmark: >
|
|
docmark_alt: #
|
|
predocmark_alt: <
|
|
macro: TEST
|
|
LOGIC=.true.
|
|
|
|
This is a project which I wrote. This file will provide the documents. I'm
|
|
writing the body of the text here. It contains an overall description of the
|
|
project. It might explain how to go about installing/compiling it. It might
|
|
provide a change-log for the code. Maybe it will talk about the history and/or
|
|
motivation for this software.
|
|
|
|
@Note
|
|
You can include any notes (or bugs, warnings, or todos) like so.
|
|
|
|
You can have as many paragraphs as you like here and can use headlines, links,
|
|
images, etc. Basically, you can use anything in Markdown and Markdown-Extra.
|
|
Furthermore, you can insert LaTeX into your documentation. So, for example,
|
|
you can provide inline math using like \( y = x^2 \) or math on its own line
|
|
like \[ x = \sqrt{y} \] or $$ e = mc^2. $$ You can even use LaTeX environments!
|
|
So you can get numbered equations like this:
|
|
\begin{equation}
|
|
PV = nRT
|
|
\end{equation}
|
|
So let your imagination run wild. As you can tell, I'm more or less just
|
|
filling in space now. This will be the last sentence.
|
|
EOS
|
|
mkdir testpath/"src" do
|
|
(testpath/"src"/"ford_test_program.f90").write <<~EOS
|
|
program ford_test_program
|
|
!! Simple Fortran program to demonstrate the usage of FORD and to test its installation
|
|
use iso_fortran_env, only: output_unit, real64
|
|
implicit none
|
|
real (real64) :: global_pi = acos(-1)
|
|
!! a global variable, initialized to the value of pi
|
|
|
|
write(output_unit,'(A)') 'Small test program'
|
|
call do_stuff(20)
|
|
|
|
contains
|
|
subroutine do_stuff(repeat)
|
|
!! This is documentation for our subroutine that does stuff and things.
|
|
!! This text is captured by ford
|
|
integer, intent(in) :: repeat
|
|
!! The number of times to repeatedly do stuff and things
|
|
integer :: i
|
|
!! internal loop counter
|
|
|
|
! the main content goes here and this is comment is not processed by FORD
|
|
do i=1,repeat
|
|
global_pi = acos(-1)
|
|
end do
|
|
end subroutine
|
|
end program
|
|
EOS
|
|
end
|
|
system "#{bin}/ford", testpath/"test-project.md"
|
|
assert_predicate testpath/"doc"/"index.html", :exist?
|
|
end
|
|
end
|