{% set version = "2.14.1" %}

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

source:
  fn: git-{{ version }}.tar.gz                                                                                                    # [unix]
  url: https://github.com/git/git/archive/v{{ version }}.tar.gz                                                                   # [unix]
  sha256: ccc366d5d674fb755fd98d219c23f2b4e5da8a49d8582a6314813b280d75536b                                                        # [unix]
  fn: PortableGit-{{ version }}-32-bit.7z.exe                                                                                     # [win32]
  url: https://github.com/git-for-windows/git/releases/download/v{{ version }}.windows.1/PortableGit-{{ version }}-32-bit.7z.exe  # [win32]
  sha256: df3f9b6c2dd2b12e5cb7035b9ca48d13b973d054a35b0939953aa6e7a00a0659                                                        # [win32]
  fn: PortableGit-{{ version }}-64-bit.7z.exe                                                                                     # [win64]
  url: https://github.com/git-for-windows/git/releases/download/v{{ version }}.windows.1/PortableGit-{{ version }}-64-bit.7z.exe  # [win64]
  sha256: 3c3270a9df5f3db1f7637d86b94fb54a96e9145ba43c98a3e993cdffb1a1842e                                                        # [win64]

build:
  number: 2
  skip: true  # [win and not py27]
  # git hardcodes paths to external utilities (e.g. curl)
  detect_binary_files_with_prefix: True

requirements:
  build:
    - {{ compiler('c') }}
    - autoconf        # [unix]
  host:
    - curl            # [unix]
    - expat           # [unix]
    - libiconv        # [not linux and not win]
    - openssl 1.0.*   # [unix]
    - zlib            # [unix]
    - 7za             # [win]
    - perl 5.*        # [unix]
    - tk 8.*          # [unix]

    # Workaround for conda-build issue.
    - python          # [win]
  run:
    - curl            # [unix]
    - expat           # [unix]
    - libiconv        # [not linux and not win]
    - openssl 1.0.*   # [unix]
    - perl 5.*        # [unix]
    - tk 8.*          # [unix]

test:
  commands:
    # Verify git location.
    - test -f $PREFIX/bin/git                               # [unix]
    - if not exist %LIBRARY_PREFIX%\\bin\\git.exe exit 1    # [win]

    # Run git commands.
    - git --version
    - git clone https://github.com/conda-forge/git-feedstock

    # test completions
    - bash $PREFIX/share/bash-completion/completions/git  # [unix]

about:
  home: https://git-scm.com/
  license: GPL v2 and LGPL 2.1
  summary: distributed version control system
  
  description: |
    Git is a free and open source distributed version control system designed
    to handle everything from small to very large projects with speed and
    efficiency.
  doc_url: https://git-scm.com/doc
  dev_url: https://github.com/git/git

extra:
  recipe-maintainers:
    - jakirkham
    - msarahan
    - pelson
    - scopatz
