# Copyright 2013-2024 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) import os import sys from spack.package import * class Corge(Package): """A toy package to test dependencies""" homepage = "https://www.example.com" has_code = False version("3.0.0") depends_on("quux") def install(self, spec, prefix): corge_cc = """#include #include #include "corge.h" #include "corge_version.h" #include "quux/quux.h" const int Corge::version_major = corge_version_major; const int Corge::version_minor = corge_version_minor; Corge::Corge() { } int Corge::get_version() const { return 10 * version_major + version_minor; } int Corge::corgegate() const { int corge_version = get_version(); std::cout << "Corge::corgegate version " << corge_version << " invoked" << std::endl; std::cout << "Corge config directory = %s" < #include "corge.h" int main(int argc, char* argv[]) { std::cout << "corgerator called with "; if (argc == 0) { std::cout << "no command-line arguments" << std::endl; } else { std::cout << "command-line arguments:"; for (int i = 0; i < argc; ++i) { std::cout << " \"" << argv[i] << "\""; } std::cout << std::endl; } std::cout << "corgegating.."<