Blob Blame History Raw
From aae6843f51f54679d440fb3813e61355dc8406b9 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Fri, 18 Oct 2019 01:33:19 +0200
Subject: [PATCH 1/3] =?UTF-8?q?Setup.hs:=20Don=E2=80=99t=20import=20Gettex?=
 =?UTF-8?q?t.hs=20without=20hgettext?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Gettext.hs is broken with Cabal ≥ 2.4 so until we fix it, I made importing it
conditional on the value of `hgettext` flag, so that the builds still work.
---
 Setup.hs | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Setup.hs b/Setup.hs
index dd86bba..50e7b54 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,4 +1,8 @@
+{-# LANGUAGE CPP #-}
 {-# OPTIONS_GHC -Wall #-}
+
+#if defined(VERSION_hgettext)
+
 import System.FilePath ( (</>), (<.>) )
 
 import Distribution.PackageDescription
@@ -92,3 +96,12 @@ generateModule pkg lbi =
     tar = GetText.targetDataDir lbi
 
 -- Cargo-culted from hgettext
+
+#else
+
+import Distribution.Simple
+
+main :: IO ()
+main = defaultMain
+
+#endif
-- 
2.22.0


From ee4b81cbc232d47ba9940f1987777b17452e71ff Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Fri, 18 Oct 2019 01:46:19 +0200
Subject: [PATCH 2/3] UI: Fix build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Bustle/UI.hs:490:3: error:
    • No instance for (Control.Monad.Fail.MonadFail
                         (Bustle BConfig BState))
        arising from a do statement
        with the failable pattern ‘[openItem, openTwoItem]’
    • In a stmt of a 'do' block:
        [openItem, openTwoItem] <- mapM
                                     (getW castToMenuItem) ["open", "openTwo"]
      In the expression:
        do builder <- io builderNew
           io
             $ builderAddFromFile builder =<< getDataFileName "data/bustle.ui"
           let getW cast name = io $ builderGetObject builder cast name
           window <- getW castToWindow "diagramWindow"
           ....
      In an equation for ‘emptyWindow’:
          emptyWindow
            = do builder <- io builderNew
                 io
                   $ builderAddFromFile builder =<< getDataFileName "data/bustle.ui"
                 let getW cast name = ...
                 ....
    |
490 |   [openItem, openTwoItem] <- mapM (getW castToMenuItem) ["open", "openTwo"]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---
 Bustle/UI.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Bustle/UI.hs b/Bustle/UI.hs
index 28ede19..6666c72 100644
--- a/Bustle/UI.hs
+++ b/Bustle/UI.hs
@@ -487,7 +487,8 @@ emptyWindow = do
   subtitle <- getW castToLabel "headerSubtitle"
   spinner  <- getW castToSpinner "headerSpinner"
 
-  [openItem, openTwoItem] <- mapM (getW castToMenuItem) ["open", "openTwo"]
+  openItem <- getW castToMenuItem "open"
+  openTwoItem <- getW castToMenuItem "openTwo"
   recordSessionItem <- getW castToMenuItem "recordSession"
   recordSystemItem <- getW castToMenuItem "recordSystem"
   recordAddressItem <- getW castToMenuItem "recordAddress"
-- 
2.22.0


From 6781afab661a95a1f210e91360e81d4f43d1e819 Mon Sep 17 00:00:00 2001
From: Jan Tojnar <jtojnar@gmail.com>
Date: Fri, 18 Oct 2019 01:49:28 +0200
Subject: [PATCH 3/3] cabal: Disable hgettext by default

It is broken and there are no translations anyway.
---
 bustle.cabal | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bustle.cabal b/bustle.cabal
index a2ebf77..e791803 100644
--- a/bustle.cabal
+++ b/bustle.cabal
@@ -69,7 +69,7 @@ Source-Repository head
 
 Flag hgettext
   Description:    Enable translations. Since there are no translations this is currently rather pointless.
-  Default:        True
+  Default:        False
 
 Flag InteractiveTests
   Description:    Build interactive test programs
-- 
2.22.0