-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
qt-5: add buildPackages.stdenv.cc to nativeBuildInputs #220310
Conversation
this isn't related to newScope, instead the issue is that the inherits in all-packages aren't inherited from change qt5 = recurseIntoAttrs (makeOverridable
(import ../development/libraries/qt-5/5.15) {
inherit newScope;
inherit lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper;
inherit bison cups dconf harfbuzz libGL perl gtk3 python3;
inherit (gst_all_1) gstreamer gst-plugins-base;
inherit darwin;
inherit buildPackages;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
}); to qt5 = recurseIntoAttrs (makeOverridable
(import ../development/libraries/qt-5/5.15) {
inherit (__splicedPackages)
newScope lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper
bison cups dconf harfbuzz libGL perl gtk3 python3
darwin buildPackages;
inherit (__splicedPackages.gst_all_1) gstreamer gst-plugins-base;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
}); |
#220374 inherit __splicedPackages + makeScopeWithSplicing |
Rebased on top of #220374 This allowed to drop the |
adding buildPackages.stdenv.cc to nativeBuildInputs looks wrong, investigating.. |
qmake/Makefile (which is generated) has the wrong CC and CXX variables (non prefixed binaries) also for ref here's the qt5base build file for build root |
Is that wrong? In theory in order to fit nixpkgs way of thinking, Edit: or we could think of |
Void is another good one. Unfortunately I'm trying to do this without totally rewriting our qt5 expressions. I think the recipes from other distros would be more useful in a rewrite-from-scratch (which I am not volunteering for). |
Qmake expects to be able to find the host's C compiler in the $PATH when cross compiling. Let's add it. Co-authored-by: superherointj <[email protected]>
adding even if a build build compiler was needed then |
@@ -77,7 +79,11 @@ stdenv.mkDerivation (finalAttrs: { | |||
++ lib.optional (postgresql != null) postgresql; | |||
|
|||
nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ] | |||
++ lib.optionals stdenv.isDarwin [ xcbuild ]; | |||
++ lib.optionals stdenv.isDarwin [ xcbuild ] | |||
# `qtbase` expects to find `cc` (with no prefix) in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we patch that?
Why do we need this in the wrapper and package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, there's a lot of ugliness in nixpkgs' qt5
expressions. But I am trying really hard not to undertake a rewrite-from-scratch of them here.
Co-authored-by: Sandro <[email protected]>
Co-authored-by: Sandro <[email protected]>
Co-authored-by: Sandro <[email protected]>
As recommended here: #220310 (comment) The non-idiomatic `if..then..else null` is to prevent a mass-rebuild sending this to staging. I can submit a separate PR to staging to change it to the `lib.optional` idiom if this bothers people.
I'm having trouble understanding this, except for the last bit about prefixes, which I disagree with: the fact that native compilers are unprefixed is a bug in nixpkgs (which is painful to fix) not a feature.
Since |
Description of changes
Because
qt-5
useslib.newScope
rather thanlib.newScopeWithSplicing
, the splicing mechanism for cross compilation does not appear to work correctly.Rather than risk breakage on native compiles, let's just choose the
buildPackages
version manually forperl
and the hostcc
(which is needed forqmake
). This commit does that by adding them tonativeBuildInputs
inqtModule.nix
andmodules/qtbase.nix
.