{% set version = "1.22.1" %}

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

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

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

requirements:
  build:
    - make
    - {{ compiler('c') }} 
  host:
    - 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:
  additional-platforms:
    - linux-aarch64
    - osx-arm64
  identifiers:
    - biotools:samtools
    - usegalaxy-eu:samtools_flagstat
