diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/dotnet/build-dotnet-module/default.nix | 5 | ||||
-rwxr-xr-x | pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 1892c6b79306d..a8754218deceb 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -157,9 +157,6 @@ stdenvNoCC.mkDerivation (args // { fetch-deps = let - # Because this list is rather long its put in its own store path to maintain readability of the generated script - exclusions = writeText "nuget-package-exclusions" (lib.concatStringsSep "\n" (dotnet-sdk.passthru.packages { fetchNuGet = attrs: attrs.pname; })); - # Derivations may set flags such as `--runtime <rid>` based on the host platform to avoid restoring/building nuget dependencies they dont have or dont need. # This introduces an issue; In this script we loop over all platforms from `meta` and add the RID flag for it, as to fetch all required dependencies. # The script would inherit the RID flag from the derivation based on the platform building the script, and set the flag for any iteration we do over the RIDs. @@ -254,7 +251,7 @@ stdenvNoCC.mkDerivation (args // { echo "Writing lockfile..." echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please dont edit it manually, your changes might get overwritten!\n" > "$depsFile" - nuget-to-nix "$tmp/nuget_pkgs" "${exclusions}" >> "$depsFile" + nuget-to-nix "$tmp/nuget_pkgs" "${sdkDeps}" >> "$depsFile" echo "Succesfully wrote lockfile to $depsFile" ''; } // args.passthru or { }; diff --git a/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh b/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh index 5685b0f62bd92..d8c928f5179e1 100755 --- a/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh +++ b/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh @@ -5,14 +5,14 @@ set -euo pipefail export PATH="@binPath@" if [ $# -eq 0 ]; then - >&2 echo "Usage: $0 <packages directory> [path to file with a list of excluded packages] > deps.nix" + >&2 echo "Usage: $0 <packages directory> [path to excluded package source] > deps.nix" exit 1 fi pkgs=$1 -exclusions="${2:-/dev/null}" tmpfile=$(mktemp /tmp/nuget-to-nix.XXXXXX) trap "rm -f ${tmpfile}" EXIT +excluded_source=$(realpath "${2:-$tmp/empty}") declare -A nuget_sources_cache @@ -23,7 +23,7 @@ while read pkg_spec; do # Build version part should be ignored: `3.0.0-beta2.20059.3+77df2220` -> `3.0.0-beta2.20059.3` sed -nE 's/.*<id>([^<]*).*/\1/p; s/.*<version>([^<+]*).*/\1/p' "$pkg_spec") - if grep "$pkg_name" "$exclusions" > /dev/null; then + if [[ -e "$excluded_source/${pkg_name}.$pkg_version".nupkg ]]; then continue fi |