-
Notifications
You must be signed in to change notification settings - Fork 20
/
flake.nix
70 lines (59 loc) · 1.95 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
description = "A flake for building wfmash and a Docker image for it";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
packages.${system}.wfmash = pkgs.stdenv.mkDerivation rec {
pname = "wfmash";
version = "0.14.0";
src = pkgs.fetchFromGitHub {
owner = "waveygang";
repo = "wfmash";
rev = "7376468d0d1f67ad58ca3fc5d07e888745b22c06";
sha256 = "sha256-0vThKJflmasPoVhGdFwm1l9VUoxZkEwZruYhlzF1Ehw=";
};
nativeBuildInputs = [ pkgs.cmake pkgs.makeWrapper ];
buildInputs = [
pkgs.gsl
pkgs.gmp
pkgs.jemalloc
pkgs.htslib
pkgs.git
pkgs.zlib
pkgs.pkg-config
];
# Define custom attributes
enableOptimizations = true;
reproducibleBuild = false;
# Use custom attributes to set compiler flags
CFLAGS = if enableOptimizations then "-Ofast -march=x86-64-v3" else "";
CXXFLAGS = if enableOptimizations then "-Ofast -march=x86-64-v3" else "";
postPatch = ''
mkdir -p include
echo "#define WFMASH_GIT_VERSION \"${version}\"" > include/wfmash_git_version.hpp
'';
postInstall = ''
wrapProgram $out/bin/wfmash --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.gsl pkgs.gmp ]}
'';
meta = with pkgs.lib; {
description = "Base-accurate DNA sequence alignments using WFA and mashmap2";
homepage = "https://github.com/ekg/wfmash";
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ maintainers.bzizou ];
};
};
dockerImage = pkgs.dockerTools.buildImage {
name = "wfmash-docker";
tag = "latest";
copyToRoot = [ self.packages.${system}.wfmash ];
config = {
Entrypoint = [ "${self.packages.${system}.wfmash}/bin/wfmash" ];
};
};
};
}