{% set build_num = 3 %}

package:
  name: compilers_{{ ctng_target_platform }}
  version: {{ ctng_gcc }}

source:
  path: .

build:
  detect_binary_files_with_prefix: False
  binary_relocation: False
  number: {{ build_num }}
  # The CentOS6 system libraries should be used for everything here.
  # We do not have CDT packages yet, nor compilers that would use them!
  missing_dso_whitelist:
    - '*'

requirements:
  build:
    - crosstool-ng
  # run:
  #   - {{ pin_subpackage('gcc_' ~ ctng_target_platform, min_pin='x.x.x.x.x.x.x.x.x', max_pin='x.x.x.x.x.x.x.x.x') }}
  #   - {{ pin_subpackage('gxx_' ~ ctng_target_platform, min_pin='x.x.x.x.x.x.x.x.x', max_pin='x.x.x.x.x.x.x.x.x') }}
  #   - {{ pin_subpackage('gfortran_' ~ ctng_target_platform, min_pin='x.x.x.x.x.x.x.x.x', max_pin='x.x.x.x.x.x.x.x.x') }}

outputs:
  - name: gcc_impl_{{ ctng_target_platform }}
    script: install-gcc.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    requirements:
      run:
        - {{ pin_subpackage('binutils_impl_' ~ ctng_target_platform, exact=True) }}
        # libstdcxx-ng is a runtime dep of gcc because LTO requires it.
        - {{ pin_subpackage('libstdcxx-ng', max_pin=None) }}
    run_exports:
      # impose this requirement across the build/host boundary
      strong:
        - {{ pin_subpackage('libgcc-ng', max_pin=None) }}
    about:
      summary: GNU C Compiler
      home: https://gcc.gnu.org/
      license: GPL

  - name: gxx_impl_{{ ctng_target_platform }}
    script: install-g++.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    requirements:
      build:
        # For cpp and crt{i,n}.o
        - {{ pin_subpackage('gcc_impl_' ~ ctng_target_platform, exact=True) }}
      run:
        # For cpp and crt{i,n}.o
        - {{ pin_subpackage('gcc_impl_' ~ ctng_target_platform, exact=True) }}
    run_exports:
      # impose this requirement across the build/host boundary
      strong:
        - {{ pin_subpackage('libstdcxx-ng', max_pin=None) }}
    about:
      summary: GNU C++ Compiler
      home: https://gcc.gnu.org/
      license: GPL

  - name: gfortran_impl_{{ ctng_target_platform }}
    script: install-gfortran.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    requirements:
      build:
        # For cpp and crt{i,n}.o
        - {{ pin_subpackage('gcc_impl_' ~ ctng_target_platform, exact=True) }}
      run:
        # For cpp and crt{i,n}.o
        - {{ pin_subpackage('gcc_impl_' ~ ctng_target_platform, exact=True) }}
        - {{ pin_subpackage('libgfortran-ng', max_pin=None) }}
    run_exports:
      # impose this requirement across the build/host boundary
      strong:
        - {{ pin_subpackage('libgfortran-ng', max_pin=None) }}
    about:
      summary: GNU Fortran Compiler
      home: https://gcc.gnu.org/
      license: GPL

  - name: binutils_impl_{{ ctng_target_platform }}
    version: {{ ctng_binutils }}
    script: install-binutils.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: The GNU Binutils are a collection of binary tools.
      home: https://www.gnu.org/software/binutils/
      license: GPL

  - name: libstdcxx-ng
    target: {{ ctng_target_platform }}
    script: install-libstdc++.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: The GNU C++ Runtime Library
      home: https://gcc.gnu.org/
      license: GPL3 with runtime exception

  - name: libgcc-ng
    target: {{ ctng_target_platform }}
    script: install-libgcc.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: The GCC low-level runtime library
      home: https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html
      license: GPL

  - name: libgfortran-ng
    target: {{ ctng_target_platform }}
    script: install-libgfortran.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: The GNU Fortran Runtime Library
      home: https://gcc.gnu.org/
      license: GPL

  - name: gdb_{{ ctng_target_platform }}
    target: {{ ctng_target_platform }}
    version: {{ ctng_gdb }}
    script: install-gdb.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: The GNU Project Debugger
      home: https://www.gnu.org/software/gdb/
      license: GPL

  - name: duma_{{ ctng_target_platform }}
    target: {{ ctng_target_platform }}
    version: {{ ctng_duma }}
    script: install-duma.sh
    build:
      number: {{ build_num }}
      missing_dso_whitelist:
        - '*'
    about:
      summary: DUMA is an open-source library to detect buffer overruns and under-runs in C and C++ programs.
      home: http://duma.sourceforge.net/
      license: GPL
