{% set version = "1.18" %}

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

build:
  number: 0
  run_exports:
    - {{ pin_subpackage('samtools', max_pin="x.x") }}

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

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
