# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
# Author: Pablo Escobar Lopez
# sciCORE - University of Basel
# SIB Swiss Institute of Bioinformatics

easyblock = 'MakeCp'

name = 'BayeScan'
version = '2.1'

homepage = 'http://cmpg.unibe.ch/software/BayeScan/'
description = """BayeScan aims at identifying candidate loci under natural selection from genetic data,
 using differences in allele frequencies between populations."""

# BayeScan makefile is hardcoded to use g++. In case you want to use a
# non-gcc toolchain you will need to patch the makefile
toolchain = {'name': 'goolf', 'version': '1.4.10'}
toolchainopts = {'openmp': True}

source_urls = ['http://cmpg.unibe.ch/software/BayeScan/files/']
sources = ['%(name)s%(version)s.zip']

start_dir = 'source'

# fix the makefile which hardcodes g++ local_compiler
prebuildopts = "sed -i -e 's/g++/${CXX} ${CFLAGS}/g' Makefile && "

files_to_copy = [
    (['source/bayescan_%(version)s'], 'bin'),
    'BayeScan%(version)s_manual.pdf',
    'input_examples',
    'R functions']

parallel = 1

sanity_check_paths = {
    'files': ['bin/bayescan_%(version)s'],
    'dirs': [],
}

moduleclass = 'bio'
