flatbuffers: python variant (#20706)

This commit is contained in:
Andrew W Elble 2021-01-06 16:59:09 -05:00 committed by GitHub
parent 820840d448
commit 559c64c365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,20 @@ class Flatbuffers(CMakePackage):
variant('shared', default=True, variant('shared', default=True,
description='Build shared instead of static libraries') description='Build shared instead of static libraries')
variant('python', default=False,
description='Build with python support')
depends_on('py-setuptools', when='+python', type='build')
depends_on('python@3.6:', when='+python', type=('build', 'run'))
extends('python', when='+python')
@run_after('install')
def python_install(self):
if '+python' in self.spec:
pydir = join_path(self.stage.source_path, 'python')
with working_dir(pydir):
setup_py('install', '--prefix=' + prefix,
'--single-version-externally-managed', '--root=/')
def cmake_args(self): def cmake_args(self):
args = [] args = []