--- /dev/null
+--- a/src/OptionalConfiguration.hs
++++ b/src/OptionalConfiguration.hs
+@@ -27,3 +27,3 @@ import System.FilePath ( (</>) )
+ import System.IO.Error ( catchIOError )
+-
++import qualified Data.Semigroup as S
+
+@@ -65,2 +65,16 @@ merge_maybes (Just _) (Just y) = Just y
+ --
++
++instance S.Semigroup OptionalConfiguration where
++ -- | Combine @cfg1@ and @cfg2@, giving precedence to @cfg2@.
++ cfg1 <> cfg2 =
++ OptionalConfiguration
++ (merge_maybes (database cfg1) (database cfg2))
++ (merge_maybes (detail cfg1) (detail cfg2))
++ (merge_maybes (detail_query cfg1) (detail_query cfg2))
++ (merge_maybes (host cfg1) (host cfg2))
++ (merge_maybes (password cfg1) (password cfg2))
++ (merge_maybes (port cfg1) (port cfg2))
++ (merge_maybes (summary_query cfg1) (summary_query cfg2))
++ (merge_maybes (username cfg1) (username cfg2))
++
+ instance Monoid OptionalConfiguration where
--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# ebuild generated by hackport 0.4.2
+
+CABAL_FEATURES="bin test-suite"
+inherit haskell-cabal
+
+DESCRIPTION="Count mailboxes in a SQL database"
+HOMEPAGE="http://hackage.haskell.org/package/mailbox-count"
+SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RESTRICT=test # Could not find module ‘Paths_mailbox_count’
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ >=dev-haskell/cabal-1.16.0
+ >=dev-haskell/cmdargs-0.10
+ >=dev-haskell/configurator-0.2
+ >=dev-haskell/hdbc-2.4
+ >=dev-haskell/hdbc-postgresql-2.3
+ >=dev-haskell/hdbc-sqlite3-2.3
+ >=dev-haskell/missingh-1.2
+ >=dev-haskell/tasty-0.8
+ >=dev-haskell/tasty-hunit-0.8
+ >=dev-lang/ghc-7.6.1
+ test? ( >=dev-haskell/doctest-0.9
+ >=dev-haskell/filemanip-0.3.6 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-ghc84.patch
+)