{% set version = "3.0.0" %}
{% set filename = "apache-arrow-" + version + ".tar.gz" %}
{% set checksum = "73c2cc3be537aa1f3fd9490cfec185714168c9bfd599d23e287ab0cc0558e27a" %}

package:
  name: arrow-cpp
  version: {{ version }}

source:
  fn: {{ filename }}
  url: https://dist.apache.org/repos/dist/release/arrow/arrow-{{ version }}/{{ filename }}
  sha256: {{ checksum }}

build:
  number: 4
  skip: true  # [(win and vc<14) or win32]
  run_exports:
    - {{ pin_subpackage("arrow-cpp", max_pin="x.x.x") }}
  ignore_run_exports:
    - grpc-cpp
    - libevent
    - re2
    - glog
    - gflags  # [win]
    - zstd    # [win]
    - snappy  # [win]
    - brotli  # [win]
    - lz4-c   # [win]
requirements:
  build:
    - abseil-cpp  # [win]
    - grpc-cpp
    - cmake
    - autoconf  # [unix]
    - ninja
    - make      # [unix]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - utf8proc
    - numpy-devel >=1.14
    - libboost
    # hard pinning for one build..
    # - thrift-cpp >=0.13
    - thrift-cpp 0.14
  host:
    - abseil-cpp    # [not win]
    - aws-sdk-cpp
    - boost-cpp
    - brotli
    - bzip2
    - c-ares
    - double-conversion
    - flatbuffers
    - gflags
    - glog
    - grpc-cpp
    - libprotobuf
    - lz4-c
    - numpy
    - orc  # [unix]
    - rapidjson
    - re2
    - snappy
    # hard pinning for one build..
    # - thrift-cpp >=0.13
    - thrift-cpp 0.14
    - uriparser
    - zlib
    - zstd
    - utf8proc
    - openssl
    - libevent  # [unix]
    - python
  run:
    - {{ pin_compatible('numpy', lower_bound='1.11') }}
    - boost-cpp
    - brotli
    - c-ares
    - double-conversion
    - gflags
    - glog
    - grpc-cpp
    - lz4-c
    - libboost
    - openssl
    - re2
    - snappy
    - uriparser
    - zlib
    - zstd
    - utf8proc
    - python

test:
  commands:
    # headers
    - test -f $PREFIX/include/arrow/api.h              # [unix]
    - test -f $PREFIX/include/arrow/flight/types.h     # [unix]
    - test -f $PREFIX/include/plasma/client.h          # [unix]
    # - test -f $PREFIX/include/gandiva/engine.h         # [unix]
    - test -f $PREFIX/include/parquet/api/reader.h     # [unix]
    - if not exist %LIBRARY_INC%\\arrow\\api.h exit 1            # [win]
    # - if not exist %LIBRARY_INC%\\gandiva\\engine.h exit 1       # [win]
    - if not exist %LIBRARY_INC%\\parquet\\api\\reader.h exit 1  # [win]

    # shared
    - test -f $PREFIX/lib/libarrow${SHLIB_EXT}          # [unix]
    - test -f $PREFIX/lib/libarrow_dataset${SHLIB_EXT}  # [unix]
    - test -f $PREFIX/lib/libarrow_flight${SHLIB_EXT}   # [unix]
    - test -f $PREFIX/lib/libarrow_python${SHLIB_EXT}   # [unux]
    - test -f $PREFIX/lib/libparquet${SHLIB_EXT}        # [unix]
    # - test -f $PREFIX/lib/libgandiva${SHLIB_EXT}        # [unix]
    - test -f $PREFIX/lib/libplasma${SHLIB_EXT}         # [unix]
    - if not exist %PREFIX%\\Library\\bin\\arrow.dll exit 1          # [win]
    - if not exist %PREFIX%\\Library\\bin\\arrow_dataset.dll exir 1  # [win]
    - if not exist %PREFIX%\\Library\\bin\\arrow_flight.dll exit 1   # [win]
    - if not exist %PREFIX%\\Library\\bin\\arrow_python.dll exit 1   # [win]
    - if not exist %PREFIX%\\Library\\bin\\parquet.dll exit 1        # [win]
    # - if not exist %PREFIX%\\Library\\bin\\gandiva.dll exit 1        # [win]
    # - if not exist %PREFIX%\\Library\\bin\\plasma.dll  exit 1        # [win]
    # absence of static libraries
    - test ! -f $PREFIX/lib/libarrow.a         # [unix]
    - test ! -f $PREFIX/lib/libarrow_flight.a  # [unix]
    - test ! -f $PREFIX/lib/libarrow_python.a  # [unix]
    - test ! -f $PREFIX/lib/libplasma.a        # [unix]
    - test ! -f $PREFIX/lib/libparquet.a       # [unix]
    # - test ! -f $PREFIX/lib/libgandiva.a       # [unix]
    - if exist %PREFIX%\\Library\\lib\\arrow_static.lib exit 1         # [win]
    - if exist %PREFIX%\\Library\\lib\\arrow_flight_static.lib exit 1  # [win]
    - if exist %PREFIX%\\Library\\lib\\arrow_python_static.lib exit 1  # [win]
    - if exist %PREFIX%\\Library\\lib\\parquet_static.lib exit 1       # [win]
    # - if exist %PREFIX%\\Library\\lib\\gandiva_static.lib exit 1       # [win]

    # conda tools
    - conda inspect linkages -p $PREFIX $PKG_NAME  # [not win]
    - conda inspect objects -p $PREFIX $PKG_NAME   # [osx]

about:
  home: http://github.com/apache/arrow
  license: Apache 2.0
  license_file: LICENSE.txt
  summary: 'C++ libraries for Apache Arrow'

extra:
  recipe-maintainers:
    - wesm
    - xhochy
    - leifwalsh
    - jreback
    - cpcloud
    - pcmoritz
    - robertnishihara
    - siddharthteotia
    - kou
    - kszucs
    - pitrou
