packages feed

ghc-compat-plugin-0.0.2.0: ghc-compat-plugin.cabal

cabal-version: 1.12
-- ^ 1.12 is the version included with GHC 7.2.1, the oldest version that
--   supports plugins.
--
-- https://cabal.readthedocs.io/en/stable/file-format-changelog.html

name: ghc-compat-plugin
version: 0.0.2.0
synopsis: Eases support for multiple GHC versions
description: Controls various GHC options and extensions to make compilation
             across multiple versions easier, and to alert you to
             incompatibilities.
maintainer: Greg Pfeil <greg@technomadic.org>
author: Greg Pfeil <greg@technomadic.org>
copyright: 2026 Greg Pfeil
-- GHC before 8.8.1 (and Cabal before 3.0) can’t deal with the
-- `Universal-FOSS-exception-1.0` SPDX license exception. Since it only makes
-- the license more lax, we just omit it from this field.
license: AGPL-3
license-file: LICENSE.AGPL-3.0-only
category: Compatibility, Compiler Plugins
build-type: Simple
extra-source-files:
  CHANGELOG.md
  README.md
  docs/*.md
tested-with:
  GHC ==7.10.3
  || ==8.0.2
  || ==8.2.2
  || ==8.4.1
  || ==8.6.1
  || ==8.8.1
  || ==8.10.1
  || ==9.0.1
  || ==9.2.1
  || ==9.4.1 || ==9.4.8
  || ==9.6.1 || ==9.6.7
  || ==9.8.1 || ==9.8.4
  || ==9.10.1 || ==9.10.2 || ==9.10.3
  || ==9.12.1 || ==9.12.2
  || ==9.14.1

homepage: https://github.com/sellout/ghc-compat-plugin#readme
bug-reports: https://github.com/sellout/ghc-compat-plugin/issues

source-repository head
  type: git
  location: https://github.com/sellout/ghc-compat-plugin.git
  subdir: core

source-repository this
  type: git
  location: https://github.com/sellout/ghc-compat-plugin.git
  subdir: core
  -- NB: This is the repo version, which is distinct from the package version.
  tag: v0.2.0

flag noisy-deprecations
  description:
    Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms
    and types. Consenquently, you can get spurious warnings when there’s a name
    collision and the name in the other namespace is deprecated. Or you can
    choose to not get those warnings, at the risk of not being warned when
    there’s a name collision and the namespace you’re referencing is the one
    that’s deprecated.
  default: True
  -- Because disabling this flag won’t help the solver.
  manual: True

library
  default-language: Haskell98
  build-depends:
    ghc >=7.2.1 && <9.16
  default-extensions:
    -- 6.8.1
    NoImplicitPrelude
    -- 6.10.1
    NamedFieldPuns
    PackageImports
  exposed-modules:
    GhcCompat
  -- blockers for supporting GHC <7.10:
  -- - use of `MIN_VERSION_GLASGOW_HASKELL`
  if impl(ghc >= 7.10.1)
    build-depends:
      base >=4.8.0 && <4.23
    if impl(ghc >= 8.0.1)
      build-depends:
        ghc-boot-th >=8.0.1 && <9.16
    hs-source-dirs:
      supported
    other-modules:
      GhcCompat.GhcRelease
      GhcCompat.Opts
  else
    hs-source-dirs:
      unsupported
  if impl(ghc >= 8.0.1)
    ghc-options:
      -Weverything
      -- This one just reports unfixable things, AFAICT.
      -Wno-all-missed-specialisations
      -- Type inference good.
      -Wno-missing-local-signatures
      -- Warns even when `Unsafe` is explicit, not inferred. See
      -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689
      -Wno-unsafe
    if impl(ghc < 8.8.1)
      ghc-options:
        -- This used to warn even when `Safe` was explicit.
        -Wno-safe
  else
    ghc-options:
      -Wall
  if flag(noisy-deprecations)
    cpp-options:
      -DSELLOUT_NOISY_DEPRECATIONS
  -- THIS PLUGIN WILL INFORM YOU AS TO WHETHER YOU NEED THE FOLLOWING
  -- CONDITIONALS IN YOUR OWN CABAL FILES.
  if impl(ghc >= 7.10.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 7.8.1+
      -fno-warn-deriving-typeable
  if impl(ghc >= 8.6.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 8.6.1+
      -Wno-star-is-type
  if impl(ghc >= 8.8.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 8.2.1+
      -Wno-missing-deriving-strategies
  -- THIS PLUGIN ELIMINATES THE NEED FOR THE FOLLOWING CONDITIONALS IN YOUR OWN
  -- CABAL FILES.
  if impl(ghc >= 8.10.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 8.10.1+
      -Wno-prepositive-qualified-module
  if impl(ghc >= 9.2.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 6.8.1+
      -Wno-missing-kind-signatures
  if impl(ghc >= 9.8.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 7.4.1+
      -Wno-missing-poly-kind-signatures
      -- remove if the oldest supported version is GHC 7.8.1+
      -Wno-missing-role-annotations
  if impl(ghc >= 9.14.1)
    ghc-options:
      -- remove if the oldest supported version is GHC 9.14.1+
      -Wno-pattern-namespace-specifier