HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/pkgs/libprotobuf-4.25.3-hf2fb9eb_0/info/recipe/parent/meta.yaml
# keep this without major version to let the bot pick it up
{% set version = "25.3" %}
# protobuf doesn't add the major version in the tag, it's defined per language in
# https://github.com/protocolbuffers/protobuf/blob/main/version.json
{% set major = "4" %}

{% set libraries = ["libprotoc", "libprotobuf", "libprotobuf-lite"] %}

package:
  name: libprotobuf-split
  version: {{ major ~ "." ~ version }}

source:
  - url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{ version.replace(".rc", "-rc") }}.tar.gz
    sha256: d19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e
    patches:
      - patches/0001-use-consistent-cmake-location.patch
      - patches/0002-set-static-lib-extension-on-windows.patch
      - patches/0003-always-look-for-shared-abseil-builds.patch
      # grpc_cpp_java_plugin links against otherwise internal symbols
      - patches/0004-Export-functions-in-google-compiler-java-names.patch
      - patches/0005-do-not-install-vendored-gmock.patch
      # backport https://github.com/protocolbuffers/protobuf/pull/15518
      - patches/0006-Fix-getting-env-variables-on-windows.patch
      # backport https://github.com/protocolbuffers/protobuf/commit/f78f9c51fa2470070e5d4b49649800971c789224
      - patches/0007-Workaround-false-positive-warning-in-MSVC.-Fixes-htt.patch
      # backport https://github.com/protocolbuffers/protobuf/pull/15888
      - patches/0008-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch
      # skip annoyingly flaky test on windows, see
      # https://github.com/protocolbuffers/protobuf/issues/8645
      - patches/0009-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch      # [win]
      # workaround stdout tests capture issue on osx builders
      - patches/0010-do-not-capture-stdout-on-osx-tests.patch  # [osx]

build:
  number: 0

requirements:
  build:  # [linux or (osx and arm64)]
    - patch  # [linux]
  
