spack/var/spack/repos/builtin/packages/py-thirdorder/package.py
Harmen Stoppels d51af675ef
make version(...) kwargs explicit (#36998)
- [x] Replace `version(ver, checksum=None, **kwargs)` signature with
      `version(ver, checksum=None, *, sha256=..., ...)` explicitly listing all arguments.
- [x] Fix various issues in packages:
  - `tags` instead of `tag`
  - `default` instead of `preferred`
  - `sha26` instead of `sha256`
  - etc

Also, use `sha256=...` consistently.

Note: setting `sha256` currently doesn't validate the checksum length, so you could do
`sha256="a"*32` and it would get checked as `md5`... but that's something for another PR.
2023-04-19 14:17:47 -07:00

45 lines
1.5 KiB
Python

# Copyright 2013-2023 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 PyThirdorder(PythonPackage):
"""It helps ShengBTE users create FORCE_CONSTANTS_3RD files efficiently"""
homepage = "https://www.shengbte.org"
url = "http://www.shengbte.org/downloads/thirdorder-v1.1.1-8526f47.tar.bz2"
# Deprecated because download doesn't work
version(
"1.1.1-8526f47",
sha256="5e1cc8d6ffa7efdb7325c397ca236863ea8a9c5bed1c558acca68b140f89167e",
deprecated=True,
)
depends_on("py-numpy", type=("build", "run"))
depends_on("py-scipy", type=("build", "run"))
depends_on("spglib", type=("build", "run"))
def patch(self):
setupfile = FileFilter("setup.py")
setupfile.filter(
"LIBRARY_DIRS = .*", 'LIBRARY_DIRS = ["%s"]' % self.spec["spglib"].prefix.lib
)
setupfile.filter(
"INCLUDE_DIRS = .*", 'INCLUDE_DIRS = ["%s"]' % self.spec["spglib"].prefix.include
)
sourcefile = FileFilter("thirdorder_core.c")
sourcefile.filter('#include "spglib.*"', '#include "spglib.h"')
@run_after("install")
def post_install(self):
mkdirp(self.prefix.bin)
install("thirdorder_espresso.py", self.prefix.bin)
install("thirdorder_vasp.py", self.prefix.bin)
install("thirdorder_castep.py", self.prefix.bin)
install("thirdorder_common.py", self.prefix.bin)