2019-05-07 08:19:47 +03:00
|
|
|
# A script for regenerating nix for tests
|
2020-03-31 04:12:40 +03:00
|
|
|
let
|
|
|
|
haskellNix = (import ../default.nix {});
|
|
|
|
in
|
|
|
|
{ pkgs ? import nixpkgs nixpkgsArgs
|
2020-07-08 13:54:01 +03:00
|
|
|
, nixpkgs ? haskellNix.sources.nixpkgs
|
2020-03-31 04:12:40 +03:00
|
|
|
, nixpkgsArgs ? haskellNix.nixpkgsArgs
|
2019-05-07 08:19:47 +03:00
|
|
|
}:
|
|
|
|
|
|
|
|
with pkgs;
|
|
|
|
|
|
|
|
writeScript "regen-tests.sh" ''
|
2019-11-01 13:08:31 +03:00
|
|
|
#!${pkgs.runtimeShell}
|
2019-05-07 08:19:47 +03:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-11-05 02:50:50 +03:00
|
|
|
export PATH="${lib.makeBinPath [ coreutils glibc haskell-nix.nix-tools cabal-install haskell-nix.compiler.ghc865 ]}"
|
2019-05-07 08:19:47 +03:00
|
|
|
|
|
|
|
cabal_configure() {
|
|
|
|
cabal new-configure \
|
2019-11-01 13:08:31 +03:00
|
|
|
--with-compiler ghc-8.6.5 \
|
2019-05-07 08:19:47 +03:00
|
|
|
--constraint 'transformers == 0.5.6.2' \
|
|
|
|
--constraint 'process == 1.6.5.0'
|
|
|
|
}
|
|
|
|
|
|
|
|
plan_nix() {
|
|
|
|
plan-to-nix -o . --plan-json dist-newstyle/cache/plan.json
|
|
|
|
}
|
|
|
|
|
|
|
|
cabal_nix() {
|
|
|
|
cabal-to-nix $1.cabal > $1.nix
|
|
|
|
}
|
|
|
|
|
|
|
|
regen() {
|
|
|
|
cabal_configure
|
|
|
|
plan_nix
|
|
|
|
cabal_nix $1
|
|
|
|
}
|
|
|
|
|
|
|
|
cd builder-haddock
|
|
|
|
regen test-haddock
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cd cabal-22
|
|
|
|
regen project
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cd cabal-simple
|
|
|
|
regen cabal-simple
|
2020-08-31 02:08:25 +03:00
|
|
|
cd ..
|
2019-05-07 08:19:47 +03:00
|
|
|
|
|
|
|
cd cabal-sublib
|
|
|
|
regen cabal-sublib
|
2020-08-31 02:08:25 +03:00
|
|
|
cd ..
|
2019-05-07 08:19:47 +03:00
|
|
|
|
|
|
|
cd with-packages
|
|
|
|
regen test-with-packages
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cd stack-simple
|
|
|
|
stack-to-nix -o .
|
|
|
|
cd ..
|
2019-05-12 14:57:22 +03:00
|
|
|
|
|
|
|
cd shell-for
|
|
|
|
cabal_configure
|
|
|
|
plan-to-nix -o . --plan-json dist-newstyle/cache/plan.json --cabal-project cabal.project
|
|
|
|
cd ..
|
2019-05-07 08:19:47 +03:00
|
|
|
''
|