65 lines
2.2 KiB
Diff
65 lines
2.2 KiB
Diff
From e930c5d0b1d9291f55a4f86d9bcdf51fcdb2cde3 Mon Sep 17 00:00:00 2001
|
|
From: Jan Tojnar <jtojnar@gmail.com>
|
|
Date: Thu, 14 Mar 2019 12:49:07 +0100
|
|
Subject: [PATCH] Fix build with cabal-2.4
|
|
|
|
https://github.com/haskell-hvr/hgettext/issues/15
|
|
---
|
|
src/Distribution/Simple/I18N/GetText.hs | 4 ++--
|
|
src/Internal.hs | 15 ++++++++++++++-
|
|
2 files changed, 16 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/Distribution/Simple/I18N/GetText.hs b/src/Distribution/Simple/I18N/GetText.hs
|
|
index f2bc7c8..7f9f8a5 100644
|
|
--- a/src/Distribution/Simple/I18N/GetText.hs
|
|
+++ b/src/Distribution/Simple/I18N/GetText.hs
|
|
@@ -78,7 +78,7 @@ import Distribution.Simple
|
|
import Distribution.Simple.InstallDirs as I
|
|
import Distribution.Simple.LocalBuildInfo
|
|
import Distribution.Simple.Setup
|
|
-import Distribution.Simple.Utils
|
|
+import Distribution.Simple.Utils (warn)
|
|
import Distribution.Verbosity
|
|
|
|
import Control.Arrow (second)
|
|
@@ -90,7 +90,7 @@ import System.Exit
|
|
import System.FilePath
|
|
import System.Process
|
|
|
|
-import Internal
|
|
+import Internal (fromPackageName, matchFileGlob)
|
|
|
|
-- | Default main function, same as
|
|
--
|
|
diff --git a/src/Internal.hs b/src/Internal.hs
|
|
index 69d3ea2..f1eb255 100644
|
|
--- a/src/Internal.hs
|
|
+++ b/src/Internal.hs
|
|
@@ -1,8 +1,14 @@
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
-module Internal where
|
|
+module Internal (fromPackageName, matchFileGlob) where
|
|
|
|
import Distribution.Simple
|
|
+#if MIN_VERSION_Cabal(2,4,0)
|
|
+import Distribution.Simple.Glob (matchDirFileGlob)
|
|
+import Distribution.Verbosity (silent)
|
|
+#else
|
|
+import Distribution.Simple.Utils (matchFileGlob)
|
|
+#endif
|
|
|
|
fromPackageName :: PackageName -> String
|
|
#if MIN_VERSION_Cabal(2,0,0)
|
|
@@ -10,3 +16,10 @@ fromPackageName = unPackageName
|
|
#else
|
|
fromPackageName (PackageName s) = s
|
|
#endif
|
|
+
|
|
+#if MIN_VERSION_Cabal(2,4,0)
|
|
+-- | Newer versions of Cabal have removed this function in favour of more configurable implementation
|
|
+-- We assume Cabal 2.0
|
|
+matchFileGlob :: FilePath -> IO [FilePath]
|
|
+matchFileGlob = matchDirFileGlob silent (mkVersion [2, 0]) "."
|
|
+#endif
|