uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,62 @@
{ lib
, callPackage
, makeSetupHook
, makeWrapper
, dotnet-sdk
, dotnet-test-sdk
, disabledTests
, nuget-source
, dotnet-runtime
, runtimeDeps
, buildType
}:
{
dotnetConfigureHook = callPackage ({ }:
makeSetupHook {
name = "dotnet-configure-hook";
deps = [ dotnet-sdk nuget-source ];
substitutions = {
nugetSource = nuget-source;
};
} ./dotnet-configure-hook.sh) { };
dotnetBuildHook = callPackage ({ }:
makeSetupHook {
name = "dotnet-build-hook";
deps = [ dotnet-sdk ];
substitutions = {
inherit buildType;
};
} ./dotnet-build-hook.sh) { };
dotnetCheckHook = callPackage ({ }:
makeSetupHook {
name = "dotnet-check-hook";
deps = [ dotnet-test-sdk ];
substitutions = {
inherit buildType;
disabledTests = lib.optionalString (disabledTests != [])
(lib.concatStringsSep "&FullyQualifiedName!=" disabledTests);
};
} ./dotnet-check-hook.sh) { };
dotnetInstallHook = callPackage ({ }:
makeSetupHook {
name = "dotnet-install-hook";
deps = [ dotnet-sdk ];
substitutions = {
inherit buildType;
};
} ./dotnet-install-hook.sh) { };
dotnetFixupHook = callPackage ({ }:
makeSetupHook {
name = "dotnet-fixup-hook";
deps = [ dotnet-runtime makeWrapper ];
substitutions = {
dotnetRuntime = dotnet-runtime;
runtimeDeps = lib.makeLibraryPath runtimeDeps;
};
} ./dotnet-fixup-hook.sh) { };
}

View file

@ -0,0 +1,42 @@
# inherit arguments from derivation
dotnetBuildFlags=( ${dotnetBuildFlags[@]-} )
dotnetBuildHook() {
echo "Executing dotnetBuildHook"
runHook preBuild
if [ "${enableParallelBuilding-}" ]; then
maxCpuFlag="$NIX_BUILD_CORES"
parallelBuildFlag="true"
else
maxCpuFlag="1"
parallelBuildFlag="false"
fi
if [ "${version-}" ]; then
versionFlag="-p:Version=${version-}"
fi
for project in ${projectFile[@]} ${testProjectFile[@]}; do
env \
dotnet build "$project" \
-maxcpucount:$maxCpuFlag \
-p:BuildInParallel=$parallelBuildFlag \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--configuration "@buildType@" \
--no-restore \
${versionFlag-} \
${dotnetBuildFlags[@]} \
${dotnetFlags[@]}
done
runHook postBuild
echo "Finished dotnetBuildHook"
}
if [[ -z "${dontDotnetBuild-}" && -z "${buildPhase-}" ]]; then
buildPhase=dotnetBuildHook
fi

View file

@ -0,0 +1,34 @@
# inherit arguments from derivation
dotnetTestFlags=( ${dotnetTestFlags[@]-} )
dotnetCheckHook() {
echo "Executing dotnetCheckHook"
runHook preCheck
if [ "${disabledTests-}" ]; then
disabledTestsFlag="--filter FullyQualifiedName!=@disabledTests@"
fi
for project in ${testProjectFile[@]}; do
env \
dotnet test "$project" \
-maxcpucount:$maxCpuFlag \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--configuration "@buildType@" \
--no-build \
--logger "console;verbosity=normal" \
${disabledTestsFlag-} \
"${dotnetTestFlags[@]}" \
"${dotnetFlags[@]}"
done
runHook postCheck
echo "Finished dotnetCheckHook"
}
if [[ -z "${dontDotnetCheck-}" && -z "${checkPhase-}" ]]; then
checkPhase=dotnetCheckHook
fi

View file

@ -0,0 +1,34 @@
declare -a projectFile testProjectFile
# inherit arguments from derivation
dotnetFlags=( ${dotnetFlags[@]-} )
dotnetRestoreFlags=( ${dotnetRestoreFlags[@]-} )
dotnetConfigureHook() {
echo "Executing dotnetConfigureHook"
runHook preConfigure
if [ -z "${enableParallelBuilding-}" ]; then
parallelFlag="--disable-parallel"
fi
for project in ${projectFile[@]} ${testProjectFile[@]}; do
env \
dotnet restore "$project" \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--source "@nugetSource@/lib" \
${parallelFlag-} \
${dotnetRestoreFlags[@]} \
${dotnetFlags[@]}
done
runHook postConfigure
echo "Finished dotnetConfigureHook"
}
if [[ -z "${dontDotnetConfigure-}" && -z "${configurePhase-}" ]]; then
configurePhase=dotnetConfigureHook
fi

View file

@ -0,0 +1,43 @@
# Inherit arguments from the derivation
makeWrapperArgs=( ${makeWrapperArgs-} )
# First argument is the executable you want to wrap,
# the second is the destination for the wrapper.
wrapDotnetProgram() {
makeWrapper "$1" "$2" \
--set "DOTNET_ROOT" "@dotnetRuntime@" \
--suffix "LD_LIBRARY_PATH" : "@runtimeDeps@" \
"${gappsWrapperArgs[@]}" \
"${makeWrapperArgs[@]}"
echo "Installed wrapper to: "$2""
}
dotnetFixupHook() {
echo "Executing dotnetFixupPhase"
if [ "${executables}" ]; then
for executable in ${executables[@]}; do
execPath="$out/lib/${pname}/$executable"
if [[ -f "$execPath" && -x "$execPath" ]]; then
wrapDotnetProgram "$execPath" "$out/bin/$(basename "$executable")"
else
echo "Specified binary \"$executable\" is either not an executable, or does not exist!"
exit 1
fi
done
else
for executable in $out/lib/${pname}/*; do
if [[ -f "$executable" && -x "$executable" && "$executable" != *"dll"* ]]; then
wrapDotnetProgram "$executable" "$out/bin/$(basename "$executable")"
fi
done
fi
echo "Finished dotnetFixupPhase"
}
if [[ -z "${dontDotnetFixup-}" ]]; then
preFixupPhases+=" dotnetFixupHook"
fi

View file

@ -0,0 +1,43 @@
# inherit arguments from derivation
dotnetInstallFlags=( ${dotnetInstallFlags[@]-} )
dotnetInstallHook() {
echo "Executing dotnetInstallHook"
runHook preInstall
for project in ${projectFile[@]}; do
env \
dotnet publish "$project" \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--output "$out/lib/${pname}" \
--configuration "@buildType@" \
--no-build \
--no-self-contained \
${dotnetInstallFlags[@]} \
${dotnetFlags[@]}
done
if [[ "${packNupkg-}" ]]; then
for project in ${projectFile[@]}; do
env \
dotnet pack "$project" \
-p:ContinuousIntegrationBuild=true \
-p:Deterministic=true \
--output "$out/share" \
--configuration "@buildType@" \
--no-build \
${dotnetPackFlags[@]} \
${dotnetFlags[@]}
done
fi
runHook postInstall
echo "Finished dotnetInstallHook"
}
if [[ -z "${dontDotnetInstall-}" && -z "${installPhase-}" ]]; then
installPhase=dotnetInstallHook
fi