|
| 1 | +class FortranStdlib < Formula |
| 2 | + desc "Fortran Standard Library" |
| 3 | + homepage "https://stdlib.fortran-lang.org" |
| 4 | + url "https://github.com/fortran-lang/stdlib/archive/refs/tags/v0.7.0.tar.gz" |
| 5 | + sha256 "07615b1fd0d9c78f04ec5a26234d091cb7e359933ba2caee311dcd6f58d87af0" |
| 6 | + license "MIT" |
| 7 | + |
| 8 | + bottle do |
| 9 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "349996236701c1fdb6a5fdec58dc627f3550929fb8ec80509b8f8d380fbf19de" |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "f37094c09728b25724680dcfee1aa5e2fa9da72e55787fe601156af2c397601f" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "b1453730b11fe70788ebce7b4a007a9536d4f323bbf4b41f87d8136d6f4ac820" |
| 12 | + sha256 cellar: :any_skip_relocation, sonoma: "88b04ee788cef96770fb93382cdeb2cf18c7892f2b939ae39f058b1da46a1962" |
| 13 | + sha256 cellar: :any_skip_relocation, ventura: "0a92743f68b516233fd5796fd48b6070a75ecaf9d1176b7705cadee4ee3df04c" |
| 14 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "75455c2f164e2797e3e05ec2fe8b0528cb16c1fefbb5a84a3a29be96b17b427d" |
| 15 | + end |
| 16 | + |
| 17 | + depends_on "cmake" => [:build, :test] |
| 18 | + depends_on "fypp" => :build |
| 19 | + depends_on "gcc" # for gfortran |
| 20 | + |
| 21 | + def install |
| 22 | + system "cmake", "-S", ".", "-B", "build", *std_cmake_args |
| 23 | + system "cmake", "--build", "build" |
| 24 | + system "cmake", "--install", "build" |
| 25 | + pkgshare.install "example" |
| 26 | + end |
| 27 | + |
| 28 | + test do |
| 29 | + cp pkgshare/"example/version/example_version.f90", testpath |
| 30 | + |
| 31 | + (testpath/"CMakeLists.txt").write <<~CMAKE |
| 32 | + cmake_minimum_required(VERSION 3.14) |
| 33 | + project(test LANGUAGES Fortran) |
| 34 | +
|
| 35 | + find_package(fortran_stdlib REQUIRED) |
| 36 | +
|
| 37 | + add_executable(test example_version.f90) |
| 38 | + target_link_libraries(test PRIVATE fortran_stdlib::fortran_stdlib) |
| 39 | + CMAKE |
| 40 | + |
| 41 | + system "cmake", "-S", "." |
| 42 | + system "cmake", "--build", "." |
| 43 | + system "./test" |
| 44 | + end |
| 45 | +end |
0 commit comments