pkgs/haskell-modules: expose haddockDir as passthru variable
WIP If the `hoogle.nix` file wants to have any sane chance of finding haddock outputs, the packages need to export the haddock folders as an identifier. A few TODOs still stand, like passing self to the package instead of needing to pass it to `haddockDir`. Maybe the exported identifier should be integrated into the fixpoint somehow instead of using `passthru`?
This commit is contained in:
parent
3f27a36912
commit
e9e25ec5fe
@ -79,6 +79,9 @@ let
|
|||||||
then "package-db"
|
then "package-db"
|
||||||
else "package-conf";
|
else "package-conf";
|
||||||
|
|
||||||
|
# the target dir for haddock documentation
|
||||||
|
docdir = docoutput: docoutput + "/share/doc";
|
||||||
|
|
||||||
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
|
||||||
newCabalFile = fetchurl {
|
newCabalFile = fetchurl {
|
||||||
url = newCabalFileUrl;
|
url = newCabalFileUrl;
|
||||||
@ -112,7 +115,7 @@ let
|
|||||||
defaultConfigureFlags = [
|
defaultConfigureFlags = [
|
||||||
"--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
|
"--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
|
||||||
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
|
(optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
|
||||||
(optionalString enableSeparateDocOutput "--docdir=$doc/share/doc")
|
(optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
|
||||||
"--with-gcc=$CC" # Clang won't work without that extra information.
|
"--with-gcc=$CC" # Clang won't work without that extra information.
|
||||||
"--package-db=$packageConfDir"
|
"--package-db=$packageConfDir"
|
||||||
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
|
(optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
|
||||||
@ -332,7 +335,7 @@ stdenv.mkDerivation ({
|
|||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString enableSeparateDocOutput ''
|
${optionalString enableSeparateDocOutput ''
|
||||||
for x in $doc/share/doc/html/src/*.html; do
|
for x in ${docdir "$doc"}/html/src/*.html; do
|
||||||
remove-references-to -t $out $x
|
remove-references-to -t $out $x
|
||||||
done
|
done
|
||||||
mkdir -p $doc
|
mkdir -p $doc
|
||||||
@ -348,6 +351,14 @@ stdenv.mkDerivation ({
|
|||||||
|
|
||||||
isHaskellLibrary = hasActiveLibrary;
|
isHaskellLibrary = hasActiveLibrary;
|
||||||
|
|
||||||
|
# TODO: ask why the split outputs are configurable at all?
|
||||||
|
# TODO: include tests for split if possible
|
||||||
|
# Given the haskell package, returns
|
||||||
|
# the directory containing the haddock documentation.
|
||||||
|
# `null' if no haddock documentation was built.
|
||||||
|
# TODO: fetch the self from the fixpoint instead
|
||||||
|
haddockDir = self: if doHaddock then "${docdir self.doc}/html" else null;
|
||||||
|
|
||||||
env = stdenv.mkDerivation {
|
env = stdenv.mkDerivation {
|
||||||
name = "interactive-${pname}-${version}-environment";
|
name = "interactive-${pname}-${version}-environment";
|
||||||
nativeBuildInputs = [ ghcEnv systemBuildInputs ]
|
nativeBuildInputs = [ ghcEnv systemBuildInputs ]
|
||||||
@ -357,6 +368,7 @@ stdenv.mkDerivation ({
|
|||||||
shellHook = ''
|
shellHook = ''
|
||||||
export NIX_${ghcCommandCaps}="${ghcEnv}/bin/${ghcCommand}"
|
export NIX_${ghcCommandCaps}="${ghcEnv}/bin/${ghcCommand}"
|
||||||
export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg"
|
export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg"
|
||||||
|
# TODO: is this still valid?
|
||||||
export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html"
|
export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html"
|
||||||
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}${
|
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}${
|
||||||
makeLibraryPath (filter (x: !isNull x) systemBuildInputs)
|
makeLibraryPath (filter (x: !isNull x) systemBuildInputs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user