From d3659941a62319bf588ade6dd576f9d251bda68b Mon Sep 17 00:00:00 2001 From: Vaishnavi Wani Date: Wed, 27 Nov 2024 19:38:03 +0100 Subject: [PATCH 1/2] Added Spack package for spack-exercise --- package.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 package.py diff --git a/package.py b/package.py new file mode 100644 index 0000000..7f4f50e --- /dev/null +++ b/package.py @@ -0,0 +1,44 @@ +# 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) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install spack-exercise +# +# You can edit this file again by typing: +# +# spack edit spack-exercise +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import * + + +class SpackExercise(CMakePackage): + """An example project for learning how to package software using Spack.""" + + homepage = "https://simulation-software-engineering.github.io/homepage/" + url = "https://github.com/Simulation-Software-Engineering/spack-exercise/archive/refs/tags/v0.1.0.tar.gz" + + maintainers = ["Vaish-W"] + + license("MIT", checked_by="Vaish-W") + + version("0.3.0", sha256="e54a4c037941d85a22fb3e6e73195df8448cf69a96aa44ef374ac518344812f0") + version("0.2.0", sha256="3dd6b4cc0f7aff179d8e290bc3879056237ae372738a4bd7222f6450fbcdfc77") + version("0.1.0", sha256="cac78e641cb703e3fe51956f91fe8347ac52f74ef037d8eadae5777c65a19a00") + + depends_on("cxx", type="build") + + # depends_on("foo") + depends_on("boost@1.65.1:", when="@0.2.0:") + depends_on("yaml-cpp@0.7.0:", when="@0.3.0:") From 27d82798a9e2c216eaf91beea5cc91d143d3e175 Mon Sep 17 00:00:00 2001 From: Vaishnavi Wani Date: Wed, 27 Nov 2024 19:53:19 +0100 Subject: [PATCH 2/2] Add main branch as version and optional dependencies using variants --- package.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package.py b/package.py index 7f4f50e..b77673d 100644 --- a/package.py +++ b/package.py @@ -22,6 +22,8 @@ from spack.package import * +variant('boost', default=True, description='Enable Boost support') +variant('yaml', default=True, description='Enable YAML support') class SpackExercise(CMakePackage): """An example project for learning how to package software using Spack.""" @@ -36,9 +38,11 @@ class SpackExercise(CMakePackage): version("0.3.0", sha256="e54a4c037941d85a22fb3e6e73195df8448cf69a96aa44ef374ac518344812f0") version("0.2.0", sha256="3dd6b4cc0f7aff179d8e290bc3879056237ae372738a4bd7222f6450fbcdfc77") version("0.1.0", sha256="cac78e641cb703e3fe51956f91fe8347ac52f74ef037d8eadae5777c65a19a00") + version('main', branch='main', git='https://github.com/Simulation-Software-Engineering/spack-exercise.git') depends_on("cxx", type="build") # depends_on("foo") - depends_on("boost@1.65.1:", when="@0.2.0:") - depends_on("yaml-cpp@0.7.0:", when="@0.3.0:") + depends_on('boost@1.65.1:', when='+boost') + depends_on('yaml-cpp@0.7.0:', when='+yaml') +