New packages: google-crc32c and py-google-crc32c (#28293)

This commit is contained in:
Marcus Boden 2022-01-10 15:58:02 +01:00 committed by GitHub
parent 464d294b63
commit 5958306466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# Copyright 2013-2021 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 GoogleCrc32c(CMakePackage):
"""CRC32C implementation with support for CPU-specific acceleration instructions."""
homepage = "https://github.com/google/crc32c"
url = "https://github.com/google/crc32c/archive/refs/tags/1.1.2.tar.gz"
maintainers = ['marcusboden']
version('1.1.2', 'ac07840513072b7fcebda6e821068aa04889018f24e10e46181068fb214d7e56')
depends_on('cmake@3.1:', type='build')
def cmake_args(self):
args = [
self.define('CRC32C_BUILD_TESTS', False),
self.define('CRC32C_BUILD_BENCHMARKS', False),
self.define('CRC32C_USE_GLOG', False),
self.define('BUILD_SHARED_LIBS', True),
]
return args

View File

@ -0,0 +1,24 @@
# Copyright 2013-2021 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 PyGoogleCrc32c(PythonPackage):
"""This package wraps the google/crc32c hardware-based implementation
of the CRC32C hashing algorithm."""
homepage = "https://github.com/googleapis/python-crc32c"
pypi = "google-crc32c/google-crc32c-1.3.0.tar.gz"
maintainers = ['marcusboden']
version('1.3.0', '276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df')
depends_on('py-setuptools', type='build')
depends_on('google-crc32c', type=('build', 'run'))
def setup_build_environment(self, env):
env.set('CRC32C_INSTALL_PREFIX', self.spec['google-crc32c'].prefix)