# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild

easyblock = 'ConfigureMake'

name = 'bcl2fastq2'
version = '2.20.0'
versionsuffix = '-Python-%(pyver)s'

homepage = 'https://support.illumina.com/sequencing/sequencing_software/bcl2fastq-conversion-software.html'
description = """bcl2fastq Conversion Software both demultiplexes data and converts BCL files generated by
 Illumina sequencing systems to standard FASTQ file formats for downstream analysis."""

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

source_urls = ['ftp://webdata2:webdata2@ussd-ftp.illumina.com/downloads/software/bcl2fastq/']
sources = [{
    'filename': '%%(name)s-v%s-tar.zip' % '-'.join(version.split('.')),
    'extract_cmd': 'unzip -p %s | tar -xzvf -',  # source file is a .zip that contains a .tar.gz
}]
patches = [
    'bcl2fastq2-%(version)s_add-iostream-include.patch',
    'bcl2fastq2-%(version)s_fix-intel-problem.patch',
]
checksums = [
    '8dd3044767d044aa4ce46de0de562b111c44e5b8b7348e04e665eb1b4f101fe3',  # bcl2fastq2-v2-20-0-tar.zip
    '2ab5b95ccb556835e039ac81aa86f3c1974bcc1aed00b22764ae429af409da6c',  # bcl2fastq2-2.20.0_add-iostream-include.patch
    'cce7cf2f2cbdd93a41904cb4b6b43da531bbbc38b9adbfc6dacf5e644dcce1f9',  # bcl2fastq2-2.20.0_fix-intel-problem.patch
]

start_dir = 'src'
configopts = '--force-builddir'

dependencies = [
    ('Boost', '1.65.1'),
    ('Python', '2.7.14'),
]

sanity_check_paths = {
    'files': ['bin/bcl2fastq'],
    'dirs': ['lib']
}

moduleclass = 'bio'
