Skip to content

Commit

Permalink
Port to Cabal 3.14 API
Browse files Browse the repository at this point in the history
  • Loading branch information
clinty committed Nov 10, 2024
1 parent 554b102 commit 8bbd09a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Debian/Debianize/InputCabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ import Distribution.Simple.PackageDescription (readGenericPackageDescription)
import Distribution.PackageDescription.Parsec (readGenericPackageDescription)
#endif
import Distribution.Types.ComponentRequestedSpec (ComponentRequestedSpec(ComponentRequestedSpec))
#if MIN_VERSION_Cabal(3,14,0)
import Distribution.Simple.Utils (defaultPackageDescCwd, die', setupMessage)
#else
import Distribution.Simple.Utils (defaultPackageDesc, die', setupMessage)
#endif
import Distribution.System as Cabal (buildArch, Platform(..))
import qualified Distribution.System as Cabal (buildOS)
#if MIN_VERSION_Cabal(3,2,0)
Expand Down Expand Up @@ -54,7 +58,11 @@ inputCabalization flags =
-- Load a GenericPackageDescription from the current directory
-- and from that create a finalized PackageDescription for the
-- given CompilerId.
#if MIN_VERSION_Cabal(3,14,0)
genPkgDesc <- liftIO $ defaultPackageDescCwd vb >>= readGenericPackageDescription vb
#else
genPkgDesc <- liftIO $ defaultPackageDesc vb >>= readGenericPackageDescription vb
#endif
let finalized = finalizePD (mkFlagAssignment (toList fs)) (ComponentRequestedSpec True False) (const True) (Platform buildArch Cabal.buildOS) cinfo [] genPkgDesc
ePkgDesc <- either (return . Left)
(\ (pkgDesc, _) -> do liftIO $ bracket (setFileCreationMask 0o022) setFileCreationMask $ \ _ -> autoreconf vb pkgDesc
Expand Down

0 comments on commit 8bbd09a

Please sign in to comment.