{% set version = "2.7.14" %}
{% set sha256 = "304c9b202ea6fbd0a4a8e0ad3733715fbd4749f2204a9173a58ec53c32ea73e8" %}

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

source:
  fn: Python-{{ version }}.tgz
  url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}.tgz
  sha256: {{ sha256 }}
  patches:
    - 0001-backport-Python-3.6-_PYTHON_SYSCONFIGDATA_NAME.patch
    - 0002-Add-Anaconda-Distribution-version-logic.patch
    - 0003-Darwin-Hack-sys.-exec_-prefix-if-run-from-python.app.patch
    - 0004-Darwin-Add-arch-x86_64-to-UnicCCompiler-ld_args.patch
    - 0005-Win32-distutils-Also-look-for-executable.bat.patch
    # TODO :: This breaks conda activate and deactivate.
    - 0006-Win32-Ensure-Library-bin-is-in-os.environ-PATH.patch
    - 0007-Win32-Change-FD_SETSIZE-from-512-to-2048.patch
    - 0008-Win32-Fixes-for-Windows-GCC-interop-needed-by-RPy2-a.patch
    - 0009-Do-not-pass-g-to-GCC-when-not-Py_DEBUG.patch
    - 0010-Darwin-Look-in-sysroot-usr-lib-include-if-sysroot-is.patch
    - 0011-runtime_library_dir_option-Use-1st-word-of-CC-as-com.patch

build:
  number: 23
  no_link:
    - bin/python2.7     # [unix]
    - DLLs/_ctypes.pyd  # [win]
  # script_env:
  #   - python_branding
  # We delete the shared libraries.
  ignore_run_exports:   # [unix]
    - bzip2             # [unix]
  skip: True            # [win and vc != 9]

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ cdt('xorg-x11-proto-devel') }}  # [linux]
    - {{ cdt('libx11-devel') }}          # [linux]
    - pkg-config                         # [unix]
  host:
    - bzip2                              # [unix]
    - sqlite                             # [unix]
    - zlib                               # [unix]
    - openssl                            # [unix]
    - readline                           # [unix]
    - tk                                 # [unix]
    - ncurses                            # [linux]
    - libffi                             # [unix]

test:
  commands:
    - python -V
    - pydoc -h
    - python-config --help  # [unix]
    - idle -h
    - python -c "import sysconfig; print sysconfig.get_config_var('CC')"
    -  _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_cos6_linux_gnu python -c "import sysconfig; print sysconfig.get_config_var('CC')"  # [linux64]

about:
  home: http://www.python.org/
  license: PSF
  license_file: LICENSE
  summary: General purpose programming language
  description: |
    Python is a widely used high-level, general-purpose, interpreted, dynamic
    programming language. Its design philosophy emphasizes code
    readability, and its syntax allows programmers to express concepts in
    fewer lines of code than would be possible in languages such as C++ or
    Java. The language provides constructs intended to enable clear programs
    on both a small and large scale.
  doc_url: https://www.python.org/doc/versions/
  doc_source_url: https://github.com/python/pythondotorg/blob/master/docs/source/index.rst
  dev_url: https://docs.python.org/devguide/

extra:
  recipe-maintainers:
    - jakirkham
    - jjhelmus
    - mingwandroid
    - msarahan
    - pelson
