From 86b5c0f2fbeae6e18781e2430d8d512afbb88e5d Mon Sep 17 00:00:00 2001 From: Stephen Herbener Date: Fri, 29 Sep 2023 12:27:35 -0600 Subject: [PATCH 1/3] Added checksum and code to build proper url for downloading bufr tar files. --- var/spack/repos/builtin/packages/bufr/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bufr/package.py b/var/spack/repos/builtin/packages/bufr/package.py index 0edee3fe87eca4..60b028cd398e78 100644 --- a/var/spack/repos/builtin/packages/bufr/package.py +++ b/var/spack/repos/builtin/packages/bufr/package.py @@ -17,10 +17,11 @@ class Bufr(CMakePackage): """ homepage = "https://noaa-emc.github.io/NCEPLIBS-bufr" - url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/bufr_v11.5.0.tar.gz" + url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags/v12.0.1.tar.gz" maintainers("t-brown", "AlexanderRichert-NOAA", "edwardhartnett", "Hang-Lei-NOAA", "jbathegit") + version("12.0.1", sha256="525f26238dba6511a453fc71cecc05f59e4800a603de2abbbbfb8cbb5adf5708") version("12.0.0", sha256="d01c02ea8e100e51fd150ff1c4a1192ca54538474acb1b7f7a36e8aeab76ee75") version("11.7.1", sha256="6533ce6eaa6b02c0cb5424cfbc086ab120ccebac3894980a4daafd4dfadd71f8") version("11.7.0", sha256="6a76ae8e7682bbc790321bf80c2f9417775c5b01a5c4f10763df92e01b20b9ca") @@ -28,6 +29,15 @@ class Bufr(CMakePackage): version("11.5.0", sha256="d154839e29ef1fe82e58cf20232e9f8a4f0610f0e8b6a394b7ca052e58f97f43") version("11.4.0", sha256="946482405e675b99e8e0c221d137768f246076f5e9ba92eed6cae47fb68b7a26") + # tar file name depends on version + def url_for_version(self, version): + url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags" + if (version >= Version("12.0.1")): + url += "/v{0}.tar.gz".format(version) + else: + url += "/bufr_v{0}.tar.gz".format(version) + return url + # Patch to not add "-c" to ranlib flags when using llvm-ranlib on Apple systems patch("cmakelists-apple-llvm-ranlib.patch", when="@11.5.0:11.6.0") # C test does not explicity link to -lm causing DSO error when building shared libs From 4a4176563d4d80ca856df8682074b17253ff370a Mon Sep 17 00:00:00 2001 From: Stephen Herbener Date: Fri, 29 Sep 2023 13:43:51 -0600 Subject: [PATCH 2/3] Fixed coding style error --- var/spack/repos/builtin/packages/bufr/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bufr/package.py b/var/spack/repos/builtin/packages/bufr/package.py index 60b028cd398e78..d7d81252191b19 100644 --- a/var/spack/repos/builtin/packages/bufr/package.py +++ b/var/spack/repos/builtin/packages/bufr/package.py @@ -32,7 +32,7 @@ class Bufr(CMakePackage): # tar file name depends on version def url_for_version(self, version): url = "https://github.com/NOAA-EMC/NCEPLIBS-bufr/archive/refs/tags" - if (version >= Version("12.0.1")): + if version >= Version("12.0.1"): url += "/v{0}.tar.gz".format(version) else: url += "/bufr_v{0}.tar.gz".format(version) From 4e24028252ca3e1a1b1499268bbe165b3fc4e46a Mon Sep 17 00:00:00 2001 From: Stephen Herbener Date: Fri, 29 Sep 2023 18:00:25 -0600 Subject: [PATCH 3/3] Added qualifier on the python patch according to the bufr version being built. The python patch is required up through bufr@12.0.0, but not longer needed for bufr@12.0.1. --- var/spack/repos/builtin/packages/bufr/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bufr/package.py b/var/spack/repos/builtin/packages/bufr/package.py index d7d81252191b19..3182dc77529c27 100644 --- a/var/spack/repos/builtin/packages/bufr/package.py +++ b/var/spack/repos/builtin/packages/bufr/package.py @@ -43,7 +43,7 @@ def url_for_version(self, version): # C test does not explicity link to -lm causing DSO error when building shared libs patch("c-tests-libm.patch", when="@11.5.0:11.7.0") # Patch to identify Python version correctly - patch("python-version.patch", when="+python") + patch("python-version.patch", when="+python @:12.0.0") variant("python", default=False, description="Enable Python interface?") variant("shared", default=True, description="Build shared libraries", when="@11.5:")