{% set version = "1.9.3" %}
{% set sha256 = "4bbd77b148c7a0954e1103d0b6e834e3a507c3ada9ba556e2731109beb3d92fe" %}

package:
  name: pasta
  version: {{ version }}

source:
  url: https://github.com/smirarab/pasta/archive/v{{version}}.tar.gz
  sha256: {{ sha256 }}
  patches:
    - fix_tooldir.patch  # ensure PASTA "knows" where to find third party tools
    - mpstart.patch  # issue in OSX py38 (not in Linux nor OSX py37): RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

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

requirements:
  build:
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - dendropy
    - wget
    - openjdk
    - pcre
    - pymongo
    - clustalw
    - fasttree
    - raxml
    - muscle <4  # later versions expects other cmd argument names
    - mafft
    - hmmer
    - prank
    - libgomp  # [linux]
    - llvm-openmp  # [osx]
    - openmpi
  run:
    - python
    - dendropy
    - openjdk
    - pcre
    - pymongo
    - clustalw
    - fasttree
    - raxml
    - muscle <4  # later versions expects other cmd argument names
    - mafft
    - hmmer
    - prank
    - libgomp  # [linux]
    - llvm-openmp  # [osx]
    - openmpi

test:
  imports:
    - pasta

  commands:
    - clustalw2 -help | grep OPTIONS
    - hmmalign -h | grep HMMER
    - hmmbuild -h | grep HMMER
    - muscle -version | grep -i MUSCLE
    - prank -help | grep prank
    - raxml -h | grep -i raxml
    - export PASTA_LOGGING_LEVEL=DEBUG; export PASTA_LOGGING_FORMAT=RICH; run_pasta.py -i $PREFIX/share/pasta/data/small.fasta
    # we need support from upstream to fix this special execution for OSX specific - export PASTA_LOGGING_LEVEL=DEBUG; export PASTA_LOGGING_FORMAT=RICH; run_pasta.py -i $PREFIX/share/pasta/data/small.fasta --tree-estimator raxml

about:
  home: "https://github.com/smirarab/pasta"
  license: "GPL-3.0-or-later"
  license_family: GPL3
  license_file: LICENSE
  summary: 'An implementation of the PASTA (Practical Alignment using Sate and TrAnsitivity) algorithm.'
  dev_url: "https://github.com/smirarab/pasta"
  doc_url: "https://github.com/smirarab/pasta/blob/v{{ version }}/README.md"

extra:
  additional-platforms:
    - linux-aarch64
    - osx-arm64
  identifiers:
    - doi:10.1007/978-3-319-05269-4_15
    - doi:10.1089/cmb.2014.0156
