diff options
Diffstat (limited to 'nixpkgs/pkgs/development/dotnet-modules/python-language-server/create_deps.sh')
-rwxr-xr-x | nixpkgs/pkgs/development/dotnet-modules/python-language-server/create_deps.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/dotnet-modules/python-language-server/create_deps.sh b/nixpkgs/pkgs/development/dotnet-modules/python-language-server/create_deps.sh new file mode 100755 index 00000000000..f3cdcbc0c10 --- /dev/null +++ b/nixpkgs/pkgs/development/dotnet-modules/python-language-server/create_deps.sh @@ -0,0 +1,36 @@ +#! /usr/bin/env nix-shell +#! nix-shell -p python3 dotnet-sdk_3 -i bash + +# Run this script to generate deps.nix +# ./create_deps.sh /path/to/microsoft/python/language/server/source/checkout + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if [ -d "$1" ]; then + CHECKOUT_PATH="$1" +else + echo "First argument must be a directory, the path to the Microsoft Python Language Server source checkout" + exit 1 +fi + +# Generate lockfiles in source checkout +cd $CHECKOUT_PATH/src +dotnet nuget locals all --clear +dotnet restore -v normal --no-cache PLS.sln --use-lock-file -r linux-x64 + +# Use the lockfiles to make a file with two columns: name and version number +# for all possible package dependencies +cd $SCRIPTDIR +echo "" > all_versions.txt +for lockfile in $(find "$CHECKOUT_PATH" -name packages.lock.json); do + echo "Processing lockfile $lockfile" + python ./process_lockfile.py "$lockfile" >> all_versions.txt +done +# Add extra manually added packages +cat ./manual_deps.txt >> all_versions.txt +cat all_versions.txt | sed '/^$/d' | sort | uniq > tmp +mv tmp all_versions.txt + +# Retrieve sha256 hashes for each dependency and format fetchNuGet calls into deps.nix +./format-deps.sh all_versions.txt > deps.nix +rm all_versions.txt |