Skip to content

Commit

Permalink
Allow base-4.21 and Cabal 3.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
minoki committed Nov 27, 2024
1 parent cf756bf commit 7a48f23
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fp-ieee/fp-ieee.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ common deps
-- We use a post-GHC 8.6 language extension: NumericUnderscores
-- cast{Word32,Word64}To{Float,Double}, cast{Float,Double}To{Word32,Word64} are since base-4.10.0.0 (GHC 8.2)
-- Semigroup((<>)) is exported from Prelude since base-4.11.0.0 (GHC 8.4)
base >=4.12 && <4.21
base >=4.12 && <4.22
if !flag(pure-hs)
cpp-options: -DUSE_FFI
if !flag(pure-hs) && os(windows)
Expand Down
8 changes: 8 additions & 0 deletions rounded-hw/Setup.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
import Distribution.Simple
import Distribution.Simple.Configure (configure)
import Distribution.Simple.PackageIndex (allPackages)
Expand All @@ -6,6 +7,9 @@ import qualified Distribution.Types.InstalledPackageInfo as InstalledPackageInfo
import Distribution.Types.Library (Library (libBuildInfo))
import Distribution.Types.LocalBuildInfo (LocalBuildInfo (installedPkgs, localPkgDescr))
import Distribution.Types.PackageDescription (PackageDescription (library))
#if MIN_VERSION_Cabal(3, 14, 0)
import Distribution.Utils.Path (makeSymbolicPath)
#endif

{-
We want to access "ghcconfig.h" from assembly source file (.S),
Expand All @@ -21,7 +25,11 @@ main = defaultMainWithHooks simpleUserHooks { confHook = myConfHook }
let extraIncludeDirs :: [String]
extraIncludeDirs = concatMap InstalledPackageInfo.includeDirs (allPackages $ installedPkgs localBuildInfo)
updateBuildInfo :: BuildInfo -> BuildInfo
#if MIN_VERSION_Cabal(3, 14, 0)
updateBuildInfo bi = bi { includeDirs = includeDirs bi ++ map makeSymbolicPath extraIncludeDirs }
#else
updateBuildInfo bi = bi { includeDirs = includeDirs bi ++ extraIncludeDirs }
#endif
updateLibrary :: Library -> Library
updateLibrary lib = lib { libBuildInfo = updateBuildInfo (libBuildInfo lib) }
updatePkgDescr :: PackageDescription -> PackageDescription
Expand Down
6 changes: 3 additions & 3 deletions rounded-hw/rounded-hw.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ source-repository head
-- Custom setup is required to allow assembly sources to #include "ghcconfig.h"
custom-setup
setup-depends:
Cabal >=3.0 && <3.15
, base >=4.12 && <4.21
Cabal >=3.0 && <3.17
, base >=4.12 && <4.22

flag pure-hs
description: Disable FFI
Expand Down Expand Up @@ -68,7 +68,7 @@ flag float128
common deps
build-depends:
array >=0.5.2.0 && <0.6
, base >=4.12 && <4.21
, base >=4.12 && <4.22
, deepseq >=1.4.4.0 && <1.6
, fp-ieee ==0.1.*
, primitive >=0.6.1.1 && <0.10
Expand Down

0 comments on commit 7a48f23

Please sign in to comment.