From f7a4e4a93a2a317fb76b9e09a97ea6246e477da2 Mon Sep 17 00:00:00 2001 From: Bruno Bzeznik Date: Thu, 9 Jan 2020 18:38:54 +0100 Subject: [PATCH] bayescan: init at 2.1 (#68191) Co-authored-by: Dmitry Kalinkin --- .../science/biology/bayescan/default.nix | 39 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/applications/science/biology/bayescan/default.nix diff --git a/pkgs/applications/science/biology/bayescan/default.nix b/pkgs/applications/science/biology/bayescan/default.nix new file mode 100644 index 000000000000..4e216fbdbe63 --- /dev/null +++ b/pkgs/applications/science/biology/bayescan/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchurl, unzip, llvmPackages }: + +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 ]; + buildInputs = stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp; + + # 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 + ''; + + meta = with stdenv.lib; { + description = "Detecting natural selection from population-based genetic data"; + homepage = "http://cmpg.unibe.ch/software/BayeScan"; + license = licenses.gpl3; + maintainers = [ maintainers.bzizou ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6f7011fc8741..5042a17c8463 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23701,6 +23701,8 @@ in stdenv = gcc49Stdenv; }; + bayescan = callPackage ../applications/science/biology/bayescan { }; + bedtools = callPackage ../applications/science/biology/bedtools { }; bcftools = callPackage ../applications/science/biology/bcftools { };