Skip to content

Commit

Permalink
Merge pull request #463 from AlexanderRichert-NOAA/bufr_aug24
Browse files Browse the repository at this point in the history
Update bufr recipe (now matches upstream Spack)
  • Loading branch information
climbfuji authored Aug 16, 2024
2 parents fb50a61 + de02676 commit a20ed6d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions var/spack/repos/builtin/packages/bufr/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ class Bufr(CMakePackage):
"""

homepage = "https://noaa-emc.github.io/NCEPLIBS-bufr"
url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.0.1.tar.gz"
url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.1.0.tar.gz"
git = "https://github.com/NOAA-EMC/NCEPLIBS-bufr"

maintainers("AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA", "jbathegit")

version("develop", branch="develop")
version("12.1.0", sha256="b5eae61b50d4132b2933b6e6dfc607e5392727cdc4f46ec7a94a19109d91dcf3")
version("12.0.1", sha256="525f26238dba6511a453fc71cecc05f59e4800a603de2abbbbfb8cbb5adf5708")
version("12.0.0", sha256="d01c02ea8e100e51fd150ff1c4a1192ca54538474acb1b7f7a36e8aeab76ee75")
version("11.7.1", sha256="6533ce6eaa6b02c0cb5424cfbc086ab120ccebac3894980a4daafd4dfadd71f8")
Expand All @@ -40,6 +41,8 @@ class Bufr(CMakePackage):

variant("python", default=False, description="Enable Python interface")
variant("shared", default=True, description="Build shared libraries", when="@11.5:")
variant("test_files", default="none", description="Path to test files")
variant("utils", default=True, description="Build utilities", when="@12.1:")

extends("python", when="+python")

Expand All @@ -49,6 +52,8 @@ class Bufr(CMakePackage):
depends_on("py-pip", type="build", when="+python")
depends_on("py-wheel", type="build", when="+python")

conflicts("%oneapi@:2024.1", msg="Requires oneapi 2024.2 or later")

def url_for_version(self, version):
pre = "bufr_" if version < Version("12.0.1") else ""
return (
Expand All @@ -65,8 +70,13 @@ def cmake_args(self):
self.define_from_variant("ENABLE_PYTHON", "python"),
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define("BUILD_TESTS", self.run_tests),
self.define("BUILD_TESTING", self.run_tests),
self.define_from_variant("BUILD_UTILS", "utils"),
]

if not self.spec.satisfies("test_files=none"):
args.append(self.define_from_variant("TEST_FILE_DIR", "test_files"))

return args

def flag_handler(self, name, flags):
Expand Down Expand Up @@ -116,6 +126,5 @@ def setup_run_environment(self, env):
self._setup_bufr_environment(env, suffix)

def check(self):
if self.spec.satisfies("~python"):
with working_dir(self.builder.build_directory):
make("test")
with working_dir(self.builder.build_directory):
make("test")

0 comments on commit a20ed6d

Please sign in to comment.