outputs:
  - name: libprotobuf
    script: build-lib.sh  # [unix]
    script: build-lib.bat  # [win]
    build:
      missing_dso_whitelist:  # [s390x]
        - $RPATH/ld64.so.1    # [s390x]
      run_exports:
        # protobuf now (intentionally) increments the SOVER with every patch release, which
        # breaks tools like grpc_plugin_cpp if they get the wrong libprotoc at runtime, see
        # https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/4075
        - {{ pin_subpackage('libprotobuf', max_pin='x.x.x') }}
        - __osx >={{ MACOSX_DEPLOYMENT_TARGET }}  # [osx and x86_64]
      ignore_run_exports_from:
        - gtest
        - jsoncpp
    requirements:
      build:
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
        - cmake
        - ninja-base
      host:
        - gtest 1.14.0
        - jsoncpp 1.9.4
        - libabseil 20240116.2
        # requires abseil test targets to build with tests enabled
        - libabseil-tests
        - zlib {{ zlib }}
      run:
        - zlib       # bounds through run_exports
        - libabseil  # bounds through run_exports        
        # following google's C++ support policy, protobuf only support MacOS >=10.13, see:
        # https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md
        # https://github.com/protocolbuffers/protobuf/blob/v24.0/Protobuf-C%2B%2B.podspec#L29
        - __osx >={{ MACOSX_DEPLOYMENT_TARGET }}  # [osx and x86_64]
    test:
      requires:
        # cmake needs compiler to be able to run package detection, see
        # https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194
        - {{ compiler('cxx') }}
        - cmake
        - ninja-base
        - pkg-config
      files:
        - cmake_test/
      commands:
        {% for each_lib in libraries %}
        # shared libraries
        - test -f ${PREFIX}/lib/{{ each_lib }}.so                      # [linux]
        - test -f ${PREFIX}/lib/{{ each_lib }}.dylib                   # [osx]
        - if not exist %LIBRARY_BIN%\{{ each_lib }}.dll exit 1         # [win]
        - if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1         # [win]

        # absence of static libraries
        - test ! -f ${PREFIX}/lib/{{ each_lib }}.a                     # [unix]
        - if exist %LIBRARY_LIB%\{{ each_lib }}-static.lib exit 1      # [win]
        {% endfor %}

        # cmake
        - test -f ${PREFIX}/lib/cmake/protobuf/protobuf-config.cmake              # [unix]
        - if not exist %LIBRARY_LIB%\cmake\protobuf\protobuf-config.cmake exit 1  # [win]

        # pkg-config
        - pkg-config --print-errors --exact-version "{{ version }}.0" protobuf
        - pkg-config --print-errors --exact-version "{{ version }}.0" protobuf-lite

        # binary
        - protoc --help

        # more CMake integration
        - cd cmake_test
        - cmake -GNinja $CMAKE_ARGS .   # [unix]
        - cmake -GNinja %CMAKE_ARGS% .  # [win]
        - cmake --build .

  - name: libprotobuf-static
    script: build-lib.sh  # [unix]
    script: build-lib.bat  # [win]
    build:
      always_include_files:
        # Must overwrite the CMake metadata from shared libprotobuf
        - lib/cmake/protobuf/           # [unix]
        - Library/lib/cmake/protobuf/   # [win]
      ignore_run_exports_from:
        - jsoncpp
    requirements:
      build:
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
        - cmake
        - ninja-base
      host:
        - gtest 1.14.0
        - jsoncpp 1.9.4
        - libabseil 20240116.2
        # requires abseil test targets to build with tests enabled
        - libabseil-tests
        - zlib {{ zlib }}
        - {{ pin_subpackage('libprotobuf', exact=True) }}
      run:
        - zlib       # bounds through run_exports
        - libabseil  # bounds through run_exports
        - {{ pin_subpackage('libprotobuf', exact=True) }}
    test:
      requires:
        # cmake needs compiler to be able to run package detection, see
        # https://discourse.cmake.org/t/questions-about-find-package-cli-msvc/6194
        - {{ compiler('cxx') }}
        - cmake
        - ninja-base
      files:
        - cmake_test/
      commands:
        {% for each_lib in libraries %}
        # static libraries
        - test -f ${PREFIX}/lib/{{ each_lib }}.a                       # [unix]
        - if not exist %LIBRARY_LIB%\{{ each_lib }}-static.lib exit 1  # [win]
        {% endfor %}

        # more CMake integration
        - cd cmake_test
        - cmake -GNinja $CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release .  # [unix]
        - cmake -GNinja %CMAKE_ARGS% -DCMAKE_BUILD_TYPE=Release . # [win]
        - cmake --build . --config Release

  - name: libprotobuf-python-headers
    script: build-pyheaders.sh  # [unix]
    script: build-pyheaders.bat  # [win]
    requirements:
      host:
        - {{ pin_subpackage('libprotobuf', exact=True) }}
      run_constrained:
        - libprotobuf {{ major ~ "." ~ version }}
    test:
      commands:
        - test -f $PREFIX/include/google/protobuf/proto_api.h      # [unix]
        - test -f $PREFIX/include/google/protobuf/pyext/message.h  # [unix]
        - if not exist %LIBRARY_PREFIX%\include\google\protobuf\proto_api.h exit 1      # [win]
        - if not exist %LIBRARY_PREFIX%\include\google\protobuf\pyext\message.h exit 1  # [win]

about:
  home: https://developers.google.com/protocol-buffers/
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  summary: Protocol Buffers - Google's data interchange format. C++ Libraries and protoc, the protobuf compiler.
  description: |
    Protocol buffers are Google's language-neutral,
    platform-neutral, extensible mechanism for serializing structured data-
    think XML, but smaller, faster, and simpler.
  dev_url: https://github.com/protocolbuffers/protobuf
  doc_url: https://developers.google.com/protocol-buffers/

extra:
  recipe-maintainers:
    - JohanMabille
    - jjerphan
    - xylar
    - dopplershift
    - jakirkham
    - ocefpaf
    - wesm
    - hajapy
    - xhochy
    - h-vetinari
  feedstock-name: libprotobuf