stats: 2.11.23 -> 2.11.26 (#374860)
[NixPkgs.git] / pkgs / development / interpreters / ruby / rubygems / 0001-add-post-extract-hook.patch
blob84d1d52409e52cec3b3a7693bb8597f55acbdc21
1 From a6485cfcdf51ff8be452980f93cebfea97f34dec Mon Sep 17 00:00:00 2001
2 From: zimbatm <zimbatm@zimbatm.com>
3 Date: Wed, 21 Sep 2016 09:32:34 +0100
4 Subject: [PATCH 1/3] add post-extract hook
6 Allows nix to execute scripts just after the gem extraction
7 ---
8 lib/rubygems/installer.rb | 10 +++++++++-
9 1 file changed, 9 insertions(+), 1 deletion(-)
11 diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
12 index d26b1e88..bf18fb7f 100644
13 --- a/lib/rubygems/installer.rb
14 +++ b/lib/rubygems/installer.rb
15 @@ -848,7 +848,15 @@ TEXT
16 # Ensures that files can't be installed outside the gem directory.
18 def extract_files
19 - @package.extract_files gem_dir
20 + ret = @package.extract_files gem_dir
21 + if ENV['NIX_POST_EXTRACT_FILES_HOOK']
22 + puts
23 + puts "running NIX_POST_EXTRACT_FILES_HOOK #{ENV['NIX_POST_EXTRACT_FILES_HOOK']} #{gem_dir}"
24 + system(ENV['NIX_POST_EXTRACT_FILES_HOOK'], gem_dir.to_s)
25 + puts "running NIX_POST_EXTRACT_FILES_HOOK done"
26 + puts
27 + end
28 + ret
29 end
32 --
33 2.21.0