summaryrefslogtreecommitdiff
path: root/dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-07-23 02:48:52 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-07-23 02:48:52 +0100
commitfd70f5e3ed54d5e013c11a3f3e632e80838171d0 (patch)
treec6bf0dac8239e644ccc09b184e4eb9cca9701dcf /dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch
parent5deadca7219297a3c1f90eca00544a00e33efdbc (diff)
gentoo auto-resync : 23:07:2022 - 02:48:51
Diffstat (limited to 'dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch')
-rw-r--r--dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch b/dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch
new file mode 100644
index 000000000000..648b8f77cbc3
--- /dev/null
+++ b/dev-haskell/foldl/files/foldl-1.4.12-cabal-doctest.patch
@@ -0,0 +1,83 @@
+diff -urN foldl-1.4.12/Setup.hs foldl-1.4.12-r1/Setup.hs
+--- foldl-1.4.12/Setup.hs 2001-09-08 19:46:40.000000000 -0600
++++ foldl-1.4.12-r1/Setup.hs 2022-03-23 03:20:48.427151688 -0600
+@@ -1,2 +1,6 @@
+-import Distribution.Simple
+-main = defaultMain
++module Main (main) where
++
++import Distribution.Extra.Doctest ( defaultMainWithDoctests )
++
++main :: IO ()
++main = defaultMainWithDoctests "doctest"
+diff -urN foldl-1.4.12/foldl.cabal foldl-1.4.12-r1/foldl.cabal
+--- foldl-1.4.12/foldl.cabal 2022-03-23 03:17:07.317151581 -0600
++++ foldl-1.4.12-r1/foldl.cabal 2022-03-23 03:20:10.187151669 -0600
+@@ -2,7 +2,7 @@
+ Version: 1.4.12
+ x-revision: 2
+ Cabal-Version: >=1.10
+-Build-Type: Simple
++Build-Type: Custom
+ License: BSD3
+ License-File: LICENSE
+ Copyright: 2013 Gabriel Gonzalez
+@@ -22,6 +22,12 @@
+ Type: git
+ Location: https://github.com/Gabriel439/Haskell-Foldl-Library
+
++custom-setup
++ setup-depends:
++ base
++ , Cabal
++ , cabal-doctest
++
+ Library
+ HS-Source-Dirs: src
+ Build-Depends:
+@@ -83,6 +89,9 @@
+ Main-Is: doctest.hs
+ Build-Depends:
+ base,
+- doctest >= 0.16
++ doctest >= 0.16,
++ directory,
++ filepath,
++ base-compat
+ GHC-Options: -threaded
+ Default-Language: Haskell2010
+diff -urN foldl-1.4.12/test/doctest.hs foldl-1.4.12-r1/test/doctest.hs
+--- foldl-1.4.12/test/doctest.hs 2001-09-08 19:46:40.000000000 -0600
++++ foldl-1.4.12-r1/test/doctest.hs 2022-03-23 03:22:41.077151743 -0600
+@@ -1,4 +1,29 @@
+ import Test.DocTest
++import GHC.IO.Encoding (setLocaleEncoding)
++import System.Directory (getCurrentDirectory, makeAbsolute)
++import System.FilePath.Posix ((</>))
++import System.IO (utf8)
++import Build_doctests (pkgs)
++
++main = do
++ setLocaleEncoding utf8
++ pwd <- getCurrentDirectory
++ prefix <- makeAbsolute pwd
+
+-main :: IO ()
+-main = doctest ["-isrc", "src/Control/Foldl.hs", "src/Control/Scanl.hs"]
++ let customFlags =
++ [ "-package-env=-"
++ , "-hide-all-packages"
++ , "-no-user-package-db"
++ , "-package-db=" ++ prefix </> "dist/package.conf.inplace"
++ ]
++
++ let origFlags =
++ [ "-isrc"
++ ]
++
++ let modules =
++ [ "src/Control/Foldl.hs"
++ , "src/Control/Scanl.hs"
++ ]
++
++ doctest $ customFlags ++ pkgs ++ origFlags ++ modules