forked from libgit2/libgit2sharp.nativebinaries
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.libgit2.sh
More file actions
executable file
·48 lines (36 loc) · 868 Bytes
/
build.libgit2.sh
File metadata and controls
executable file
·48 lines (36 loc) · 868 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
43
44
45
46
47
48
#!/bin/bash
LIBGIT2SHA=`cat ./nuget.package/libgit2/libgit2_hash.txt`
SHORTSHA=${LIBGIT2SHA:0:7}
rm -rf libgit2/build
mkdir libgit2/build
pushd libgit2/build
export _BINPATH=`pwd`
cmake -DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_CLAR:BOOL=OFF \
-DUSE_SSH=OFF \
-DENABLE_TRACE=ON \
-DLIBGIT2_FILENAME=git2-$SHORTSHA \
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" \
..
cmake --build .
popd
OS=`uname`
ARCH=`uname -m`
PACKAGEPATH="nuget.package/libgit2"
LIBEXT="so"
if [ $OS == "Linux" ]; then
if [ "$ARCH" == "x86_64" ]; then
ARCH="x64"
fi
OSPATH="/linux"
ARCHPATH="-$ARCH"
elif [ $OS == "Darwin" ]; then
OSPATH="/osx"
LIBEXT="dylib"
else
OSPATH="/unix"
fi
rm -rf $PACKAGEPATH$OSPATH
mkdir -p $PACKAGEPATH$OSPATH$ARCHPATH/native
cp libgit2/build/libgit2-$SHORTSHA.$LIBEXT $PACKAGEPATH$OSPATH$ARCHPATH/native
exit $?