diff --git a/Graphics/Rendering/Pango/Types.chs b/Graphics/Rendering/Pango/Types.chs
--- a/Graphics/Rendering/Pango/Types.chs
+++ b/Graphics/Rendering/Pango/Types.chs
@@ -68,11 +68,13 @@
   ) where
 
 import Foreign.ForeignPtr (ForeignPtr, castForeignPtr)
-#if __GLASGOW_HASKELL__ >= 707
+-- TODO work around cpphs https://ghc.haskell.org/trac/ghc/ticket/13553
+#if __GLASGOW_HASKELL__ >= 707 || __GLASGOW_HASKELL__ == 0
 import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
 #else
 import Foreign.ForeignPtr (unsafeForeignPtrToPtr)
 #endif
+
 import Foreign.C.Types    (CULong(..), CUInt(..), CULLong(..))
 import System.Glib.GType  (GType, typeInstanceIsA)
 {#import System.Glib.GObject#}
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP, ViewPatterns #-}
 -- Adjustments specific to this package,
 -- all Gtk2Hs-specific boilerplate is kept in
 -- gtk2hs-buildtools:Gtk2HsSetup
@@ -14,13 +15,18 @@
 import Distribution.Simple.Utils
 import System.FilePath
 
+#if MIN_VERSION_Cabal(2,0,0)
+import Distribution.Version ( versionNumbers )
+import Distribution.Types.PackageName ( unPackageName )
+#endif
+
 main =
   defaultMainWithHooks gtk2hsUserHooks {
 
     postConf = \args cf pd lbi -> do
       let verb = (fromFlag (configVerbosity cf))
       cPkgs <- getPkgConfigPackages verb lbi pd
-      let [pangoVersion] = [ v | PackageIdentifier (PackageName "pango") v <- cPkgs ]
+      let [pangoVersion] = [ v | PackageIdentifier (unPackageName -> "pango") v <- cPkgs ]
       writePangoVersionHeaderFile verb lbi pangoVersion
       postConf gtk2hsUserHooks args cf pd lbi
   }
@@ -30,7 +36,11 @@
 ------------------------------------------------------------------------------
 
 writePangoVersionHeaderFile :: Verbosity -> LocalBuildInfo -> Version -> IO ()
+#if MIN_VERSION_Cabal(2,0,0)
+writePangoVersionHeaderFile verbosity lbi (versionNumbers -> (major:minor:micro:_)) = do
+#else
 writePangoVersionHeaderFile verbosity lbi (Version (major:minor:micro:_) []) = do
+#endif
   createDirectoryIfMissingVerbose verbosity True targetDir
   rewriteFile targetFile $ unlines
     [ "#define PANGO_VERSION_MAJOR " ++ show major
diff --git a/pango.cabal b/pango.cabal
--- a/pango.cabal
+++ b/pango.cabal
@@ -1,5 +1,5 @@
 Name:           pango
-Version:        0.13.3.1
+Version:        0.13.4.0
 License:        LGPL-2.1
 License-file:   COPYING
 Copyright:      (c) 2001-2010 The Gtk2Hs Team
@@ -40,7 +40,7 @@
 
 custom-setup
   setup-depends: base >= 4.6,
-                 Cabal >= 1.24 && < 1.25,
+                 Cabal >= 1.24 && < 2.1,
                  filepath >= 1.3 && < 1.5,
                  gtk2hs-buildtools >= 0.13.2.0 && < 0.14
 
@@ -79,14 +79,14 @@
         includes:       hspango.h
         include-dirs:   .
         cpp-options:    -U__BLOCKS__
-        if os(darwin)
+        if os(darwin) || os(freebsd)
           cpp-options: -D__attribute__(A)= -D_Nullable= -D_Nonnull=
         if os(windows)
           cpp-options: -D__USE_MINGW_ANSI_STDIO=1
         -- Pango 1.26 has a mysterious bug that makes it go into an infinite
         -- loop. Don't allow the user to build against this version. (Omit the
         -- >= 1.0 constraint in this case since Cabal 1.6 can't parse it.)
-        if os(darwin)
+        if os(darwin) || os(freebsd)
           pkgconfig-depends: pango < 1.26.0 || > 1.26.2
         else
           pkgconfig-depends: pango >= 1.0
