forked from mirrors/nixpkgs
haskell: Add documentationTarball to lib
This commit is contained in:
parent
bbb5016daa
commit
7673eda11d
|
@ -235,6 +235,31 @@ rec {
|
|||
fixupPhase = ":";
|
||||
});
|
||||
|
||||
/* Create a documentation tarball suitable for uploading to Hackage instead
|
||||
of building the package.
|
||||
*/
|
||||
documentationTarball = pkg:
|
||||
pkgs.lib.overrideDerivation pkg (drv: {
|
||||
name = "${drv.name}-docs";
|
||||
# Like sdistTarball, disable the "doc" output here.
|
||||
outputs = [ "out" ];
|
||||
buildPhase = ''
|
||||
runHook preHaddock
|
||||
./Setup haddock --for-hackage
|
||||
runHook postHaddock
|
||||
'';
|
||||
haddockPhase = ":";
|
||||
checkPhase = ":";
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p "$out"
|
||||
tar --format=ustar \
|
||||
-czf "$out/${drv.name}-docs.tar.gz" \
|
||||
-C dist/doc/html "${drv.name}-docs"
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
|
||||
/* Use the gold linker. It is a linker for ELF that is designed
|
||||
"to run as fast as possible on modern systems"
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@ with pkgs;
|
|||
stdenv-inputs = callPackage ./stdenv-inputs { };
|
||||
|
||||
haskell-shellFor = callPackage ./haskell-shellFor { };
|
||||
haskell-documentationTarball = callPackage ./haskell-documentationTarball { };
|
||||
|
||||
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
|
||||
cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
|
||||
|
|
17
pkgs/test/haskell-documentationTarball/default.nix
Normal file
17
pkgs/test/haskell-documentationTarball/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, haskellPackages }:
|
||||
|
||||
let
|
||||
drv = haskellPackages.vector;
|
||||
docs = pkgs.haskell.lib.documentationTarball drv;
|
||||
|
||||
in pkgs.runCommand "test haskell.lib.documentationTarball" { } ''
|
||||
tar xvzf "${docs}/${drv.name}-docs.tar.gz"
|
||||
|
||||
# Check for Haddock html
|
||||
find "${drv.name}-docs" | grep -q "Data-Vector.html"
|
||||
|
||||
# Check for source html
|
||||
find "${drv.name}-docs" | grep -q "src/Data.Vector.html"
|
||||
|
||||
touch "$out"
|
||||
''
|
Loading…
Reference in a new issue