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/1c/80/a8750198772c8647aa2c8d1459d5d8dbedd317a2ba18fdad73802073e1d5/FORD-6.1.13.tar.gz"
|
|
sha256 "95b743ea25c5a9c6a9e13db3633e04f91e11d1debb69f48ca3ef7fefc51f0559"
|
|
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: "e30c75bc66985872ca061915d73c6a0fbb5acf8d2a357429c666b40cb7238796"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "4090c066a1046d91e2717929e3d934a852427b5e8e6932d5c58a1f149a2f0932"
|
|
sha256 cellar: :any_skip_relocation, monterey: "97f6fc98e88524c1d6483501f4a80d59eff476510c6c3eab95ccb4f726af0b68"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "d2202d8ab39f1aae07eceed1400e3fa002df838d84e41fcd8a6af62546803399"
|
|
sha256 cellar: :any_skip_relocation, catalina: "7d56b3bc4f14b283ad116f2376e68b94e0dff0bf9ffb1b52571dd05e15987f9c"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "12e38adb4a3d2b4eed5d9852a70d663ce6938e2d74ee86e7c586183266cc85a7"
|
|
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/e8/b0/cd2b968000577ec5ce6c741a54d846dfa402372369b8b6861720aa9ecea7/beautifulsoup4-4.11.1.tar.gz"
|
|
sha256 "ad9aa55b65ef2808eb405f46cf74df7fcb7044d5cbc26487f96eb2ef2e436693"
|
|
end
|
|
|
|
resource "graphviz" do
|
|
url "https://files.pythonhosted.org/packages/43/ae/a0ee0dbddc06dbecfaece65c45c8c4729c394b5eb62e04e711e6495cdf64/graphviz-0.20.zip"
|
|
sha256 "76bdfb73f42e72564ffe9c7299482f9d72f8e6cb8d54bce7b48ab323755e9ba5"
|
|
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/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz"
|
|
sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
|
|
end
|
|
|
|
resource "Markdown" do
|
|
url "https://files.pythonhosted.org/packages/d6/58/79df20de6e67a83f0d0bbfe6c19bb82adf68cdf362885257eb01099f930a/Markdown-3.3.7.tar.gz"
|
|
sha256 "cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874"
|
|
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/59/0f/eb10576eb73b5857bc22610cdfc59e424ced4004fe7132c8f2af2cc168d3/Pygments-2.12.0.tar.gz"
|
|
sha256 "5eb116118f9612ff1ee89ac96437bb6b49e8f04d8a13b514ba26f620208e26eb"
|
|
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/f3/03/bac179d539362319b4779a00764e95f7542f4920084163db6b0fd4742d38/soupsieve-2.3.2.post1.tar.gz"
|
|
sha256 "fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d"
|
|
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
|