From 404e61ab5eec720dbb853815c0b6b961c196aa20 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sun, 7 Mar 2021 18:38:28 +0100 Subject: [PATCH] haskellPackages.cabal-install: install man page again Previously, cabal-install had a custom Setup.hs which took care of generating and installing the cabal(1) man page. While this file was a bit of scary sight, it is certainly nice to have a man page properly installed. For the 3.2.0.0 release they switched to the default setup type again, so the man page isn't installed anymore. Fortunately the cabal cli can generate the man page as well, so the override to add the man page back is pretty simple. The commit that introduced this is the following: https://github.com/haskell/cabal/commit/91ac075930c87712eeada4305727a4fa651726e7 I actually made a mental note of this a few weeks ago already, but it slipped my mind when we updated to cabal-install 3.2.0.0 two weeks ago unfortunately. --- .../haskell-modules/configuration-common.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 441410ce138..95b9009d262 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1602,4 +1602,19 @@ self: super: { ]; }); + # cabal-install switched to build type simple in 3.2.0.0 + # as a result, the cabal(1) man page is no longer installed + # automatically. Instead we need to use the `cabal man` + # command which generates the man page on the fly and + # install it to $out/share/man/man1 ourselves in this + # override. + # The commit that introduced this change: + # https://github.com/haskell/cabal/commit/91ac075930c87712eeada4305727a4fa651726e7 + cabal-install = overrideCabal super.cabal-install (old: { + postInstall = old.postInstall + '' + mkdir -p "$out/share/man/man1" + "$out/bin/cabal" man --raw > "$out/share/man/man1/cabal.1" + ''; + }); + } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super