diff options
Diffstat (limited to 'tools/compression-gzip.nix')
-rw-r--r-- | tools/compression-gzip.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/compression-gzip.nix b/tools/compression-gzip.nix index 0229b94..80fb9f4 100644 --- a/tools/compression-gzip.nix +++ b/tools/compression-gzip.nix @@ -1,12 +1,17 @@ -{ bionix }: +{ bionix, block ? false, flags ? "" }: with bionix; +with types; input: stage { name = "gzip"; - buildInputs = with pkgs; [ gzip ]; - buildCommand = "gzip < ${input} > $out"; - passthru.filetype = filetype.gzip input.filetype; + buildInputs = with pkgs; [ (if block then htslib else gzip) ]; + buildCommand = + if block then + "bgzip -c ${flags} ${input} > $out" + else + "gzip ${flags} < ${input} > $out"; + passthru.filetype = (if block then filetype.bgz else filetype.gz) input.filetype; } |