{% set name = "pyinstaller" %}
{% set version = "5.13.2" %}
{% set sha256 = "c8e5d3489c3a7cc5f8401c2d1f48a70e588f9967e391c3b06ddac1f685f8d5d2" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: {{ sha256 }}

build:
  number: 0
  skip: True  # [py<37]
  entry_points:
    - pyinstaller = PyInstaller.__main__:run
    - pyi-archive_viewer = PyInstaller.utils.cliutils.archive_viewer:run
    - pyi-bindepend = PyInstaller.utils.cliutils.bindepend:run
    - pyi-grab_version = PyInstaller.utils.cliutils.grab_version:run
    - pyi-makespec = PyInstaller.utils.cliutils.makespec:run
    - pyi-set_version = PyInstaller.utils.cliutils.set_version:run
  script:
    - export PYI_STATIC_ZLIB=1  # [unix]
    - export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"               # [unix]
    # Remove the pre-compiled bootloaders (available in sdist)
    - rm -fr ${SRC_DIR}/PyInstaller/bootloader/{Darwin,Linux,Windows}-{64,32}bit  # [unix]
    # Remove vendored waflib dir
    - rm -fr ${SRC_DIR}/bootloader/waflib   # [unix]
    - rd /s /q %SRC_DIR%\bootloader\waflib  # [win]
    # Build the bootloader
    - pushd bootloader
    - waf --prefix="${PREFIX}" --target-arch=64bit --clang distclean all  # [osx]
    - waf --prefix="${PREFIX}" --gcc --no-lsb distclean all     # [linux]
    - waf --prefix="%LIBRARY_PREFIX%" distclean all             # [win]
    - popd
    - "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv"
  preserve_egg_dir: True
  overlinking_ignore_patterns:   # [s390x]
    - '*'                        # [s390x]

requirements:
  build:
    - {{ compiler("c") }}

  host:
    - pip
    - python
    - setuptools
    - wheel
    - waf

  run:
    - altgraph
    - binutils  # [aarch64]
    - python
    - pefile >=2022.5.30  # [win]
    - pyinstaller-hooks-contrib >=2021.4
    - pywin32  # [win]
    - pywin32-ctypes  # [win]
    - macholib >=1.8  # [osx]
    - setuptools >=42.0.0  # due to pkg_resources import
    - importlib-metadata >=1.4  # [py<38]

test:
  imports:
    - PyInstaller
  requires:
    - pip
  files:
    - hello.py
    - multiprocessing_test.py

about:
  home: https://pyinstaller.org
  license: GPL-2.0-or-later
  license_family: GPL
  license_file: COPYING.txt
  summary: PyInstaller bundles a Python application and all its dependencies into a single package.
  description: |
      PyInstaller bundles a Python application and all its dependencies into a single package.
      The user can run the packaged app without installing a Python interpreter or any modules.
      PyInstaller reads a Python script written by you. It analyzes your code to discover every
      other module and library your script needs in order to execute. Then it collects copies of
      all those files -- including the active Python interpreter! -- and puts them with your script
      in a single folder, or optionally in a single executable file.
  dev_url: https://github.com/pyinstaller/pyinstaller
  doc_url: https://pyinstaller.org

extra:
  recipe-maintainers:
    - jakirkham
    - nicoddemus
    - hadim
    - nehaljwani
    - mingwandroid
