{% set name = "IQTREE" %}
{% set version = "2.4.0" %}

package:
  name: {{ name|lower }}
  version: {{ version | replace("-", "_") }}

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

source:
  # using git_url rather than tarball due to use of 2 submodules by iqtree (lsd2, cmaple)
  # Previously, the submodules were specified as source tarballs themselves
  # But the submodules weren't updated when iqtree was, hence switch to git_url
  # see discussion https://github.com/bioconda/bioconda-recipes/pull/49360/files#r1686415630
  git_url: https://github.com/iqtree/iqtree2.git
  git_rev: v{{ version }}
  sha256: unused
  patches:
    - patch

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - cmake
    - ninja
  host:
    - libgomp  # [linux]
    - llvm-openmp  # [osx]
    - boost-cpp
    - eigen
  run:
    - libgomp  # [linux]
    - llvm-openmp  # [osx]

test:
  source_files:
    - cmaple/example/input.fa
  commands:
    - iqtree
    - iqtree2
    # Mulled builds don't work with source_files
    - iqtree --pathogen-force -s cmaple/example/input.fa  # [osx]
    # Test that the CMAPLE submodule is working
    - grep -v "not compiled with CMAPLE integrated" cmaple/example/input.fa.log  # [osx]

about:
  home: "http://www.iqtree.org"
  dev_url: "https://github.com/iqtree/iqtree2"
  license: "GPL-2.0-or-later"
  license_family: GPL2
  license_file: LICENSE
  summary: "Efficient phylogenomic software by maximum likelihood."
  doc_url: "http://www.iqtree.org/doc"

extra:
  skip-lints:
    # uses submodules
    - uses_vcs_url
  additional-platforms:
    - linux-aarch64
    - osx-arm64
  identifiers:
    - biotools:iqtree
    - doi:10.1093/molbev/msu300
    - doi:10.1038/nmeth.4285
    - doi:10.1093/molbev/msx281
    - doi:10.1093/sysbio/syae008
    # cmaple
    - doi:10.1093/molbev/msae134
    - usegalaxy-eu:{{ name|lower }}
  recipe-maintainers:
    - corneliusroemer
