From 10fd12d8ab2070da29791d0c57b085b5761b3b11 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Oct 30 2019 02:51:31 +0000 Subject: upstream patch that disables hgettext completely and fixes build --- diff --git a/89a488ae0cab406469d061dd36078e7d1815da75.patch b/89a488ae0cab406469d061dd36078e7d1815da75.patch new file mode 100644 index 0000000..2d68a2c --- /dev/null +++ b/89a488ae0cab406469d061dd36078e7d1815da75.patch @@ -0,0 +1,126 @@ +From aae6843f51f54679d440fb3813e61355dc8406b9 Mon Sep 17 00:00:00 2001 +From: Jan Tojnar +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 +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 +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 + diff --git a/bustle.spec b/bustle.spec index e29c8db..b99d3c6 100644 --- a/bustle.spec +++ b/bustle.spec @@ -13,6 +13,8 @@ Url: https://hackage.haskell.org/package/%{name} # Begin cabal-rpm sources: Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz # End cabal-rpm sources +# https://gitlab.freedesktop.org/bustle/bustle/merge_requests/14 +Patch0: https://gitlab.freedesktop.org/bustle/bustle/commit/89a488ae0cab406469d061dd36078e7d1815da75.patch Requires: gnome-icon-theme BuildRequires: desktop-file-utils @@ -61,7 +63,7 @@ frequencies and average method call times. # Begin cabal-rpm setup: %setup -q # End cabal-rpm setup -cabal-tweak-flag hgettext False +%patch0 -p1 -b .orig %build