mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
Signed-off-by: hololeap <hololeap@protonmail.com> Signed-off-by: Mark Wright <gienah@gentoo.org>
109 lines
2.6 KiB
Diff
109 lines
2.6 KiB
Diff
From 871c4ee1064f829c6a0473b5ad28aa7b9dc2e6a3 Mon Sep 17 00:00:00 2001
|
|
From: hololeap <hololeap@protonmail.com>
|
|
Date: Mon, 19 Jan 2026 22:01:51 -0700
|
|
Subject: [PATCH 1/1] Migrate to cabal-doctest
|
|
|
|
doctest pulls in the out-of-scope packages if they are installed on the
|
|
system. The best current workaround is to migrate to cabal-doctest.
|
|
|
|
Bug: https://bugs.gentoo.org/916851
|
|
Signed-off-by: hololeap <hololeap@protonmail.com>
|
|
--- a/Setup.hs
|
|
+++ b/Setup.hs
|
|
@@ -1,2 +1,23 @@
|
|
+{-# LANGUAGE CPP #-}
|
|
+
|
|
+module Main (main) where
|
|
+
|
|
+#ifndef MIN_VERSION_cabal_doctest
|
|
+#define MIN_VERSION_cabal_doctest(x,y,z) 0
|
|
+#endif
|
|
+
|
|
+#if MIN_VERSION_cabal_doctest(1,0,0)
|
|
+
|
|
+import Distribution.Extra.Doctest ( defaultMainWithDoctests )
|
|
+
|
|
+main :: IO ()
|
|
+main = defaultMainWithDoctests "doctest"
|
|
+
|
|
+#else
|
|
+
|
|
import Distribution.Simple
|
|
+
|
|
+main :: IO ()
|
|
main = defaultMain
|
|
+
|
|
+#endif
|
|
--- a/foldl.cabal
|
|
+++ b/foldl.cabal
|
|
@@ -2,7 +2,7 @@ Name: foldl
|
|
Version: 1.4.18
|
|
x-revision: 2
|
|
Cabal-Version: >=1.10
|
|
-Build-Type: Simple
|
|
+Build-Type: Custom
|
|
License: BSD3
|
|
License-File: LICENSE
|
|
Copyright: 2013 Gabriella Gonzalez
|
|
@@ -22,6 +22,12 @@ Source-Repository head
|
|
Type: git
|
|
Location: https://github.com/Gabriella439/Haskell-Foldl-Library
|
|
|
|
+custom-setup
|
|
+ setup-depends:
|
|
+ base
|
|
+ , Cabal
|
|
+ , cabal-doctest >= 1.0.0
|
|
+
|
|
Library
|
|
HS-Source-Dirs: src
|
|
Build-Depends:
|
|
@@ -85,6 +91,9 @@ Test-Suite doctest
|
|
Main-Is: doctest.hs
|
|
Build-Depends:
|
|
base >= 4.11.0.0 && < 5,
|
|
- doctest >= 0.16
|
|
+ doctest >= 0.16,
|
|
+ directory,
|
|
+ filepath,
|
|
+ base-compat
|
|
GHC-Options: -threaded
|
|
Default-Language: Haskell2010
|
|
--- a/test/doctest.hs
|
|
+++ b/test/doctest.hs
|
|
@@ -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/NonEmpty.hs", "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
|
|
--
|
|
2.52.0
|
|
|