From 2de5b95acf65cf67db43783b9d308bd097fd7141 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 7 Jul 2018 10:26:31 -0700 Subject: build-system/macOS: don't get libgit2 from pkgconfig when building it ourselves Doing that confuses the build setup and as a result the library isn't found at runtime without some fixups. Fixes #1469 Signed-off-by: Dirk Hohndel --- scripts/build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/build.sh') diff --git a/scripts/build.sh b/scripts/build.sh index 64a86b802..101330956 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -177,7 +177,12 @@ fi # set up the right file name extensions if [ $PLATFORM = Darwin ] ; then SH_LIB_EXT=dylib - pkg-config --exists libgit2 && LIBGIT=$(pkg-config --modversion libgit2 | cut -d. -f2) + if [ ! "$BUILD_DEPS" == "1" ] ; then + pkg-config --exists libgit2 && LIBGIT=$(pkg-config --modversion libgit2 | cut -d. -f2) + if [[ "$LIBGIT" > "23" ]] ; then + LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON" + fi + fi else SH_LIB_EXT=so @@ -187,6 +192,7 @@ else # this script has been run before) if pkg-config --exists libgit2 ; then LIBGIT=$(pkg-config --modversion libgit2 | cut -d. -f2) + LIBGIT2_FROM_PKGCONFIG="-DLIBGIT2_FROM_PKGCONFIG=ON" fi if [[ "$LIBGIT" < "24" ]] ; then # maybe there's a system version that's new enough? @@ -464,7 +470,7 @@ for (( i=0 ; i < ${#BUILDS[@]} ; i++ )) ; do -DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH \ -DBTSUPPORT=${BTSUPPORT} \ -DCMAKE_INSTALL_PREFIX=${INSTALL_ROOT} \ - -DLIBGIT2_FROM_PKGCONFIG=ON \ + $LIBGIT2_FROM_PKGCONFIG \ -DFORCE_LIBSSH=OFF \ $PRINTING $EXTRA_OPTS -- cgit v1.2.3-70-g09d2