biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / purescript / spago / update.sh
blobb97b0fe94a9ccb4120cadfae4c4ef3ca45a252c4
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p cabal2nix curl jq haskellPackages.cabal2nix-unstable -I nixpkgs=.
4 # This script will update the spago derivation to the latest version using
5 # cabal2nix.
7 # Note that you should always try building spago after updating it here, since
8 # some of the overrides in pkgs/development/haskell/configuration-nix.nix may
9 # need to be updated/changed.
11 set -eo pipefail
13 # This is the directory of this update.sh script.
14 script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
16 # Spago derivation created with cabal2nix.
17 spago_derivation_file="${script_dir}/spago.nix"
19 # This is the current revision of spago in Nixpkgs.
20 old_version="$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$spago_derivation_file")"
22 # This is the latest release version of spago on GitHub.
23 new_version=$(curl --silent "https://api.github.com/repos/purescript/spago/releases" | jq '.[0].tag_name' --raw-output)
25 echo "Updating spago from old version $old_version to new version $new_version."
26 echo "Running cabal2nix and outputting to ${spago_derivation_file}..."
28 echo "# This has been automatically generated by the script" > "$spago_derivation_file"
29 echo "# ./update.sh. This should not be changed by hand." >> "$spago_derivation_file"
31 cabal2nix --revision "$new_version" "https://github.com/purescript/spago.git" >> "$spago_derivation_file"
33 # TODO: This should ideally also automatically update the docsSearchVersion
34 # from pkgs/development/haskell/configuration-nix.nix.
36 echo
37 echo "Finished. Make sure you run the following commands to confirm Spago builds correctly:"
38 echo ' - `nix build -L -f ./. spago`'
39 echo ' - `sudo nix build -L -f ./. spago.passthru.tests --option sandbox relaxed`'