diff options
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/haskell-xyz.scm | 1 | ||||
-rw-r--r-- | gnu/packages/patches/ghc-diff-swap-cover-args.patch | 20 |
3 files changed, 22 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 47618993bf..a9548d4bd6 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -878,6 +878,7 @@ dist_patch_DATA = \ %D%/packages/patches/gd-freetype-test-failure.patch \ %D%/packages/patches/geoclue-config.patch \ %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ + %D%/packages/patches/ghc-diff-swap-cover-args.patch \ %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch \ %D%/packages/patches/ghc-haddock-library-unbundle.patch \ %D%/packages/patches/ghostscript-no-header-id.patch \ diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm index c8fbec048d..86e0d2a60e 100644 --- a/gnu/packages/haskell-xyz.scm +++ b/gnu/packages/haskell-xyz.scm @@ -2606,6 +2606,7 @@ and parsers with useful semantics.") (method url-fetch) (uri (string-append "https://hackage.haskell.org/package/" "Diff/Diff-" version ".tar.gz")) + (patches (search-patches "ghc-diff-swap-cover-args.patch")) (sha256 (base32 "0bqcdvhxx8dmqc3793m6axg813wv9ldz2j37f1wygbbrbbndmdvp")))) diff --git a/gnu/packages/patches/ghc-diff-swap-cover-args.patch b/gnu/packages/patches/ghc-diff-swap-cover-args.patch new file mode 100644 index 0000000000..724416ff7a --- /dev/null +++ b/gnu/packages/patches/ghc-diff-swap-cover-args.patch @@ -0,0 +1,20 @@ +The QuickCheck library swapped the order of the arguments of the 'cover' +function in version 2.12. Version 0.3.4 of the Diff library still uses +the old argument order. Swapping the argument order makes Diff work +with newer versions of QuickCheck. + +See <https://github.com/commercialhaskell/stackage/issues/4289> for the +upstream bug report. + +diff -ruN a/test/Test.hs b/test/Test.hs +--- a/test/Test.hs 2016-04-23 01:21:45.000000000 -0400 ++++ b/test/Test.hs 2019-11-01 19:13:04.590770903 -0400 +@@ -134,7 +134,7 @@ + prop_ppDiffR (DiffInput le ri) = + let haskDiff=ppDiff $ getGroupedDiff le ri + utilDiff= unsafePerformIO (runDiff (unlines le) (unlines ri)) +- in cover (haskDiff == utilDiff) 90 "exact match" $ ++ in cover 90 (haskDiff == utilDiff) "exact match" $ + classify (haskDiff == utilDiff) "exact match" + (div ((length haskDiff)*100) (length utilDiff) < 110) -- less than 10% bigger + where |