From 52969dfa78456f0d87493e2554ef9ea8510b4abe Mon Sep 17 00:00:00 2001 From: Olivier Cessenat Date: Mon, 17 Mar 2025 09:05:08 +0100 Subject: [PATCH] gsl: add external find (#48665) --- var/spack/repos/builtin/packages/gsl/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/var/spack/repos/builtin/packages/gsl/package.py b/var/spack/repos/builtin/packages/gsl/package.py index d732d4b9432..855f882fb77 100644 --- a/var/spack/repos/builtin/packages/gsl/package.py +++ b/var/spack/repos/builtin/packages/gsl/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re from spack.package import * @@ -15,6 +16,10 @@ class Gsl(AutotoolsPackage, GNUMirrorPackage): homepage = "https://www.gnu.org/software/gsl" gnu_mirror_path = "gsl/gsl-2.3.tar.gz" + maintainers("cessenat") + + tags = ["hpc"] + executables = ["^gsl-config$"] license("GPL-3.0-or-later") @@ -70,3 +75,9 @@ def setup_run_environment(self, env): # cmake looks for GSL_ROOT_DIR to find GSL so this helps pick the spack one # when there are multiple installations (e.g. a system one and a spack one) env.set("GSL_ROOT_DIR", self.prefix) + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"\s*(\d[\d\.]+)", output) + return match.group(1) if match else None