{% set version = "0.1.95" %}

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

source:
  url: https://github.com/google/sentencepiece/archive/v{{ version }}.tar.gz
  sha256: 1c0bd83e03f71a10fc934b7ce996e327488b838587f03159fd392c77c7701389

build:
  number: 0
  skip: true                          # [py<36]
  missing_dso_whitelist:              # [linux]
    - "*/libpthread.so.*"             # [linux]
    - "*/libm.so.*"                   # [linux]
    - "*/libc.so.*"                   # [linux]
    - "/lib64/ld-linux-x86-64.so.*"   # [linux and x86_64]
    - "/lib64/ld-linux-aarch64.so.*"  # [linux and aarch64]
    - "/lib64/ld64.so.*"              # [linux and (ppc64le or s390x)]

requirements:
  host:
    - pip
    - setuptools
    - wheel
    - python
    - cmake
    - {{ compiler('cxx') }}
#    - gperftools  # [unix]
    - make        # [not win]
    - pkg-config  # [not win]
  run:
    - python

test:
  imports:
    - sentencepiece
  requires:
    - pip
    - pytest
  source_files:
    - python/test
    - data
  commands:
    - pip check
    - spm_export_vocab --help  # [linux]
    - spm_normalize --help     # [linux]
    # upstream test suite expects to be run from PKG_ROOT/python
    - cd python && pytest test

about:
  home: "https://github.com/google/sentencepiece/"
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  summary: "SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is predetermined prior to the neural model training."
  description: "SentencePiece implements subword units (e.g., byte-pair-encoding (BPE) [Sennrich et al.]) and unigram language model [Kudo.]) with the extension of direct training from raw sentences. SentencePiece allows us to make a purely end-to-end system that does not depend on language-specific pre/postprocessing."
  doc_url: https://github.com/google/sentencepiece/blob/master/doc/api.md
  dev_url: https://github.com/google/sentencepiece/

extra:
  recipe-maintainers:
    - setu4993
    - rluria14
    - ndmaxar
    - oblute
