summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/bundler-app
diff options
context:
space:
mode:
authorMichael Fellinger <m.fellinger@gmail.com>2018-10-29 00:48:05 +0000
committerzimbatm <zimbatm@zimbatm.com>2018-10-29 01:48:05 +0100
commit34e1fa4a509fde351d4c9102ca766d92cfaebb51 (patch)
treee87b7ccd81a4713b0314fdcd4bb78376dd4a214f /pkgs/development/ruby-modules/bundler-app
parent56d2af6e9819b0688f9dd4b89841bc0d4f70df14 (diff)
downloadnixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar.gz
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar.bz2
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar.lz
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar.xz
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.tar.zst
nixpkgs-34e1fa4a509fde351d4c9102ca766d92cfaebb51.zip
buildRubyGem: Provide manpages for Ruby gems (#49334)
Diffstat (limited to 'pkgs/development/ruby-modules/bundler-app')
-rw-r--r--pkgs/development/ruby-modules/bundler-app/default.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/development/ruby-modules/bundler-app/default.nix b/pkgs/development/ruby-modules/bundler-app/default.nix
index c8f61389ad3..656896a8f7a 100644
--- a/pkgs/development/ruby-modules/bundler-app/default.nix
+++ b/pkgs/development/ruby-modules/bundler-app/default.nix
@@ -24,6 +24,7 @@
 , gemset ? null
 , preferLocalBuild ? false
 , allowSubstitutes ? false
+, installManpages ? true
 , meta ? {}
 , postBuild ? ""
 , gemConfig ? null
@@ -36,14 +37,22 @@ let
   // { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults
 in
    runCommand basicEnv.name cmdArgs ''
-    mkdir -p $out/bin;
-      ${(lib.concatMapStrings (x: "ln -s '${basicEnv}/bin/${x}' $out/bin/${x};\n") exes)}
-      ${(lib.concatMapStrings (s: "makeWrapper $out/bin/$(basename ${s}) $srcdir/${s} " +
-              "--set BUNDLE_GEMFILE ${basicEnv.confFiles}/Gemfile "+
-              "--set BUNDLE_PATH ${basicEnv}/${ruby.gemPath} "+
-              "--set BUNDLE_FROZEN 1 "+
-              "--set GEM_HOME ${basicEnv}/${ruby.gemPath} "+
-              "--set GEM_PATH ${basicEnv}/${ruby.gemPath} "+
-              "--run \"cd $srcdir\";\n") scripts)}
+    mkdir -p $out/bin
+    ${(lib.concatMapStrings (x: "ln -s '${basicEnv}/bin/${x}' $out/bin/${x};\n") exes)}
+    ${(lib.concatMapStrings (s: "makeWrapper $out/bin/$(basename ${s}) $srcdir/${s} " +
+            "--set BUNDLE_GEMFILE ${basicEnv.confFiles}/Gemfile "+
+            "--set BUNDLE_PATH ${basicEnv}/${ruby.gemPath} "+
+            "--set BUNDLE_FROZEN 1 "+
+            "--set GEM_HOME ${basicEnv}/${ruby.gemPath} "+
+            "--set GEM_PATH ${basicEnv}/${ruby.gemPath} "+
+            "--run \"cd $srcdir\";\n") scripts)}
+
+    ${lib.optionalString installManpages ''
+    for section in {1..9}; do
+      mandir="$out/share/man/man$section"
+      find -L ${basicEnv}/${ruby.gemPath}/gems/${basicEnv.name} \( -wholename "*/man/*.$section" -o -wholename "*/man/man$section/*.$section" \) -print -execdir mkdir -p $mandir \; -execdir cp '{}' $mandir \;
+    done
+    ''}
+
     ${postBuild}
   ''