Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5: Add missing include path to pkg-config files #86317

Merged
merged 1 commit into from May 28, 2020

Conversation

xbreak
Copy link
Contributor

@xbreak xbreak commented Apr 29, 2020

Motivation for this change

To fix #52457.

This is achieved by patching qtbase qmake/generators/makefile.cpp to
unconditionally add the missing -I${includedir}. The include path is
otherwise conditioned on whether it is already available or not. Since there is
no unified set of system include paths in nix this cause problems as reported
in #52457.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested a sample compilation of pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkg-config when this fix is applied to staging:

 $ grep "Cflags" /nix/store/szikc0g33cgh55ihkfwi983z0psw0ciz-qtdeclarative-5.12.7-dev/lib/pkgconfig/*
/nix/store/szikc0g33cgh55ihkfwi983z0psw0ciz-qtdeclarative-5.12.7-dev/lib/pkgconfig/Qt5Qml.pc:Cflags: -DQT_QML_LIB -I${includedir}/QtQml -I${includedir}
/nix/store/szikc0g33cgh55ihkfwi983z0psw0ciz-qtdeclarative-5.12.7-dev/lib/pkgconfig/Qt5Quick.pc:Cflags: -DQT_QUICK_LIB -I${includedir}/QtQuick -I${includedir}
/nix/store/szikc0g33cgh55ihkfwi983z0psw0ciz-qtdeclarative-5.12.7-dev/lib/pkgconfig/Qt5QuickTest.pc:Cflags: -DQT_QMLTEST_LIB -I${includedir}/QtQuickTest -I${includedir}
/nix/store/szikc0g33cgh55ihkfwi983z0psw0ciz-qtdeclarative-5.12.7-dev/lib/pkgconfig/Qt5QuickWidgets.pc:Cflags: -DQT_QUICKWIDGETS_LIB -I${includedir}/QtQuickWidgets -I${includedir}

@xbreak
Copy link
Contributor Author

xbreak commented Apr 29, 2020

@ttuegel: A better approach than do .pc file patching (as found by @jtojnar) might be to set an empty QMAKE_DEFAULT_INCDIRS. What do you think?

See discussion in #52457.

@jtojnar
Copy link
Contributor

jtojnar commented Apr 29, 2020

It would be better to find out what is setting the QMAKE_DEFAULT_INCDIRS since otherwise we need to nullify it in every package using qt_module.prf (e.g. qtsvg).

@FRidh FRidh changed the base branch from master to staging May 1, 2020 06:53
@ofborg ofborg bot requested a review from Phreedom May 1, 2020 07:01
@xbreak
Copy link
Contributor Author

xbreak commented May 11, 2020

@ttuegel: Updated PR as agreed in #52457.

This is achieved by patching qtbase `qmake/generators/makefile.cpp` to
unconditionally add the missing `-I${includedir}`. The include path is
otherwise conditioned on whether it is already available or not. Since there is
no unified set of system include paths in nix this cause problems as reported
in NixOS#52457.
@periklis periklis removed their request for review May 14, 2020 07:18
@xbreak
Copy link
Contributor Author

xbreak commented May 25, 2020

Ping @ttuegel: Do you mind taking a look?

@ttuegel ttuegel merged commit 99d2567 into NixOS:staging May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qt5: qtdeclarative pkg-config missing an include path
3 participants