From b7e6ac151592bd3c7595e60e9ecf9e1e3c013fe9 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 26 Jan 2018 19:31:37 +0100 Subject: [PATCH] hledger: install man pages and info files Make sure that hledger, hledger-ui, and hledger-web have their documentation installed in locations where system tools can find them. Fixes https://github.com/NixOS/nixpkgs/issues/34301. --- .../haskell-modules/configuration-common.nix | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 74331d46a8b..acae897609b 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -960,4 +960,43 @@ self: super: { sha256 = "0i889zs46wn09d7iqdy99201zaqxb175cfs8jz2zi3mv4ywx3a0l"; }); + # Copy hledger man pages from data directory into the proper place. This code + # should be moved into the cabal2nix generator. + hledger = overrideCabal super.hledger (drv: { + postInstall = '' + for i in $(seq 1 9); do + for j in $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.$i $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/.otherdocs/*.$i; do + mkdir -p $out/share/man/man$i + cp $j $out/share/man/man$i/ + done + done + mkdir $out/share/info + cp $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.info $out/share/info/ + ''; + }); + hledger-ui = overrideCabal super.hledger-ui (drv: { + postInstall = '' + for i in $(seq 1 9); do + for j in $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.$i $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/.otherdocs/*.$i; do + mkdir -p $out/share/man/man$i + cp $j $out/share/man/man$i/ + done + done + mkdir $out/share/info + cp $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.info $out/share/info/ + ''; + }); + hledger-web = overrideCabal super.hledger-web (drv: { + postInstall = '' + for i in $(seq 1 9); do + for j in $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.$i $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/.otherdocs/*.$i; do + mkdir -p $out/share/man/man$i + cp $j $out/share/man/man$i/ + done + done + mkdir $out/share/info + cp $data/share/${self.ghc.name}/${pkgs.stdenv.system}-${self.ghc.name}/*/*.info $out/share/info/ + ''; + }); + }