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
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.
19 - @package.extract_files gem_dir
20 + ret = @package.extract_files gem_dir
21 + if ENV['NIX_POST_EXTRACT_FILES_HOOK']
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"