mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
build-system: deal with libgit2 versions 1 and later
We assumed everywhere that libgit would always have a 0.xx version number. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3a74f65063
commit
c6704f2aa6
1 changed files with 15 additions and 7 deletions
|
@ -245,8 +245,8 @@ fi
|
||||||
if [ "$PLATFORM" = Darwin ] ; then
|
if [ "$PLATFORM" = Darwin ] ; then
|
||||||
SH_LIB_EXT=dylib
|
SH_LIB_EXT=dylib
|
||||||
if [ ! "$BUILD_DEPS" == "1" ] ; then
|
if [ ! "$BUILD_DEPS" == "1" ] ; then
|
||||||
pkg-config --exists libgit2 && LIBGIT=$(pkg-config --modversion libgit2 | cut -d. -f2)
|
pkg-config --exists libgit2 && LIBGIT=$(pkg-config --modversion libgit2) && LIBGITMAJ=$(echo $LIBGIT | cut -d. -f1) && LIBGIT=$(echo $LIBGIT | cut -d. -f2)
|
||||||
if [[ "$LIBGIT" -gt "23" ]] ; then
|
if [[ "$LIBGITMAJ" -gt "0" || "$LIBGIT" -gt "25" ]] ; then
|
||||||
LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON"
|
LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -258,12 +258,20 @@ else
|
||||||
# first check pkgconfig (that will capture our own local build if
|
# first check pkgconfig (that will capture our own local build if
|
||||||
# this script has been run before)
|
# this script has been run before)
|
||||||
if pkg-config --exists libgit2 ; then
|
if pkg-config --exists libgit2 ; then
|
||||||
LIBGIT=$(pkg-config --modversion libgit2 | cut -d. -f2)
|
LIBGIT=$(pkg-config --modversion libgit2)
|
||||||
LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON"
|
LIBGITMAJ=$(echo $LIBGIT | cut -d. -f1)
|
||||||
|
LIBGIT=$(echo $LIBGIT | cut -d. -f2)
|
||||||
|
if [[ "$LIBGITMAJ" -gt "0" || "$LIBGIT" -gt "25" ]] ; then
|
||||||
|
LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "$LIBGIT" -lt "26" ]] ; then
|
if [[ "$LIBGITMAJ" -lt "1" && "$LIBGIT" -lt "26" ]] ; then
|
||||||
# maybe there's a system version that's new enough?
|
# maybe there's a system version that's new enough?
|
||||||
LIBGIT=$(ldconfig -p | grep libgit2\\.so\\. | awk -F. '{ print $NF }')
|
# Ugh that's uggly - read the ultimate filename, split at the last 'o' which gets us ".0.26.3" or ".1.0.0"
|
||||||
|
# since that starts with a dot, the field numbers in the cut need to be one higher
|
||||||
|
LIBGIT=$(realpath $(ldconfig -p | grep libgit2\\.so\\. | cut -d\ -f4) | awk -Fo '{ print $NF }')
|
||||||
|
LIBGITMAJ=$(echo $LIBGIT | cut -d. -f2)
|
||||||
|
LIBGIT=$(echo $LIBGIT | cut -d. -f3)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -312,7 +320,7 @@ if [[ $PLATFORM = Darwin && "$BUILD_DEPS" == "1" ]] ; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$LIBGIT" -lt "26" ]] ; then
|
if [[ "$LIBGITMAJ" -lt "1" && "$LIBGIT" -lt "26" ]] ; then
|
||||||
LIBGIT_ARGS=" -DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include -DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT "
|
LIBGIT_ARGS=" -DLIBGIT2_INCLUDE_DIR=$INSTALL_ROOT/include -DLIBGIT2_LIBRARIES=$INSTALL_ROOT/lib/libgit2.$SH_LIB_EXT "
|
||||||
|
|
||||||
cd "$SRC"
|
cd "$SRC"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue