@@ -871,8 +871,38 @@ self: super: {
871871 # https://github.com/takano-akio/filelock/issues/5
872872 filelock = dontCheck super.filelock;
873873
874− # cryptol-2.5.0 doesn't want happy 1.19.6+.
875− cryptol = super.cryptol.override { happy = self.happy_1_19_5; };
874+ # fix GHC 8.6 builds by using irrefutable patterns. jailbreak is also
875+ # required due to a constraint failure for base-compat.
876+ cryptol = doJailbreak (overrideCabal super.cryptol (drv: {
877+
878+ # the last patch fixes ghc 8.6 builds; the other two (small) patches fix a
879+ # few bugs between them, but are also hard dependencies
880+ patches = drv.patches or [] ++ [
881+ (pkgs.fetchpatch {
882+ url = https://github.com/GaloisInc/cryptol/commit/634c5a03e757663bf86d1ffad1ce2c6086d4483f.patch;
883+ sha256 = "16dvfihsl2c4jnyfndgrjarkm3z5pyn7rzg2svnidx0qipwrxzm7";
884+ })
885+ (pkgs.fetchpatch {
886+ url = https://github.com/GaloisInc/cryptol/commit/515642328aff6d958ff1b534b9effdd726901b60.patch;
887+ sha256 = "1fml71b720igyh8s7mj1z1c2bbv1vk490iy7blvxp625nymzjij6";
888+ })
889+ (pkgs.fetchpatch {
890+ url = https://github.com/GaloisInc/cryptol/commit/a8eab11b319f6434f9b01b26d419b8305ff30bc2.patch;
891+ sha256 = "1bbznp3kbj8l83q979gf4gr2khwbyqi85ykwsf2jnkhzda6pr0n8";
892+ })
893+ ];
894+
895+ buildTools = drv.buildTools or [] ++ [ pkgs.makeWrapper ];
896+
897+ # make sure the binaries always start up. previously this was in
898+ # all-packages.nix but it's almost certainly better to do it here (e.g. a
899+ # haskell deps may use cryptol in the test suite or something, etc)
900+ postInstall = drv.postInstall or "" + ''
901+ for b in $out/bin/cryptol $out/bin/cryptol-html; do
902+ wrapProgram $b --prefix 'PATH' ':' "${pkgs.lib.getBin pkgs.z3}/bin"
903+ done
904+ '';
905+ }));
876906
877907 # Tests try to invoke external process and process == 1.4
878908 grakn = dontCheck (doJailbreak super.grakn);