mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Merge pull request #12297 from NixOS/fix-static
Fix static build of nix
This commit is contained in:
commit
ae7bc5f2c7
2 changed files with 10 additions and 2 deletions
|
@ -75,7 +75,11 @@ let
|
|||
# Users who are debugging Nix builds are expected to set the environment variable `mesonBuildType`, per the
|
||||
# guidance in https://github.com/NixOS/nix/blob/8a3fc27f1b63a08ac983ee46435a56cf49ebaf4a/doc/manual/source/development/debugging.md?plain=1#L10.
|
||||
# For this reason, we don't want to refer to `finalAttrs.mesonBuildType` here, but rather use the environment variable.
|
||||
preConfigure = prevAttrs.preConfigure or "" + lib.optionalString (!stdenv.hostPlatform.isWindows) ''
|
||||
preConfigure = prevAttrs.preConfigure or "" + lib.optionalString (
|
||||
!stdenv.hostPlatform.isWindows
|
||||
# build failure
|
||||
&& !stdenv.hostPlatform.isStatic
|
||||
) ''
|
||||
case "$mesonBuildType" in
|
||||
release|minsize) appendToVar mesonFlags "-Db_lto=true" ;;
|
||||
*) appendToVar mesonFlags "-Db_lto=false" ;;
|
||||
|
|
|
@ -61,6 +61,8 @@ let
|
|||
nix-store-c
|
||||
nix-util
|
||||
nix-util-c
|
||||
] ++ lib.optionals (!stdenv.hostPlatform.isStatic) [
|
||||
# Currently fails in static build
|
||||
nix-perl-bindings
|
||||
];
|
||||
installPhase = ''
|
||||
|
@ -131,6 +133,8 @@ in
|
|||
# (checkInputs must be empty paths??)
|
||||
(runCommand "check-pkg-config" { checked = dev.tests.pkg-config; } "mkdir $out")
|
||||
] ++
|
||||
lib.optionals (!stdenv.hostPlatform.isStatic) (
|
||||
# Perl currently fails in static build
|
||||
(if stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||
then [
|
||||
# TODO: add perl.tests
|
||||
|
@ -138,7 +142,7 @@ in
|
|||
]
|
||||
else [
|
||||
nix-perl-bindings
|
||||
]);
|
||||
]));
|
||||
installCheckInputs = [
|
||||
nix-functional-tests
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue