Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy packages required for OM3 from COSIMA/spack_packages #93

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions packages/fortranxml/package.py
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 = ["andreww"]
harshula marked this conversation as resolved.
Show resolved Hide resolved

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)
CodeGat marked this conversation as resolved.
Show resolved Hide resolved

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}}
""")
Loading