diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index a8f05d6f15c1..fd14501097c2 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -366,6 +366,10 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + # This is used by the haskell builder to query + # the presence of the haddock program. + hasHaddock = enableHaddockProgram; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 8a352d0e0a90..af01582b1081 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -335,6 +335,10 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + # This is used by the haskell builder to query + # the presence of the haddock program. + hasHaddock = enableHaddockProgram; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/9.0.2.nix b/pkgs/development/compilers/ghc/9.0.2.nix index f7624741b68b..04e29ed66861 100644 --- a/pkgs/development/compilers/ghc/9.0.2.nix +++ b/pkgs/development/compilers/ghc/9.0.2.nix @@ -331,6 +331,10 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + # This is used by the haskell builder to query + # the presence of the haddock program. + hasHaddock = enableHaddockProgram; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/9.2.2.nix b/pkgs/development/compilers/ghc/9.2.2.nix index 6db6eb3b0ebc..0a572bff7ef2 100644 --- a/pkgs/development/compilers/ghc/9.2.2.nix +++ b/pkgs/development/compilers/ghc/9.2.2.nix @@ -331,6 +331,10 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + # This is used by the haskell builder to query + # the presence of the haddock program. + hasHaddock = enableHaddockProgram; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 1c4bf3059d55..07ea6bda2458 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -347,6 +347,10 @@ stdenv.mkDerivation (rec { inherit llvmPackages; inherit enableShared; + # This is used by the haskell builder to query + # the presence of the haddock program. + hasHaddock = enableHaddockProgram; + # Our Cabal compiler name haskellCompilerName = "ghc-${version}"; }; diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index d8137038f63c..04973d3251e6 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -55,7 +55,7 @@ in , changelog ? null , mainProgram ? null , doCoverage ? false -, doHaddock ? !(ghc.isHaLVM or false) +, doHaddock ? !(ghc.isHaLVM or false) && (ghc.hasHaddock or true) , doHaddockInterfaces ? doHaddock && lib.versionAtLeast ghc.version "9.0.1" , passthru ? {} , pkg-configDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [], benchmarkPkgconfigDepends ? []