conda-forge / qt-main-feedstock

A conda-smithy repository for qt-main.
BSD 3-Clause "New" or "Revised" License
5 stars 29 forks source link

Malformed replacements in conda_build_config.yaml #79

Open hmaarrfk opened 1 year ago

hmaarrfk commented 1 year ago

https://github.com/conda-forge/qt-main-feedstock/blob/331aac5f4b7b9fad0dd59b8f60ed70da01944e6a/recipe/conda_build_config.yaml#L16

replacements:
  all_replacements:
    - tag: 'qmake build metadata'
      glob_patterns:
        - '*.pri'
        - '*.prl'
      regex_re: '(?:-L|-I)?\"?([^;\s]+\/sysroot)'
      replacement_re: '$(CONDA_BUILD_SYSROOT)'
      regex_rg: '([^;\s"]+/sysroot)'

seem to be malformed. in qt-webengine, I used sed to replace them with the actual value of ${CONDA_BUILD_SYSROOT}, fully expanded.

I'm not sure if there is a right syntax to use here, or if we should it manaually do the replacement in the build script if we can't do it in the config file.

hmaarrfk commented 1 year ago

I had to add the following code in the build script of qt-webengine to fixup the replacements for compilation:

    pushd "${PREFIX}/lib"
    for f in *.prl; do
        sed -i "s,\$.CONDA_BUILD_SYSROOT),${CONDA_BUILD_SYSROOT},g" ${f};
    done
    popd

    pushd "${PREFIX}/mkspecs"
    for f in *.pri; do
        sed -i "s,\$.CONDA_BUILD_SYSROOT),${CONDA_BUILD_SYSROOT},g" ${f}
    done
    popd

    pushd
    cd "${PREFIX}/mkspecs/modules"
    for f in *.pri; do
        sed -i "s,\$.CONDA_BUILD_SYSROOT),${CONDA_BUILD_SYSROOT},g" ${f}
    done
    popd