aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
committerMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
commit80d90d9b204f7c17912740f9f414fe5d59f293ba (patch)
tree5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix
parent3a31a84c7d3e589035ad08499206aac44a81f424 (diff)
parent83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff)
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix34
1 files changed, 31 insertions, 3 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix b/infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix
index 58d50592ac42..6bcc563164eb 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/haskell-modules/lib.nix
@@ -86,11 +86,11 @@ rec {
future.
Instead of jailbreaking, you can patch the cabal file.
-
+
Note that jailbreaking at this time, doesn't lift bounds on
- conditional branches.
+ conditional branches.
https://github.com/peti/jailbreak-cabal/issues/7 has further details.
-
+
*/
doJailbreak = drv: overrideCabal drv (drv: { jailbreak = true; });
@@ -156,6 +156,9 @@ rec {
addBuildDepend = drv: x: addBuildDepends drv [x];
addBuildDepends = drv: xs: overrideCabal drv (drv: { buildDepends = (drv.buildDepends or []) ++ xs; });
+ addTestToolDepend = drv: x: addTestToolDepends drv [x];
+ addTestToolDepends = drv: xs: overrideCabal drv (drv: { testToolDepends = (drv.testToolDepends or []) ++ xs; });
+
addPkgconfigDepend = drv: x: addPkgconfigDepends drv [x];
addPkgconfigDepends = drv: xs: overrideCabal drv (drv: { pkgconfigDepends = (drv.pkgconfigDepends or []) ++ xs; });
@@ -232,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"
*/