buildRubyGem: Provide manpages for Ruby gems (#49334)

This commit is contained in:
Michael Fellinger
2018-10-29 01:48:05 +01:00
committed by zimbatm
parent 56d2af6e98
commit 34e1fa4a50
2 changed files with 27 additions and 9 deletions
@@ -44,6 +44,7 @@ lib.makeOverridable (
# git checkout).
# If you need to apply patches, make sure to set `dontBuild = false`;
, dontBuild ? true
, dontInstallManpages ? false
, propagatedBuildInputs ? []
, propagatedUserEnvPkgs ? []
, buildFlags ? []
@@ -206,6 +207,14 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
ruby ${./gem-post-build.rb} "$spec"
''}
${lib.optionalString (!dontInstallManpages) ''
for section in {1..9}; do
mandir="$out/share/man/man$section"
find $out/lib \( -wholename "*/man/*.$section" -o -wholename "*/man/man$section/*.$section" \) \
-execdir mkdir -p $mandir \; -execdir cp '{}' $mandir \;
done
''}
runHook postInstall
'';