(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>
This commit is contained in:
parent
bad5d145c2
commit
704d02053b
@ -63,7 +63,6 @@ let
|
|||||||
else if type == "git" then
|
else if type == "git" then
|
||||||
fetchgit {
|
fetchgit {
|
||||||
inherit (attrs.source) url rev sha256 fetchSubmodules;
|
inherit (attrs.source) url rev sha256 fetchSubmodules;
|
||||||
leaveDotGit = true;
|
|
||||||
}
|
}
|
||||||
else if type == "url" then
|
else if type == "url" then
|
||||||
fetchurl attrs.source
|
fetchurl attrs.source
|
||||||
@ -95,6 +94,7 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
|||||||
|
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
|
|
||||||
unpackPhase = attrs.unpackPhase or ''
|
unpackPhase = attrs.unpackPhase or ''
|
||||||
runHook preUnpack
|
runHook preUnpack
|
||||||
|
|
||||||
@ -142,6 +142,12 @@ stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
|
|||||||
gempkg=$(echo "$output" | grep -oP 'File: \K(.*)')
|
gempkg=$(echo "$output" | grep -oP 'File: \K(.*)')
|
||||||
|
|
||||||
echo "gem package built: $gempkg"
|
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
|
fi
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
Loading…
x
Reference in New Issue
Block a user