libgit2: add mmap variant, disabling it makes it work on filesystems that do not implement mmap (#28520)

This commit is contained in:
Harmen Stoppels 2022-02-03 11:31:53 +01:00 committed by GitHub
parent 932408ac2b
commit 4134b318ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,8 @@ class Libgit2(CMakePackage):
variant('ssh', default=True, description='Enable SSH support')
variant('curl', default=False, description='Enable libcurl support (only supported through v0.27)')
variant('mmap', default=True, description='Enable mmap support', when='@1.1.1:')
# Build Dependencies
depends_on('cmake@2.8:', type='build', when="@:0.28")
depends_on('cmake@3.5:', type='build', when="@0.99:")
@ -71,6 +73,11 @@ class Libgit2(CMakePackage):
conflicts('+curl', when='@0.28:')
def flag_handler(self, name, flags):
if name == 'cflags' and not self.spec.variants.get('mmap', False):
flags.append('-DNO_MMAP')
return (flags, None, None)
def cmake_args(self):
args = []
if 'https=system' in self.spec: