{% set version = "1.16.1" %}

package:
  name: samtools
  version: {{ version }}

build:
  number: 1

source:
  url: https://github.com/samtools/samtools/releases/download/{{ version }}/samtools-{{ version }}.tar.bz2
  sha256: 2fa0a25f78594cf23d07c9d32d5060a14f1c5ee14d7b0af7a8a71abc9fdf1d07

requirements:
  build:
    - make
    - {{ compiler('c') }} 
  host:
    - htslib
    - ncurses
    - zlib
  run:
    - htslib
    - ncurses
    - zlib

about:
  home: https://github.com/samtools/samtools
  license: MIT
  license_file: LICENSE
  summary: Tools for dealing with SAM, BAM and CRAM files

test:
  commands:
    - samtools --help
    # test if https protocol works, if it doesnt samtools will fail with "Protocol not supported"
    - samtools view 'https://example.com' 2>&1 | grep 'fail to read the header' -q

extra:
  identifiers:
    - biotools:samtools
    - usegalaxy-eu:samtools_flagstat
