diff --git a/crem.cabal b/crem.cabal index ba932c6..9b6a048 100644 --- a/crem.cabal +++ b/crem.cabal @@ -31,6 +31,11 @@ flag errors manual: True default: False +flag test-doctest + description: run doctests + manual: True + default: True + library exposed-modules: Crem.BaseMachine @@ -341,11 +346,14 @@ test-suite crem-doctests LambdaCase PackageImports ghc-options: -Weverything -Wno-safe -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists -Wno-missing-home-modules -Wno-missing-import-lists -Wno-all-missed-specialisations -Wno-prepositive-qualified-module -threaded -Wno-unused-packages - build-depends: - base >=4.15 && <4.19 - , crem - , crem-examples - , doctest-parallel >=0.2.3 && <0.4 + if !flag(test-doctest) + buildable: False + else + build-depends: + base >=4.15 && <4.19 + , crem + , crem-examples + , doctest-parallel >=0.2.3 && <0.4 default-language: Haskell2010 if impl(ghc >= 9.2) ghc-options: -Wno-missing-kind-signatures diff --git a/flake.nix b/flake.nix index 20a8eca..582c821 100644 --- a/flake.nix +++ b/flake.nix @@ -38,12 +38,12 @@ haskellPackages.override { overrides = self: super: { hpack = pkgs.hpack; - crem = (self.callCabal2nix "crem" src { }).overrideAttrs (attrs: { + crem = pkgs.haskell.lib.compose.disableCabalFlag "test-doctest" ((self.callCabal2nix "crem" src { }).overrideAttrs (attrs: { # doctest-parallel needs to know where the compiled crem package is preCheck = '' export GHC_PACKAGE_PATH="dist/package.conf.inplace:$GHC_PACKAGE_PATH" ''; - }); + })); fourmolu = pkgs.haskell.packages.ghc944.fourmolu; }; };