From 5a434cb8400a97a6ae9eeb30b658dc262fa65433 Mon Sep 17 00:00:00 2001 From: Andrea Valenzuela Date: Wed, 4 May 2022 22:03:50 +0200 Subject: Add scitokens-cpp recipe and also as a variant for xrootd (#30362) * Add scitokens-cpp recipe * Add scitokens-cpp variant in xrootd * Fix typo * Fix flake8 style errors * Update license date Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> --- .../builtin/packages/scitokens-cpp/package.py | 25 ++++++++++++++++++++++ var/spack/repos/builtin/packages/xrootd/package.py | 8 +++++++ 2 files changed, 33 insertions(+) create mode 100644 var/spack/repos/builtin/packages/scitokens-cpp/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/scitokens-cpp/package.py b/var/spack/repos/builtin/packages/scitokens-cpp/package.py new file mode 100644 index 0000000000..8057cbf562 --- /dev/null +++ b/var/spack/repos/builtin/packages/scitokens-cpp/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2022 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) + +from spack import * + + +class ScitokensCpp(CMakePackage): + """ A C++ implementation of the SciTokens library with a C library interface. + SciTokens provide a token format for distributed authorization. """ + + homepage = "https://github.com/scitokens/scitokens-cpp" + url = "https://github.com/scitokens/scitokens-cpp/archive/refs/tags/v0.7.0.tar.gz" + + version('0.7.0', sha256='72600cf32523b115ec7abf4ac33fa369e0a655b3d3b390e1f68363e6c4e961b6') + + depends_on('sqlite') + depends_on('curl') + depends_on('uuid', type='build') + + # https://github.com/scitokens/scitokens-cpp/issues/72 + @when('^openssl@3:') + def patch(self): + filter_file(' -Werror', '', 'CMakeLists.txt') diff --git a/var/spack/repos/builtin/packages/xrootd/package.py b/var/spack/repos/builtin/packages/xrootd/package.py index 1f3caa1ed6..7cefe530bd 100644 --- a/var/spack/repos/builtin/packages/xrootd/package.py +++ b/var/spack/repos/builtin/packages/xrootd/package.py @@ -60,6 +60,9 @@ class Xrootd(CMakePackage): multi=False, description='Use the specified C++ standard when building.') + variant('scitokens-cpp', default=False, + when='@5.1.0:', description='Enable support for SciTokens') + conflicts('cxxstd=98', when='@4.7.0:') depends_on('bzip2') @@ -74,6 +77,7 @@ class Xrootd(CMakePackage): depends_on('curl') depends_on('krb5', when='+krb5') depends_on('json-c') + depends_on('scitokens-cpp', when='+scitokens-cpp') extends('python', when='+python') patch('python-support.patch', level=1, when='@:4.8+python') @@ -105,6 +109,10 @@ class Xrootd(CMakePackage): options.append('-DPYTHON_EXECUTABLE=%s' % spec['python'].command.path) + if '+scitokens-cpp' in self.spec: + options.append('-DSCITOKENS_CPP_DIR=%s' % + spec['scitokens-cpp'].prefix) + return options def setup_build_environment(self, env): -- cgit v1.2.3-70-g09d2