nixpkgs/pkgs/development/interpreters/ruby/rubygems/0001-add-post-extract-hook.patch
Alyssa Ross 0ffedefb15
ruby: rubygems 2.7.7 -> 3.0.3
I think it makes more sense to keep the patches in-tree than on
zimbatm's RubyGems fork.
2019-04-29 12:37:22 +00:00

35 lines
1.0 KiB
Diff

From a6485cfcdf51ff8be452980f93cebfea97f34dec Mon Sep 17 00:00:00 2001
From: zimbatm <zimbatm@zimbatm.com>
Date: Wed, 21 Sep 2016 09:32:34 +0100
Subject: [PATCH 1/3] add post-extract hook
Allows nix to execute scripts just after the gem extraction
---
lib/rubygems/installer.rb | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index d26b1e88..bf18fb7f 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -848,7 +848,15 @@ TEXT
# Ensures that files can't be installed outside the gem directory.
def extract_files
- @package.extract_files gem_dir
+ ret = @package.extract_files gem_dir
+ if ENV['NIX_POST_EXTRACT_FILES_HOOK']
+ puts
+ puts "running NIX_POST_EXTRACT_FILES_HOOK #{ENV['NIX_POST_EXTRACT_FILES_HOOK']} #{gem_dir}"
+ system(ENV['NIX_POST_EXTRACT_FILES_HOOK'], gem_dir.to_s)
+ puts "running NIX_POST_EXTRACT_FILES_HOOK done"
+ puts
+ end
+ ret
end
##
--
2.21.0