summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/py-meshio/package.py24
-rw-r--r--var/spack/repos/builtin/packages/py-meshio/setup.patch10
2 files changed, 34 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-meshio/package.py b/var/spack/repos/builtin/packages/py-meshio/package.py
new file mode 100644
index 0000000000..3efcf581e6
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-meshio/package.py
@@ -0,0 +1,24 @@
+# Copyright 2013-2021 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 import *
+
+
+class PyMeshio(PythonPackage):
+ """MeshIO is a Python library to read and write many mesh formats."""
+
+ homepage = "https://github.com/nschloe/meshio"
+ pypi = "meshio/meshio-5.0.0.tar.gz"
+
+ version('5.0.0', sha256='f6327c06d6171d30e0991d3dcb048751035f9cfac1f19e2444971275fd971188')
+
+ # MeshIO uses a setup.cfg/pyproject.toml structure, which spack doesn't yet handle.
+ # This patch adds a small setup.py file that spack can call.
+ patch('setup.patch')
+
+ depends_on('python@3.7:', type=('build', 'run'))
+ depends_on('py-setuptools', type='build')
+ depends_on('py-numpy', type=('build', 'run'))
+ depends_on('py-importlib-metadata', when='^python@:3.7', type=('build', 'run'))
diff --git a/var/spack/repos/builtin/packages/py-meshio/setup.patch b/var/spack/repos/builtin/packages/py-meshio/setup.patch
new file mode 100644
index 0000000000..77089e871f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-meshio/setup.patch
@@ -0,0 +1,10 @@
+diff --git a/setup.py b/setup.py
+new file mode 100644
+index 0000000..7f1a176
+--- /dev/null
++++ b/setup.py
+@@ -0,0 +1,4 @@
++from setuptools import setup
++
++if __name__ == "__main__":
++ setup()