on iko/ghcjs-patch-master help sign in
Fix haddock when pkgconfig is needed to configure (#732)

Packages like haskell-gi need pkgconfig at configue time to generate source files we want to run haddock on. This change also brings back a `mkdir` for the $docs that is needed for haddock of bytesting-builder (it was removed when haddock the haddock derivation was split out).

commit47f0cded18280e6e242a4548cd4cce7942200acc authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateMon 29 Jun 2020, 14:46 (6 years ago) parent41164a7
2 files changed+11−1
builder/comp-builder.nix+1−1 builder/haddock-builder.nix+10
builder/comp-builder.nix+1−1
@@ -200,7 +200,7 @@ let
200200 inherit componentId component package flags commonConfigureFlags
201201 commonAttrs revision setupGhcOptions doHaddock
202202 doHoogle hyperlinkSource quickjump setupHaddockFlags
203− needsProfiling configFiles preHaddock postHaddock;
203+ needsProfiling configFiles preHaddock postHaddock pkgconfig;
204204
205205 componentDrv = drv;
206206 };
builder/haddock-builder.nix+10
@@ -8,6 +8,7 @@
88, commonAttrs
99, preHaddock
1010, postHaddock
11+, pkgconfig
1112, commonConfigureFlags
1213
1314, doHaddock
@@ -72,6 +73,11 @@ let
7273 outputs = ["out"]
7374 ++ lib.optional doHaddock' "doc";
7475
76+ propagatedBuildInputs = builtins.concatLists pkgconfig;
77+
78+ buildInputs = component.libs
79+ ++ map (d: d.components.library.haddock or d) component.depends;
80+
7581 nativeBuildInputs =
7682 [ shellWrappers buildPackages.removeReferencesTo ]
7783 ++ componentDrv.executableToolDepends;
@@ -89,6 +95,10 @@ let
8995 runHook preHaddock
9096 # If we don't have any source files, no need to run haddock
9197 [[ -n $(find . -name "*.hs" -o -name "*.lhs") ]] && {
98+ docdir="${docdir "$doc"}"
99+ # This mkdir needed for packages like bytestring-builder which
100+ # is empty when `bytestring >= 0.10.4`
101+ mkdir -p "$docdir"
92102
93103 $SETUP_HS haddock \
94104 "--html" \