{% set version = "2021.3" %}

package:
  name: cctbx-base
  version: {{ version }}

source:
  url: https://github.com/cctbx/cctbx_project/releases/download/v{{ version }}/cctbx-{{ version }}.tar.gz
  sha256: a0fce583497a96b549f1849e772f9aa4422887b83c46e8ebf097445c840ead02
  patches:
    - cbf.patch
    - crys3d.patch
    - dxtbx.patch
    - libtbx_osx-arm64.patch  # [build_platform != target_platform]

build:
  number: 1
  skip: true  # [win and py==39]
  preserve_egg_dir: true

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - numpy                                  # [build_platform != target_platform]
    - gnuconfig  # [unix]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ cdt('mesa-libgl-devel') }}  # [linux]
    - {{ cdt('mesa-dri-drivers') }}  # [linux]
    - {{ cdt('libselinux') }}  # [linux]
    - {{ cdt('libxdamage') }}  # [linux]
    - {{ cdt('libxxf86vm') }}  # [linux]
    - {{ cdt('libxext') }}     # [linux]
  host:
    - boost
    - boost-cpp
    - eigen
    - future
    - libglu  # [linux]
    - numpy
    - python
    - python.app  # [osx]
    - scons
    - setuptools
    - six
    - xorg-libxfixes  # [linux]

outputs:
  - name: cctbx-base
    requirements:
      run:
        - biopython
        - {{ pin_compatible('boost') }}
        - boost-cpp
        - future
        - {{ pin_compatible('libglu') }}  # [linux]
        - libsvm
        - matplotlib-base
        - mrcfile
        - {{ pin_compatible('numpy') }}
        - pillow
        - psutil
        - python
        - python.app  # [osx]
        - reportlab
        - requests
        - six
    test:
      imports:
        - scitbx.array_family.flex
        - gltbx.gl
        - gltbx.glu
      commands:
        - libtbx.show_commands
        - pip check
      requires:
        - pip

  - name: cctbx
    build:
    requirements:
      run:
        - {{ pin_subpackage('cctbx-base', max_pin="x.x.x") }}
        - ipython
        - pyside2  # [not aarch64 and not ppc64le and python_impl == "cpython"]
        - pyzmq
        - websockets
        - wxpython  # [not aarch64 and not ppc64le and python_impl == "cpython"]
    test:
      imports:
        - scitbx.array_family.flex
        - gltbx.gl
        - gltbx.glu
      commands:
        - libtbx.show_commands
        - pip check
      requires:
        - pip

about:
  home: https://github.com/cctbx/cctbx_project
  license: BSD-3-Clause-LBNL AND BSD-3-Clause AND BSL-1.0 AND LGPL-2.0-only AND LGPL-2.1-only AND LGPL-3.0-only AND MIT AND LGPL-2.0-or-later WITH WxWindows-exception-3.1
  license_family: Other
  license_file:
    - ./licenses/LICENSE.txt
    - ./licenses/Boost_LICENSE_1_0.txt
    - ./licenses/bsd_3_clause.txt
    - ./licenses/gpl-3.0.txt
    - ./licenses/lgpl-2.0.txt
    - ./licenses/lgpl-2.1.txt
    - ./licenses/lgpl-3.0.txt
    - ./licenses/mit.txt
    - ./licenses/wxWindows_3.1.txt

  summary: The Computational Crystallography Toolbox
  description: |
    The Computational Crystallography Toolbox (cctbx) is being developed
    as the open source component of the Phenix system. The goal of the
    Phenix project is to advance automation of macromolecular structure
    determination. Phenix depends on the cctbx, but not vice versa. This
    hierarchical approach enforces a clean design as a reusable library.
    The cctbx is therefore also useful for small-molecule crystallography
    and even general scientific applications.
  doc_url: https://cctbx.github.io/
  dev_url: https://github.com/cctbx/cctbx_project

extra:
  recipe-maintainers:
    - bkpoon
    - phyy-nx
