@@ -0,0 +1,92 @@
9+ pkgSet = haskell.mkPkgSet {
13+ # plan-to-nix dist-newstyle/cache/plan.json > plan.nix
14+ # cabal-to-nix test-haddock.cabal > test-haddock.nix
15+ pkg-def = import ./plan.nix;
17+ { test-haddock = ./test-haddock.nix; }
20+ # overrides to fix the build
22+ packages.transformers-compat.components.library.doExactConfig = true;
26+ # Add a hook to the haddock phase
27+ packages.test-haddock.postHaddock = ''
29+ echo "This is the postHaddock hook. The files are:"
34+ # Check that the package option works
35+ packages.stm.doHaddock = false;
40+ packages = pkgSet.config.hsPkgs;
43+ stdenv.mkDerivation {
44+ name = "builder-haddock-test";
47+ inherit (packages.test-haddock.components) library;
48+ noDocLibrary = packages.stm.components.library;
50+ ########################################################################
53+ doc="${toString library.doc}"
54+ docDir="${toString library.haddockDir}"
56+ # exeDoc="$ disabled {toString packages.test-haddock.components.exes.test-haddock.doc}"
57+ # printf "checking that executable output does not have docs ... " >& 2
59+ # test "$exeDoc" = ""
61+ printf "checking that documentation directory was built... " >& 2
65+ printf "checking that documentation was generated... " >& 2
66+ grep hello "$docDir/TestHaddock.html" > /dev/null
69+ printf "checking for hoogle index of package... " >& 2
70+ grep hello "$docDir/test-haddock.txt" > /dev/null
73+ printf "checking for absence of documentation in another package... " >& 2
74+ if [ -d "${toString noDocLibrary.haddockDir}" ]; then
75+ echo "it exists - FAIL" >& 2
80+ printf "checking for absence of library package store paths in docs... " >& 2
81+ if grep -R ${library} "$docDir" > /dev/null; then
82+ echo "Found ${library} - FAIL" >& 2
91+ meta.platforms = platforms.all;
92+} // { inherit packages pkgSet; }