-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fortranxml package from COSIMA/spack_packages (#93)
* Required by ACCESS-OM3 * Add url_for_version and removed url specification * Update maintainer info
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
||
from spack.package import * | ||
|
||
|
||
class Fortranxml(AutotoolsPackage): | ||
"""Fortran XML (FoX) s a library, written entirely in Fortran, designed to allow | ||
the easy use of XML from Fortran programs. FoX caters for both XML output | ||
and input. | ||
""" | ||
|
||
homepage = "https://github.com/andreww/fox" | ||
git = "https://github.com/andreww/fox.git" | ||
|
||
maintainers = ["harshula"] | ||
|
||
version("4.1.2", sha256="dea0adc9cc035238fa9cdba42f2bf56481e3a64ac8aa0aece9119f127f71d4e7") | ||
|
||
flag_handler = AutotoolsPackage.build_system_flags | ||
|
||
def url_for_version(self, version): | ||
return "https://github.com/andreww/fox/tarball/{0}".format(version) | ||
|
||
def install(self, spec, prefix): | ||
super(AutotoolsPackage, self).install(spec, prefix) | ||
|
||
pkgconfig_dir = join_path(prefix.lib, "pkgconfig") | ||
pkgconfig_file = join_path(pkgconfig_dir, "fox.pc") | ||
mkdir(pkgconfig_dir) | ||
|
||
with open(pkgconfig_file, "w", encoding="utf-8") as pc: | ||
pc.write(f"""\ | ||
prefix={prefix} | ||
exec_prefix=${{prefix}} | ||
libdir=${{exec_prefix}}/lib | ||
includedir=${{prefix}}/finclude | ||
Name: Fortran XML (FoX) | ||
Description: A Fortran XML library | ||
Version: {spec.version} | ||
Libs: -L${{libdir}} -lFoX_dom -lFoX_sax -lFoX_wcml -lFoX_wkml -lFoX_wxml -lFoX_common -lFoX_utils -lFoX_fsys | ||
Cflags: -I${{includedir}} | ||
""") |