From e6d1e68f4add807b94173788b9e53da98b4e255b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 10 Apr 2021 14:12:25 +0200 Subject: refactor(3p/overlays): Move haskell overlay to new tree location nixpkgs_exposed is going away, and the haskell overlay is independent from that. See also b/108, cl/2910 Change-Id: I3aea6dfc427a914f3f88146fd0b45d60dfd45a1a Reviewed-on: https://cl.tvl.fyi/c/depot/+/2918 Tested-by: BuildkiteCI Reviewed-by: sterni --- third_party/overlays/haskell/default.nix | 34 ++++++++++++++++++++++ .../generic-arbitrary-export-garbitrary.patch | 12 ++++++++ 2 files changed, 46 insertions(+) create mode 100644 third_party/overlays/haskell/default.nix create mode 100644 third_party/overlays/haskell/patches/generic-arbitrary-export-garbitrary.patch (limited to 'third_party/overlays') diff --git a/third_party/overlays/haskell/default.nix b/third_party/overlays/haskell/default.nix new file mode 100644 index 000000000000..975918803e29 --- /dev/null +++ b/third_party/overlays/haskell/default.nix @@ -0,0 +1,34 @@ +# Defines overrides for Haskell packages, for example to avoid +# breakage currently present in nixpkgs or to modify package versions. + +{ ... }: # This file needs nothing from readTree +{ pkgs }: # ... but is called with a separate package set in the overlay + +self: super: with pkgs.haskell.lib; rec { + generic-arbitrary = appendPatch + super.generic-arbitrary + [ ./patches/generic-arbitrary-export-garbitrary.patch ]; + + random = dontCheck (self.callHackageDirect { + pkg = "random"; + ver = "1.2.0"; + sha256 = "06s3mmqbsfwv09j2s45qnd66nrxfp9280gnl9ng8yh128pfr7bjh"; + } {}); + + # random <1.2 + test-framework = doJailbreak super.test-framework; + hashable = doJailbreak super.hashable; + test-framework-quickcheck2 = doJailbreak super.test-framework-quickcheck2; + + # can be removed if we have the following PR or equivalent + # https://github.com/NixOS/nixpkgs/pull/116931 + hedgehog-classes = overrideCabal super.hedgehog-classes (attrs: { + # remove version bound on semirings which is inside a + # conditional, so doJailbreak doesn't work + prePatch = '' + sed -i 's|semirings.*0.6|semirings|g' hedgehog-classes.cabal + ''; + }); + + hgeometry-combinatorial = dontCheck super.hgeometry-combinatorial; +} diff --git a/third_party/overlays/haskell/patches/generic-arbitrary-export-garbitrary.patch b/third_party/overlays/haskell/patches/generic-arbitrary-export-garbitrary.patch new file mode 100644 index 000000000000..f0c936bfca18 --- /dev/null +++ b/third_party/overlays/haskell/patches/generic-arbitrary-export-garbitrary.patch @@ -0,0 +1,12 @@ +diff --git a/src/Test/QuickCheck/Arbitrary/Generic.hs b/src/Test/QuickCheck/Arbitrary/Generic.hs +index fed6ab3..91f59f1 100644 +--- a/src/Test/QuickCheck/Arbitrary/Generic.hs ++++ b/src/Test/QuickCheck/Arbitrary/Generic.hs +@@ -23,6 +23,7 @@ The generated 'arbitrary' method is equivalent to + + module Test.QuickCheck.Arbitrary.Generic + ( Arbitrary(..) ++ , GArbitrary + , genericArbitrary + , genericShrink + ) where -- cgit 1.4.1