easyblock = 'CMakeMake'

name = 'arrow'
version = '0.7.1'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://arrow.apache.org'
description = """Apache Arrow is a cross-language development platform for in-memory data."""

toolchain = {'name': 'intel', 'version': '2017b'}

sources = ['apache-arrow-%(version)s.tar.gz']
source_urls = ['https://github.com/apache/arrow/archive/']

preconfigopts = "ZLIB_HOME=$EBROOTZLIB"
configopts = "-DARROW_PYTHON=ON -DARROW_PLASMA=ON -DARROW_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release"

start_dir = 'cpp'
separate_build_dir = True

builddependencies = [('CMake', '3.9.5')]

exts_defaultclass = 'PythonPackage'

exts_list = [
    ('pyarrow', version, {  # The python bindings of Arrow
        'start_dir': 'python',
        'source_tmpl': sources[0],
        'buildcmd': 'build_ext',
        'buildopts': '--with-plasma --inplace --build-type=release',
    }),
]

modextrapaths = {'PYTHONPATH': ['lib/python%(pyshortver)s/site-packages']}

dependencies = [
    ('Python', '3.6.3'),
    ('Boost', '1.65.1'),
    ('jemalloc', '4.5.0'),
    ('zlib', '1.2.11'),
]

sanity_check_paths = {
    'files': ['lib64/libarrow_python.so', 'lib64/libarrow.so', 'lib64/libplasma.so'],
    'dirs': ['include/arrow', 'include/plasma']
}

moduleclass = 'data'
