mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
treewide: use stdenv.buildPlatform.canExecute (#350195)
This commit is contained in:
commit
4dbb808a7d
@ -116,7 +116,7 @@ buildPythonApplication rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# check phase uses the output bin, which is not possible when cross-compiling
|
# check phase uses the output bin, which is not possible when cross-compiling
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
|
@ -29,7 +29,7 @@ buildGoModule rec {
|
|||||||
|
|
||||||
doCheck = false; # requires docker, container-diff (unpackaged yet)
|
doCheck = false; # requires docker, container-diff (unpackaged yet)
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
for shell in bash fish zsh; do
|
for shell in bash fish zsh; do
|
||||||
$out/bin/executor completion $shell > executor.$shell
|
$out/bin/executor completion $shell > executor.$shell
|
||||||
installShellCompletion executor.$shell
|
installShellCompletion executor.$shell
|
||||||
|
@ -29,7 +29,7 @@ buildGoModule rec {
|
|||||||
'';
|
'';
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
installShellCompletion --cmd kubeshark \
|
installShellCompletion --cmd kubeshark \
|
||||||
--bash <($out/bin/kubeshark completion bash) \
|
--bash <($out/bin/kubeshark completion bash) \
|
||||||
--fish <($out/bin/kubeshark completion fish) \
|
--fish <($out/bin/kubeshark completion fish) \
|
||||||
|
@ -40,7 +40,7 @@ buildGoModule rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
installShellCompletion --cmd vela \
|
installShellCompletion --cmd vela \
|
||||||
--bash <($out/bin/vela completion bash) \
|
--bash <($out/bin/vela completion bash) \
|
||||||
--zsh <($out/bin/vela completion zsh)
|
--zsh <($out/bin/vela completion zsh)
|
||||||
|
@ -117,7 +117,7 @@ let
|
|||||||
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
|
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
# In particular, this detects missing python imports in some of the tools.
|
# In particular, this detects missing python imports in some of the tools.
|
||||||
postFixup = let
|
postFixup = let
|
||||||
# TODO: python is a script, so it doesn't work as interpreter on darwin
|
# TODO: python is a script, so it doesn't work as interpreter on darwin
|
||||||
|
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
|
|||||||
"-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}"
|
"-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
nativeCheckInputs = [ check ];
|
nativeCheckInputs = [ check ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
|
|||||||
"kmymoney/plugins/woob/interface/kmymoneywoob.py"
|
"kmymoney/plugins/woob/interface/kmymoneywoob.py"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
nativeInstallCheckInputs = [ xvfb-run ];
|
nativeInstallCheckInputs = [ xvfb-run ];
|
||||||
installCheckPhase =
|
installCheckPhase =
|
||||||
lib.optionalString doInstallCheck ''
|
lib.optionalString doInstallCheck ''
|
||||||
|
@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
configureFlags =
|
configureFlags =
|
||||||
lib.optional (!withInternalSqlite) "--disable-internal-sqlite"
|
lib.optional (!withInternalSqlite) "--disable-internal-sqlite"
|
||||||
|
@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
# override this to false if you don't want to build python3
|
# override this to false if you don't want to build python3
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
# prevent the `install-data-local` Makefile rule from running;
|
# prevent the `install-data-local` Makefile rule from running;
|
||||||
# all it does is attempt to `mkdir` the `localstatedir`.
|
# all it does is attempt to `mkdir` the `localstatedir`.
|
||||||
|
@ -28,7 +28,7 @@ buildGo123Module rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
make manpage
|
make manpage
|
||||||
installManPage share/man/man1/*
|
installManPage share/man/man1/*
|
||||||
installShellCompletion --cmd glab \
|
installShellCompletion --cmd glab \
|
||||||
|
@ -26,7 +26,7 @@ buildGoModule rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
# Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
|
# Mangal creates a config file in the folder ~/.config/mangal and fails if not possible
|
||||||
export HOME=$(mktemp -d)
|
export HOME=$(mktemp -d)
|
||||||
installShellCompletion --cmd mangal \
|
installShellCompletion --cmd mangal \
|
||||||
|
@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
makeFlags = [ "AR:=$(AR)" ];
|
makeFlags = [ "AR:=$(AR)" ];
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
"out"
|
"out"
|
||||||
|
@ -31,7 +31,7 @@ buildGoModule rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles ];
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
$out/bin/velero completion bash > velero.bash
|
$out/bin/velero completion bash > velero.bash
|
||||||
$out/bin/velero completion zsh > velero.zsh
|
$out/bin/velero completion zsh > velero.zsh
|
||||||
installShellCompletion velero.{bash,zsh}
|
installShellCompletion velero.{bash,zsh}
|
||||||
|
@ -115,7 +115,7 @@ in stdenv.mkDerivation {
|
|||||||
|
|
||||||
buildFlags = [ "all" "selftest" ];
|
buildFlags = [ "all" "selftest" ];
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
./zerotier-selftest
|
./zerotier-selftest
|
||||||
|
@ -29,7 +29,7 @@ stdenv.mkDerivation {
|
|||||||
];
|
];
|
||||||
|
|
||||||
# installCheck instead of check due to -install_name'd library on Darwin
|
# installCheck instead of check due to -install_name'd library on Darwin
|
||||||
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
installCheckTarget = "check";
|
installCheckTarget = "check";
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -840,7 +840,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
# Fails with SIGABRT otherwise FIXME: Why?
|
# Fails with SIGABRT otherwise FIXME: Why?
|
||||||
checkPhase = let
|
checkPhase = let
|
||||||
|
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
|||||||
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
|
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
checkTarget = "test";
|
checkTarget = "test";
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
|
|||||||
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
|
"-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
checkTarget = "test";
|
checkTarget = "test";
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
nativeCheckInputs = [ gtest ];
|
nativeCheckInputs = [ gtest ];
|
||||||
enableParallelChecking = false;
|
enableParallelChecking = false;
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
|||||||
"-DJSON_MultipleHeaders=ON"
|
"-DJSON_MultipleHeaders=ON"
|
||||||
] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}";
|
] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}";
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
# skip tests that require git or modify “installed files”
|
# skip tests that require git or modify “installed files”
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
|
@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
# Since we rewrote the load path in the dynamic loader for the TCTI
|
# Since we rewrote the load path in the dynamic loader for the TCTI
|
||||||
# The various tcti implementation should be placed in their target directory
|
# The various tcti implementation should be placed in their target directory
|
||||||
# before we could run tests, so we make turn checkPhase into installCheckPhase
|
# before we could run tests, so we make turn checkPhase into installCheckPhase
|
||||||
|
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
|||||||
] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF";
|
] ++ lib.optional (!doCheck) "-DURIPARSER_BUILD_TESTS=OFF";
|
||||||
|
|
||||||
nativeCheckInputs = [ gtest ];
|
nativeCheckInputs = [ gtest ];
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog";
|
changelog = "https://github.com/uriparser/uriparser/blob/uriparser-${version}/ChangeLog";
|
||||||
|
@ -22,7 +22,7 @@ buildGoModule rec {
|
|||||||
$out/bin/k6 version | grep ${version} > /dev/null
|
$out/bin/k6 version | grep ${version} > /dev/null
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
installShellCompletion --cmd k6 \
|
installShellCompletion --cmd k6 \
|
||||||
--bash <($out/bin/k6 completion bash) \
|
--bash <($out/bin/k6 completion bash) \
|
||||||
--fish <($out/bin/k6 completion fish) \
|
--fish <($out/bin/k6 completion fish) \
|
||||||
|
Loading…
Reference in New Issue
Block a user