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>
This commit is contained in:
Andrea Valenzuela 2022-05-04 22:03:50 +02:00 committed by GitHub
parent 0be5dea13f
commit 5a434cb840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

View File

@ -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')

View File

@ -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 @@ def cmake_args(self):
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):