lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fetchgit: add lfs support

authored by

Jonathan Ringer and committed by
Jonathan Ringer
74128561 ecf84de7

+14 -3
+1
pkgs/build-support/fetchgit/builder.sh
··· 8 8 9 9 $SHELL $fetcher --builder --url "$url" --out "$out" --rev "$rev" \ 10 10 ${leaveDotGit:+--leave-dotGit} \ 11 + ${fetchLFS:+--fetch-lfs} \ 11 12 ${deepClone:+--deepClone} \ 12 13 ${fetchSubmodules:+--fetch-submodules} \ 13 14 ${branchName:+--branch-name "$branchName"}
+6 -3
pkgs/build-support/fetchgit/default.nix
··· 1 - {stdenvNoCC, git, cacert}: let 1 + {stdenvNoCC, git, git-lfs, cacert}: let 2 2 urlToName = url: rev: let 3 3 inherit (stdenvNoCC.lib) removeSuffix splitString last; 4 4 base = last (splitString ":" (baseNameOf (removeSuffix "/" url))); ··· 20 20 # successfully. This can do things like check or transform the file. 21 21 postFetch ? "" 22 22 , preferLocalBuild ? true 23 + , fetchLFS ? false 23 24 }: 24 25 25 26 /* NOTE: ··· 53 54 inherit name; 54 55 builder = ./builder.sh; 55 56 fetcher = ./nix-prefetch-git; # This must be a string to ensure it's called with bash. 56 - nativeBuildInputs = [git]; 57 + 58 + nativeBuildInputs = [ git ] 59 + ++ stdenvNoCC.lib.optionals fetchLFS [ git-lfs ]; 57 60 58 61 outputHashAlgo = "sha256"; 59 62 outputHashMode = "recursive"; 60 63 outputHash = sha256; 61 64 62 - inherit url rev leaveDotGit fetchSubmodules deepClone branchName postFetch; 65 + inherit url rev leaveDotGit fetchLFS fetchSubmodules deepClone branchName postFetch; 63 66 64 67 GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; 65 68
+7
pkgs/build-support/fetchgit/nix-prefetch-git
··· 9 9 deepClone=$NIX_PREFETCH_GIT_DEEP_CLONE 10 10 leaveDotGit=$NIX_PREFETCH_GIT_LEAVE_DOT_GIT 11 11 fetchSubmodules= 12 + fetchLFS= 12 13 builder= 13 14 branchName=$NIX_PREFETCH_GIT_BRANCH_NAME 14 15 ··· 72 73 --quiet) QUIET=true;; 73 74 --no-deepClone) deepClone=;; 74 75 --leave-dotGit) leaveDotGit=true;; 76 + --fetch-lfs) fetchLFS=true;; 75 77 --fetch-submodules) fetchSubmodules=true;; 76 78 --builder) builder=true;; 77 79 -h|--help) usage; exit;; ··· 282 284 local dir="$1" 283 285 local url="$2" 284 286 local rev="${3:-HEAD}" 287 + 288 + if [ -n "$fetchLFS" ]; then 289 + HOME=$TMPDIR 290 + git lfs install 291 + fi 285 292 286 293 # Perform the checkout. 287 294 case "$rev" in