2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, llvmPackages }:
|
2020-01-09 17:38:54 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bayescan";
|
|
|
|
version = "2.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://cmpg.unibe.ch/software/BayeScan/files/BayeScan${version}.zip";
|
|
|
|
sha256 = "0ismima8j8z0zj9yc267rpf7z90w57b2pbqzjnayhc3ab8mcbfy6";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ unzip ];
|
2021-01-15 13:21:58 +00:00
|
|
|
buildInputs = lib.optional stdenv.cc.isClang llvmPackages.openmp;
|
2020-01-09 17:38:54 +00:00
|
|
|
|
|
|
|
# Disable FORTIFY_SOURCE or the binary fails with "buffer overflow"
|
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
|
|
|
sourceRoot = "BayeScan${version}/source";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace "-static" "" \
|
|
|
|
--replace "g++" "c++"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/doc/bayescan
|
|
|
|
cp bayescan_${version} $out/bin
|
|
|
|
cp -r ../*pdf ../input_examples ../"R functions" $out/share/doc/bayescan
|
|
|
|
'';
|
|
|
|
|
2022-05-13 11:00:08 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-std=c++14" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-01-09 17:38:54 +00:00
|
|
|
description = "Detecting natural selection from population-based genetic data";
|
|
|
|
homepage = "http://cmpg.unibe.ch/software/BayeScan";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.bzizou ];
|
2022-04-01 20:34:55 +01:00
|
|
|
mainProgram = "bayescan_${version}";
|
2021-01-15 13:21:58 +00:00
|
|
|
platforms = lib.platforms.all;
|
2020-01-09 17:38:54 +00:00
|
|
|
};
|
|
|
|
}
|