about summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/gem
diff options
context:
space:
mode:
authorJudson Lester <nyarly@users.noreply.github.com>2019-03-29 06:36:04 -0700
committerzimbatm <zimbatm@zimbatm.com>2019-03-29 14:36:04 +0100
commit704d02053b6abbfe3a9b2ea7fe7cfa883fb2eb2e (patch)
tree75465fd7c53b1412b2baa570dfbf23c9178a7733 /pkgs/development/ruby-modules/gem
parentbad5d145c28db9005d2fa8056ff41a146c0c6bf1 (diff)
(ruby-modules/gem): (refactor) (#53525)
* Changing leaveDotGit to git chacha on build

* Removing debugging cruft

* Simpler git handling

* Can't clobber index after `add`

* Update pkgs/development/ruby-modules/gem/default.nix

Useful comments

Co-Authored-By: nyarly <nyarly@users.noreply.github.com>

* Update pkgs/development/ruby-modules/gem/default.nix

Comments are useful

Co-Authored-By: nyarly <nyarly@users.noreply.github.com>
Diffstat (limited to 'pkgs/development/ruby-modules/gem')
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/development/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix
index b0abb2c54fc5c..c881d4eb4744e 100644
--- a/pkgs/development/ruby-modules/gem/default.nix
+++ b/pkgs/development/ruby-modules/gem/default.nix
@@ -63,7 +63,6 @@ let
     else if type == "git" then
       fetchgit {
         inherit (attrs.source) url rev sha256 fetchSubmodules;
-        leaveDotGit = true;
       }
     else if type == "url" then
       fetchurl attrs.source
@@ -95,6 +94,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
 
   inherit src;
 
+
   unpackPhase = attrs.unpackPhase or ''
     runHook preUnpack
 
@@ -142,6 +142,12 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
       gempkg=$(echo "$output" | grep -oP 'File: \K(.*)')
 
       echo "gem package built: $gempkg"
+    elif [[ "$type" == "git" ]]; then
+      git init
+      # remove variations to improve the likelihood of a bit-reproducible output
+      rm -rf .git/logs/ .git/hooks/ .git/index .git/FETCH_HEAD .git/ORIG_HEAD .git/refs/remotes/origin/HEAD .git/config
+      # support `git ls-files`
+      git add .
     fi
 
     runHook postBuild