opencv : Fix pep8 style issues

This commit is contained in:
mwilliammyers 2016-07-12 20:29:04 -06:00
parent cf0f5756f5
commit 578ddea418

View File

@ -26,22 +26,28 @@
class Opencv(Package): class Opencv(Package):
"""OpenCV is released under a BSD license and hence it's free for both
academic and commercial use. It has C++, C, Python and Java interfaces and
supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for
computational efficiency and with a strong focus on real-time applications.
Written in optimized C/C++, the library can take advantage of multi-core
processing. Enabled with OpenCL, it can take advantage of the hardware
acceleration of the underlying heterogeneous compute platform. Adopted all
around the world, OpenCV has more than 47 thousand people of user community
and estimated number of downloads exceeding 9 million. Usage ranges from
interactive art, to mines inspection, stitching maps on the web or through
advanced robotics.
""" """
OpenCV is released under a BSD license and hence it's free for both academic and commercial use. It has C++, C,
Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for
computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library
can take advantage of multi-core processing. Enabled with OpenCL, it can take advantage of the hardware
acceleration of the underlying heterogeneous compute platform. Adopted all around the world, OpenCV has more than
47 thousand people of user community and estimated number of downloads exceeding 9 million. Usage ranges from
interactive art, to mines inspection, stitching maps on the web or through advanced robotics.
"""
homepage = 'http://opencv.org/' homepage = 'http://opencv.org/'
url = 'https://github.com/Itseez/opencv/archive/3.1.0.tar.gz' url = 'https://github.com/Itseez/opencv/archive/3.1.0.tar.gz'
version('3.1.0', '70e1dd07f0aa06606f1bc0e3fa15abd3') version('3.1.0', '70e1dd07f0aa06606f1bc0e3fa15abd3')
variant('shared', default=True, description='Enables the build of shared libraries') variant('shared', default=True,
variant('debug', default=False, description='Builds a debug version of the libraries') description='Enables the build of shared libraries')
variant('debug', default=False,
description='Builds a debug version of the libraries')
variant('eigen', default=True, description='Activates support for eigen') variant('eigen', default=True, description='Activates support for eigen')
variant('ipp', default=True, description='Activates support for IPP') variant('ipp', default=True, description='Activates support for IPP')
@ -66,24 +72,29 @@ def install(self, spec, prefix):
cmake_options = [] cmake_options = []
cmake_options.extend(std_cmake_args) cmake_options.extend(std_cmake_args)
cmake_options.extend(['-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), cmake_options.extend(
'-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), ['-DCMAKE_BUILD_TYPE:STRING=%s' % (
'Debug' if '+debug' in spec else 'Release'),
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in spec else 'OFF'),
'-DENABLE_PRECOMPILED_HEADERS:BOOL=OFF', '-DENABLE_PRECOMPILED_HEADERS:BOOL=OFF',
'-DWITH_IPP:BOOL=%s' % ('ON' if '+ipp' in spec else 'OFF'), '-DWITH_IPP:BOOL=%s' % (
'-DWITH_CUDA:BOOL=%s' % ('ON' if '+cuda' in spec else 'OFF')]) 'ON' if '+ipp' in spec else 'OFF'),
'-DWITH_CUDA:BOOL=%s' % (
'ON' if '+cuda' in spec else 'OFF')])
python_prefix = spec['python'].prefix python_prefix = spec['python'].prefix
python_lib = python_prefix.lib python_lib = python_prefix.lib
if spec.satisfies('^python@3:'): if spec.satisfies('^python@3:'):
python = join_path(python_prefix.bin, 'python3') python = join_path(python_prefix.bin, 'python3')
cmake_options.extend(['-DBUILD_opencv_python3=ON', cmake_options.extend(['-DBUILD_opencv_python3=ON',
'-DPYTHON_EXECUTABLE={0}'.format(python), '-DPYTHON_EXECUTABLE=%s' % (python),
'-DPYTHON_LIBRARIES={0}'.format(python_lib)]) '-DPYTHON_LIBRARIES=%s' % (python_lib)])
elif spec.satisfies('^python@2:3'): elif spec.satisfies('^python@2:3'):
python = join_path(python_prefix.bin, 'python2') python = join_path(python_prefix.bin, 'python2')
cmake_options.extend(['-DBUILD_opencv_python2=ON', cmake_options.extend(['-DBUILD_opencv_python2=ON',
'-DPYTHON_EXECUTABLE={0}'.format(python), '-DPYTHON_EXECUTABLE=%s' % (python),
'-DPYTHON_LIBRARIES={0}'.format(python_lib)]) '-DPYTHON_LIBRARIES=%s' % (python_lib)])
with working_dir('spack_build', create=True): with working_dir('spack_build', create=True):
cmake('..', *cmake_options) cmake('..', *cmake_options)