161 lines
6.9 KiB
Ruby
161 lines
6.9 KiB
Ruby
class Ford < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Automatic documentation generator for modern Fortran programs"
|
|
homepage "https://github.com/cmacmackin/ford/"
|
|
url "https://github.com/cmacmackin/ford/archive/v6.0.0.tar.gz"
|
|
sha256 "45fd53c7e5263fea2e751c436de6a1513d250647e98e32668b9965677974309e"
|
|
license "GPL-3.0"
|
|
revision 3
|
|
head "https://github.com/cmacmackin/ford.git"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "004dc7234aa36e6fb9fab6c0ba7330a8df69edaa4e0eab9279e9c2dc5a76cb5e"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "9aab668aebf8641782123a24d00dc367e0f41e21dfabc05cfbd82ed4e3a402f0"
|
|
sha256 cellar: :any_skip_relocation, catalina: "1d645364d5ef8813745637cc83089a521306e319104eeccca786af71c3b937e8"
|
|
sha256 cellar: :any_skip_relocation, mojave: "0779dbcb80b7076526778d04d0ee35346973a34b5bc1eb945d26e0fe1c2beac3"
|
|
sha256 cellar: :any_skip_relocation, high_sierra: "3a4005e1f83a4c86dfde8adc54ef2e0bf592c347020e56b26e961cc71b88bf44"
|
|
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/3b/e4/7cfc641f11e0eef60123912611a5c9ee7d4638da7325878b695b9ae4bb6f/beautifulsoup4-4.9.0.tar.gz"
|
|
sha256 "594ca51a10d2b3443cbac41214e12dbb2a1cd57e1a7344659849e2e20ba6a8d8"
|
|
end
|
|
|
|
resource "graphviz" do
|
|
url "https://files.pythonhosted.org/packages/5d/71/f63fe59145fca7667d92475f1574dd583ad1f48ab228e9a5dddd5733197f/graphviz-0.13.2.zip"
|
|
sha256 "60acbeee346e8c14555821eab57dbf68a169e6c10bce40e83c1bf44f63a62a01"
|
|
end
|
|
|
|
resource "Jinja2" do
|
|
url "https://files.pythonhosted.org/packages/d8/03/e491f423379ea14bb3a02a5238507f7d446de639b623187bccc111fbecdf/Jinja2-2.11.1.tar.gz"
|
|
sha256 "93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250"
|
|
end
|
|
|
|
resource "Markdown" do
|
|
url "https://files.pythonhosted.org/packages/98/79/ce6984767cb9478e6818bd0994283db55c423d733cc62a88a3ffb8581e11/Markdown-3.2.1.tar.gz"
|
|
sha256 "90fee683eeabe1a92e149f7ba74e5ccdc81cd397bd6c516d93a8da0ef90b6902"
|
|
end
|
|
|
|
resource "markdown-include" do
|
|
url "https://files.pythonhosted.org/packages/ef/44/eb6e9b4fa1110b719abb876c9b6dd8b46af886a94536ec4e9117fe5e7b97/markdown-include-0.5.1.tar.gz"
|
|
sha256 "72a45461b589489a088753893bc95c5fa5909936186485f4ed55caa57d10250f"
|
|
end
|
|
|
|
resource "MarkupSafe" do
|
|
url "https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz"
|
|
sha256 "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"
|
|
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/6e/4d/4d2fe93a35dfba417311a4ff627489a947b01dc0cc377a3673c00cf7e4b2/Pygments-2.6.1.tar.gz"
|
|
sha256 "647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44"
|
|
end
|
|
|
|
resource "soupsieve" do
|
|
url "https://files.pythonhosted.org/packages/15/53/3692c565aea19f7d9dd696fee3d0062782e9ad5bf9535267180511a15967/soupsieve-2.0.tar.gz"
|
|
sha256 "e914534802d7ffd233242b785229d5ba0766a7f487385e3f714446a07bf540ae"
|
|
end
|
|
|
|
resource "toposort" do
|
|
url "https://files.pythonhosted.org/packages/e5/d8/9bc1598ddf74410beba243ffeaee8d0b3ca7e9ac5cefe77367da497433e1/toposort-1.5.tar.gz"
|
|
sha256 "dba5ae845296e3bf37b042c640870ffebcdeb8cd4df45adaa01d8c5476c557dd"
|
|
end
|
|
|
|
resource "tqdm" do
|
|
url "https://files.pythonhosted.org/packages/12/67/e736c012c6c8b4092dd54bb9bdd7737acf9a140a98c58b87c35363d0105d/tqdm-4.45.0.tar.gz"
|
|
sha256 "00339634a22c10a7a22476ee946bbde2dbe48d042ded784e4d88e0236eca5d81"
|
|
end
|
|
|
|
def install
|
|
# Fix "ld: file not found: /usr/lib/system/libsystem_darwin.dylib" for lxml
|
|
ENV["SDKROOT"] = MacOS.sdk_path if MacOS.version == :sierra
|
|
|
|
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
|