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/48/b9/bc941c3a50a8c1d876a74587c60b4ff2767e755bae9a65a13036ec000edf/FORD-6.1.8.tar.gz"
|
|
sha256 "64535c50f57a0630b642e125f046e74f3603d6d7d2813aed8b5ee46fbbe4f33c"
|
|
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: "fad06f29e46424c8aa3b02691872289001d1e99f729fc9c5801af7ba9783b731"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "e5e311c13deea954efc29b96c4dc475d6cf3e67ea6fa7da9e867e04e41d32122"
|
|
sha256 cellar: :any_skip_relocation, monterey: "38c6324ac3e7391a7660f12430600dc2c55d7bc4bad5f6682e5f2d7e93c6d37a"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "282cae1638f5e448644fd8f0d2fd2511f2794fac8275bc6d8ac0e2c899c3e204"
|
|
sha256 cellar: :any_skip_relocation, catalina: "719b5f0b723d6b83117becd007094aaeb92b7a4f669967dffcd6872b49ebca60"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "47e7c273e058e55a77d86d3bdcdc683f070a83693f97f234bca62eb5c10df5cc"
|
|
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/50/05/fef7fbb7e781e0632ebba4e6e37bcc88b9615e76338850dc31435091ddc0/importlib_metadata-4.10.0.tar.gz"
|
|
sha256 "92a8b58ce734b2a4494878e0ecf7d79ccd7a128b5fc6014c401e0b61f006f0f6"
|
|
end
|
|
|
|
resource "Jinja2" do
|
|
url "https://files.pythonhosted.org/packages/91/a5/429efc6246119e1e3fbf562c00187d04e83e54619249eb732bb423efa6c6/Jinja2-3.0.3.tar.gz"
|
|
sha256 "611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7"
|
|
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/bf/10/ff66fea6d1788c458663a84d88787bae15d45daa16f6b3ef33322a51fc7e/MarkupSafe-2.0.1.tar.gz"
|
|
sha256 "594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"
|
|
end
|
|
|
|
resource "md-environ" do
|
|
url "https://files.pythonhosted.org/packages/68/a9/86666edbf0d3929d5b3be3347c153881139aa1e28af38f6496edcc034003/md-environ-0.1.0.tar.gz"
|
|
sha256 "fe3c2a255af523d6f522831c699336cd71f9d543714067d93206ed35836f1793"
|
|
end
|
|
|
|
resource "Pygments" do
|
|
url "https://files.pythonhosted.org/packages/94/9c/cb656d06950268155f46d4f6ce25d7ffc51a0da47eadf1b164bbf23b718b/Pygments-2.11.2.tar.gz"
|
|
sha256 "4e426f72023d88d03b2fa258de560726ce890ff3b630f88c21cbb8b2503b8c6a"
|
|
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/e3/c1/b3e42d5b659ca598508e2a9ef315d5eef0a970f874ef9d3b38d4578765bd/tqdm-4.62.3.tar.gz"
|
|
sha256 "d359de7217506c9851b7869f3708d8ee53ed70a1b8edbba4dbcb47442592920d"
|
|
end
|
|
|
|
resource "zipp" do
|
|
url "https://files.pythonhosted.org/packages/94/64/3115548d41cb001378099cb4fc6a6889c64ef43ac1b0e68c9e80b55884fa/zipp-3.7.0.tar.gz"
|
|
sha256 "9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d"
|
|
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
|