Fix build with Cabal<2

This commit is contained in:
Julian Ospald 2018-05-19 14:04:27 +02:00
parent 1953b152b4
commit 0ce029de57
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -16,6 +16,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
--} --}
{-# LANGUAGE CPP #-}
{-# OPTIONS_HADDOCK ignore-exports #-} {-# OPTIONS_HADDOCK ignore-exports #-}
module HSFM.GUI.Gtk.Dialogs where module HSFM.GUI.Gtk.Dialogs where
@ -54,10 +55,17 @@ import Distribution.Package
, packageVersion , packageVersion
, unPackageName , unPackageName
) )
#if MIN_VERSION_Cabal(2,0,0)
import Distribution.Version import Distribution.Version
( (
showVersion showVersion
) )
#else
import Data.Version
(
showVersion
)
#endif
import Distribution.PackageDescription import Distribution.PackageDescription
( (
GenericPackageDescription(..) GenericPackageDescription(..)
@ -65,7 +73,11 @@ import Distribution.PackageDescription
) )
import Distribution.PackageDescription.Parse import Distribution.PackageDescription.Parse
( (
#if MIN_VERSION_Cabal(2,0,0)
readGenericPackageDescription, readGenericPackageDescription,
#else
readPackageDescription,
#endif
) )
import Distribution.Verbosity import Distribution.Verbosity
( (
@ -192,7 +204,11 @@ showAboutDialog = do
lstr <- Prelude.readFile =<< getDataFileName "LICENSE" lstr <- Prelude.readFile =<< getDataFileName "LICENSE"
hsfmicon <- pixbufNewFromFile =<< getDataFileName "data/Gtk/icons/hsfm.png" hsfmicon <- pixbufNewFromFile =<< getDataFileName "data/Gtk/icons/hsfm.png"
pdesc <- fmap packageDescription pdesc <- fmap packageDescription
#if MIN_VERSION_Cabal(2,0,0)
(readGenericPackageDescription silent (readGenericPackageDescription silent
#else
(readPackageDescription silent
#endif
=<< getDataFileName "hsfm.cabal") =<< getDataFileName "hsfm.cabal")
set ad set ad
[ aboutDialogProgramName := (unPackageName . pkgName . package) pdesc [ aboutDialogProgramName := (unPackageName . pkgName . package) pdesc