167 lines
7.4 KiB
Ruby
167 lines
7.4 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/22/cb/925f9d663a1f56c00667d86c439da7212871f45f3ac6e0197a2ea1b05619/FORD-6.1.5.tar.gz"
|
|
sha256 "24c5868b02a584464c74acfa48b673a8a27ff84c7dc9beda5a37acd4cd3671e0"
|
|
license "GPL-3.0-or-later"
|
|
head "https://github.com/Fortran-FOSS-Programmers/ford.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "70f5ff6ac0c983729eeac784f242d960bb7eaa689e89fececd008dcf1e3ce509"
|
|
sha256 cellar: :any_skip_relocation, monterey: "a9de23d318a57a3e2c08c8de29ca9623b767585265b36b0ca9854aa56d4cc54b"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "11601c0602523977374dd364e96c1d3cd50ac4eb362037ff92656374b5efc047"
|
|
sha256 cellar: :any_skip_relocation, catalina: "5a91b6485e47b8a315aaa3b8dde2941156f524945f79481dc6bda531b90cd561"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "d8119d6aefce3dd6c92499be0a9aa688f5e9af4bd99150123d2592fdb164128b"
|
|
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/09/6b/17598d682eecf296ea77df7ec1866f0c5bb3448dffc0a6a6610d8563d5dd/graphviz-0.19.zip"
|
|
sha256 "b42554a1c47f24a9473b7f4e380d17b228586a067c97ea69d5354d6074be8dfd"
|
|
end
|
|
|
|
resource "importlib_metadata" do
|
|
url "https://files.pythonhosted.org/packages/2e/6d/4508b1922b1610f6646fd95681fa1b0c092df35ec14018218f4638b7342a/importlib_metadata-4.8.2.tar.gz"
|
|
sha256 "75bdec14c397f528724c1bfd9709d660b33a4d2e77387a3358f20b848bb5e5fb"
|
|
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/b7/b3/5cba26637fe43500d4568d0ee7b7362de1fb29c0e158d50b4b69e9a40422/Pygments-2.10.0.tar.gz"
|
|
sha256 "f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"
|
|
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/02/bf/0d03dbdedb83afec081fefe86cae3a2447250ef1a81ac601a9a56e785401/zipp-3.6.0.tar.gz"
|
|
sha256 "71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
doc.install "2008standard.pdf", "2003standard.pdf"
|
|
pkgshare.install "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
|