Skip to content

Commit

Permalink
mac: Download and bundle Git LFS on build
Browse files Browse the repository at this point in the history
  • Loading branch information
hbons committed Aug 2, 2016
1 parent a2a4d1d commit 89b645d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 615 deletions.
36 changes: 21 additions & 15 deletions SparkleShare/Mac/checkGit.sh
Expand Up @@ -15,31 +15,37 @@ export projectFolder=$(dirname $0)
export projectFolder=$(abspath ${projectFolder})

export gitVersion=$(cat ${projectFolder}/git.version)
export gitLfsVersion=$(cat ${projectFolder}/git-lfs.version)

set -e

if [ ! -f ${projectFolder}/git-${gitVersion}.tar.gz ]
then
curl -s -L https://www.kernel.org/pub/software/scm/git/git-${gitVersion}.tar.gz > git.tar.gz
curl -s -L https://github.com/github/git-lfs/releases/download/v${gitLfsVersion}/git-lfs-darwin-amd64-${gitLfsVersion}.tar.gz > git-lfs.tar.gz

list_hash=$(sed -n -e "/git-${gitVersion}.tar.gz/p" sha256sums.asc | cut -c 1-64)
file_hash=$(shasum -a 256 git.tar.gz | cut -c 1-64)
test -e git.tar.gz || { echo "Failed to download git"; exit 1; }
test -e git-lfs.tar.gz || { echo "Failed to download git-lfs"; exit 1; }

curl -s https://www.kernel.org/pub/software/scm/git/git-${gitVersion}.tar.gz > git.tar.gz
tar xzf git.tar.gz
tar xzf git-lfs.tar.gz

test -e git.tar.gz || { echo "Failed to download git"; exit 1; }
cd git-${gitVersion}
make configure
./configure --prefix=${projectFolder}/git --with-openssl=no
make install
cd ..

test "$file_hash" = "$list_hash" || { echo "SHA256 Mistmatch"; exit 1; }
cd git-lfs-${gitLfsVersion}
cp git-lfs ${projectFolder}/git/libexec/git-core
cd ..

tar xf git.tar.gz
cd git-${gitVersion}
tar czf git-${gitVersion}.tar.gz git

make configure
./configure --prefix=${projectFolder}/git --with-openssl=no
make install
cd ..
rm -rf git
rm -rf git-${gitVersion}
rm -rf git-lfs-${gitLfsVersion}

tar cfz git-${gitVersion}.tar.gz git
rm -rf git
rm -rf git-${gitVersion}
rm git.tar.gz
rm git.tar.gz
rm git-lfs.tar.gz
fi

0 comments on commit 89b645d

Please sign in to comment.