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

stdenv: always pass --build, --host to configure #87909

Draft
wants to merge 5 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkgs/development/libraries/openldap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ stdenv.mkDerivation rec {
makeFlags= [
"CC=${stdenv.cc.targetPrefix}cc"
"STRIP=" # Disable install stripping as it breaks cross-compiling. We strip binaries anyway in fixupPhase.
"STRIP_OPTS="
"prefix=${placeholder "out"}"
"sysconfdir=${placeholder "out"}/etc"
"systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
# contrib modules require these
"moduledir=${placeholder "out"}/lib/modules"
"mandir=${placeholder "out"}/share/man"
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
# Can be unconditional, doing it like this to prevent a mass rebuild.
"STRIP_OPTS="
];

extraContribModules = [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/libraries/qt-5/modules/qtbase.nix
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ stdenv.mkDerivation {
qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
qtDocPrefix = "share/doc/qt-${qtCompatVersion}";

# qmake is built during configure and it doesn't accept platforms flags
# 'ERROR: Unknown command line option '--build=x86_64-unknown-linux-gnu'.''
configurePlatforms = [ ];

setOutputFlags = false;
preConfigure = ''
export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/tools/analysis/radare2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ stdenv.mkDerivation rec {
sha256 = "0fpz63dfac1i6wwf5wp3v1vs3r5yzh05g95m5vidx56h0g4dcp44";
};

postPatch = ''
substituteInPlace ./configure \
--replace 'CC="''${HOST}-''${CC}"' 'CC="''${CC}"'
'';

preBuild = ''
cp -r ${arm64} libr/asm/arch/arm/v35arm64/arch-arm64
chmod -R +w libr/asm/arch/arm/v35arm64/arch-arm64
Expand Down
6 changes: 1 addition & 5 deletions pkgs/stdenv/generic/make-derivation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ makeOverlayable (overrideAttrs:
, mesonFlags ? []
, # Target is not included by default because most programs don't care.
# Including it then would cause needless mass rebuilds.
#
# TODO(@Ericson2314): Make [ "build" "host" ] always the default.
configurePlatforms ? lib.optionals
(stdenv.hostPlatform != stdenv.buildPlatform)
[ "build" "host" ]
configurePlatforms ? [ "build" "host" ]

# TODO(@Ericson2314): Make unconditional / resolve #33599
# Check phase
Expand Down
5 changes: 5 additions & 0 deletions pkgs/tools/text/discount/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ stdenv.mkDerivation rec {
sha256 = "sha256-S6OVKYulhvEPRqNXBsvZ7m2W4cbdnrpZKPAo3SfD+9s=";
};

strictDeps = true;

# uses a custom configure script
# Bad option --build=x86_64-unknown-linux-gnu.
configurePlatforms = [ ];
patches = [ ./fix-configure-path.patch ];
configureScript = "./configure.sh";
configureFlags = [
Expand Down