2024-01-02 16:21:30 +08:00
|
|
|
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2016-12-29 04:37:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
class BaseWithDirectives(Package):
|
|
|
|
depends_on("cmake", type="build")
|
|
|
|
depends_on("mpi")
|
|
|
|
variant("openblas", description="Activates openblas", default=True)
|
|
|
|
provides("service1")
|
|
|
|
|
2018-12-15 00:37:22 +08:00
|
|
|
def use_module_variable(self):
|
|
|
|
"""Must be called in build environment. Allows us to test parent class
|
|
|
|
using module variables set up by build_environment."""
|
|
|
|
env["TEST_MODULE_VAR"] = "test_module_variable"
|
|
|
|
return env["TEST_MODULE_VAR"]
|
|
|
|
|
2016-12-29 04:37:02 +08:00
|
|
|
|
|
|
|
class SimpleInheritance(BaseWithDirectives):
|
|
|
|
"""Simple package which acts as a build dependency"""
|
|
|
|
|
|
|
|
homepage = "http://www.example.com"
|
|
|
|
url = "http://www.example.com/simple-1.0.tar.gz"
|
|
|
|
|
2023-04-20 05:17:47 +08:00
|
|
|
version("1.0", md5="0123456789abcdef0123456789abcdef")
|
2016-12-29 04:37:02 +08:00
|
|
|
|
|
|
|
depends_on("openblas", when="+openblas")
|
|
|
|
provides("lapack", when="+openblas")
|
2024-09-25 21:01:19 +08:00
|
|
|
|
|
|
|
depends_on("c", type="build")
|