{% set name = "blast" %}
{% set version = "2.17.0" %}
{% set sha256 = "502057a88e9990e34e62758be21ea474cc0ad68d6a63a2e37b2372af1e5ea147" %}

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

source:
  url: https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/{{ version }}/ncbi-blast-{{ version }}+-src.tar.gz
  sha256: {{ sha256 }}
  patches:
    - configurellvm.patch
    - get_species_taxids.patch
    - phonehome.patch
    - update_configsub.patch
    - project_tree_builder.patch
    - vdb.patch

build:
  number: 1
  run_exports:
    # Now, the point releases seem to be only bugfixes at least (but this definitely was not the
    # case up to v2.2.31)
    - {{ pin_subpackage(name, max_pin="x.x") }}

requirements:
  build:
    - make
    - {{ stdlib('c') }}
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
  host:
    - llvm-openmp  # [osx]
    - libgomp  # [linux]
    - zlib
    - bzip2
    - entrez-direct
    - ncbi-vdb
    - curl
    - sqlite =3
  run:
    - perl
    - perl-list-moreutils
    - perl-archive-tar
    - perl-json
    - entrez-direct
    - ncbi-vdb
    - curl
    - llvm-openmp  # [osx]
    - libgomp  # [linux]

test:
  files:
    - test.fa
    - testdatabase.fa
  commands:
    # (see run_test.sh for remainder of tests)
    - blastdb_aliastool -version > /dev/null
    - blastdbcheck -version > /dev/null
    - blastdbcmd -version > /dev/null
    - blastn -version > /dev/null
    - blastn_vdb -version > /dev/null
    - blastp -version > /dev/null
    - blastx -version > /dev/null
    - convert2blastmask -version > /dev/null
    - dustmasker -version > /dev/null
    - makeblastdb -version > /dev/null
    - makembindex -version > /dev/null
    - psiblast -version > /dev/null
    - rpsblast -version > /dev/null
    - rpstblastn -version > /dev/null
    - segmasker -version > /dev/null
    - tblastn -version > /dev/null
    - tblastn_vdb -version > /dev/null
    - tblastx -version > /dev/null
    - windowmasker -version > /dev/null
    - update_blastdb.pl --version > /dev/null
    - get_species_taxids.sh -h > /dev/null

about:
  home: "https://blast.ncbi.nlm.nih.gov/doc/blast-help"
  # SPDX license ID for NCBI Public Domain
  license: "NCBI-PD"
  license_file: "c++/scripts/projects/blast/LICENSE"
  summary: "BLAST+ is a new suite of BLAST tools that utilizes the NCBI C++ Toolkit."
  description: |
    BLAST Command Line Applications.

    The NCBI Basic Local Alignment Search Tool (BLAST) finds regions of
    local similarity between sequences. The program compares nucleotide or
    protein sequences to sequence databases and calculates the statistical
    significance of matches. BLAST can be used to infer functional and
    evolutionary relationships between sequences as well as help identify
    members of gene families.

    For more information, visit https://blast.ncbi.nlm.nih.gov
  doc_url: "https://blast.ncbi.nlm.nih.gov/doc/blast-help"


extra:
  additional-platforms:
    - osx-arm64
    # CircleCI arm.large runner times out as the build takes too long
    #- linux-aarch64
  identifiers:
    - biotools:blast
    - doi:10.1016/S0022-2836(05)80360-2
    - usegalaxy-eu:ncbi_blastx_wrapper
  recipe-maintainers:
    - christiam
    - ebete
