# This file created by conda-build 26.3.0
# ------------------------------------------------

package:
  name: conda-gcc-specs
  version: 13.4.0
source:
  - url:
      - https://mirrors.ocf.berkeley.edu/gnu/gcc/gcc-13.4.0/gcc-13.4.0.tar.gz
    sha256: bf0baf3e570c9c74c17c8201f0196c6924b4bd98c90e69d6b2ac0cd823f33bbc
    patches:
      - patches/0001-allow-commands-in-main-specfile.patch
      - patches/0004-Hardcode-HAVE_ALIGNED_ALLOC-1-in-libstdc-v3-configur.patch
  - url: https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz
    sha256: 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23
    folder: zlib2
build:
  number: 19
  detect_binary_files_with_prefix: false
  string: h109b0d3_19
requirements:
  run:
    - gcc_impl_linux-64 >=13.4.0,<13.4.1.0a0
  build: []
test:
  files:
    - tests
  commands:
    - specdir=$PREFIX/lib/gcc/x86_64-conda-linux-gnu/13.4.0
    - test -f $specdir/conda.specs
    - CC=$(${PREFIX}/bin/*-gcc -dumpmachine)-gcc
    - echo | ${CC} -E -v -x c - |& grep '^Reading specs from' | awk '{print $NF}'
      | xargs readlink -e | awk -v ORS= '{print $1":"}' | grep "${specdir}/specs:${specdir}/conda.specs:"
    - cp tests/libhowdy.h $PREFIX/include/
    - ${CC} -shared -fpic -o $PREFIX/lib/libhowdy.so tests/libhowdy.c
    - ${CC} -o howdy-dso tests/howdy-dso.c -lhowdy
    - ./howdy-dso
    - grep RPATH   <(x86_64-conda-linux-gnu-readelf -d howdy-dso)
    - '! grep RUNPATH <(x86_64-conda-linux-gnu-readelf -d howdy-dso)'
    - ${CC} -Wl,-enable-new-dtags -o howdy-dso-runpath tests/howdy-dso.c -lhowdy
    - ./howdy-dso-runpath
    - '! grep RPATH   <(x86_64-conda-linux-gnu-readelf -d howdy-dso-runpath)'
    - grep RUNPATH <(x86_64-conda-linux-gnu-readelf -d howdy-dso-runpath)
    - echo | ${CC} -E -Wp,-v -x c - |& awk '/include <\.\.\.> search starts/,/^End
      of search/ {print}' | tail -n2 | head -n1 | grep "$PREFIX/include"
    - echo | ${CC} -isystem "$PREFIX/include" -E -Wp,-v -x c - |& awk '/include <\.\.\.>
      search starts/, /^End of search/ {print}' | head -n2 | tail -n1 | grep "$PREFIX/include"
about:
  summary: conda-specific specfile for GNU C/C++ Compiler
  description: "When installed, this optional package provides a specfile that\ndirects\
    \ gcc (and g++ or gfortran) to automatically:\n  * search for includes in $PREFIX/include\n\
    \  * link libraries in $PREFIX/lib\n  * set RPATH to $PREFIX/lib\n  * use RPATH\
    \ instead of the newer RUNPATH\nThis package is intended to aid usability of the\
    \ compiler\ntoolchain as a replacement for system-installed compilers.\nIt should\
    \ not be used in recipes.  Use the 'compiler(<lang>)'\njinja function as described\
    \ on\nhttps://conda-forge.org/docs/maintainer/knowledge_base.html#dep-compilers\n"
  home: https://gcc.gnu.org/
  license: GPL-3.0-only WITH GCC-exception-3.1
  doc_url: https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
extra:
  feedstock-name: ctng-compilers-feedstock
  recipe-maintainers:
    - beckermr
    - isuruf
    - timsnyder
    - xhochy
  final: true
  copy_test_source_files: true
  flow_run_id: azure_20260508.3.1
  remote_url: https://github.com/conda-forge/ctng-compilers-feedstock
  sha: 56d1f0049683ead04fe3ed3276d698dbaacac230
