forked from libgit2/objective-git
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathupdate_libgit2
More file actions
executable file
·42 lines (33 loc) · 945 Bytes
/
update_libgit2
File metadata and controls
executable file
·42 lines (33 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
set -e
cd "External/libgit2"
if [ -d "build" ]; then
rm -rf "build"
fi
mkdir build
cd build
# OpenSSL is keg-only, so add its pkgconfig location manually
if [[ $(uname -m) == 'arm64' ]]; then
echo "Running on a Apple Silicon M1"
export ARCH_PREFIX=/opt/homebrew
else
echo "Running on a Apple x86"
export ARCH_PREFIX=/usr/local
fi
export PKG_CONFIG_PATH=$ARCH_PREFIX/opt/openssl/lib/pkgconfig:$ARCH_PREFIX/lib/pkgconfig
# augment path to help it find cmake installed in /usr/local/bin,
# e.g. via brew. Xcode's Run Script phase doesn't seem to honor
# ~/.MacOSX/environment.plist
PATH="$ARCH_PREFIX/bin:$PATH"
cmake --version
cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_CLAR:BOOL=OFF \
-DTHREADSAFE:BOOL=ON \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
..
cmake --build .
product="libgit2.a"
install_path="../../${product}"
rm -rf $install_path
cp -v "${product}" "${install_path}"
echo "libgit2 has been updated."