qt-5/hooks/fix-qt-builtin-paths.sh: do not hardcode output paths#220311
Conversation
The fix-qt-builtin-paths.sh script replaces several strings in *.pr* files with output names; for example ``` $$[QT_HOST_BINS] is replaced by $dev ``` This causes problems when cross-compiling: the `mkspecs/qconfig.pri` in the `$dev` output of `qtbase` will have output names *of qtbase* hardwired into it. Since `qmake` is part of the `qtbase` package, it will pick up these hardcoded paths when compiling the other modules. As a result, the `installPhase` of `qtdeclarative` (and other modules) will attempt to copy their results into the already-registered store path for `qtbase`. This will fail, because Nix prevents writes to a storepath after it has been registered. Fortunately the `.pri` files understand environment variable substitution: you can write `$$NIX_OUTPUT_DEV` to tell `qmake` that it should use the value of the `NIX_OUTPUT_DEV` environment variable *at `qmake`-run-time* (rather than at `qmake`-build-time).
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
The fix-qt-builtin-paths.sh script replaces several strings in .pr files with output names; for example
This causes problems when cross-compiling: the
mkspecs/qconfig.priin the$devoutput ofqtbasewill have output names of qtbase hardwired into it. Sinceqmakeis part of theqtbasepackage, it will pick up these hardcoded paths when compiling the other modules.As a result, the
installPhaseofqtdeclarative(and other modules) will attempt to copy their results into the already-registered store path forqtbase. This will fail, because Nix prevents writes to a storepath after it has been registered.Fortunately the
.prifiles understand environment variable substitution: you can write$$NIX_OUTPUT_DEVto tellqmakethat it should use the value of theNIX_OUTPUT_DEVenvironment variable atqmake-run-time (rather than atqmake-build-time).