@@ -2098,7 +2098,6 @@ RBIN="${R_HOME}/bin/R"
2098
2098
2099
2099
2100
2100
PKG_CONFIG_NAME=" libgit2"
2101
- PKG_BREW_NAME=" libgit2"
2102
2101
PKG_LIBS=" -lgit2"
2103
2102
PKG_CFLAGS=" "
2104
2103
@@ -2165,9 +2164,48 @@ fi
2165
2164
2166
2165
if test " x${BREW} " = xyes; then
2167
2166
BREWDIR=` brew --prefix`
2168
- else
2169
- curl -sfL " https://autobrew.github.io/scripts/libgit2" > autobrew
2170
- . ./autobrew
2167
+ PKG_CFLAGS=" -I${BREWDIR} /opt/libgit2/include"
2168
+ PKG_LIBS=" -L${BREWDIR} /opt/libgit2/lib ${PKG_LIBS} "
2169
+ elif test -z " ${DISABLE_AUTOBREW} " ; then
2170
+ # Try to download a static build of libgit2 and use that.
2171
+ bottle_ver=" 1.8.1"
2172
+ bottle_sha256=" 9419deece3c3b7bec2ed8ed1caa5f4a3f3f1b049a6d17b0a75b2e05128c10fdf"
2173
+ bottle_url=" https://github.com/autobrew/bundler/releases/download"
2174
+ bottle=" ${bottle_url} /libgit2-${bottle_ver} /libgit2-${bottle_ver} -universal.tar.xz"
2175
+
2176
+ # Download the bottle
2177
+ echo " Download autobrew bundle $( basename ${bottle} ) "
2178
+ curl -sSL $bottle -o libs.tar.xz
2179
+
2180
+ # Verify the checksum of the downloaded bottle
2181
+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : checking SHA256 checksum of downloaded $( basename ${bottle} ) " >&5
2182
+ printf %s " checking SHA256 checksum of downloaded $( basename ${bottle} ) ... " >&6 ; }
2183
+ : ${bottle_download_sha256=`openssl sha256 libs.tar.xz | sed -e ' s:.*= ::' `}
2184
+ if test " x$bottle_download_sha256 " ! = " x$bottle_sha256 " ; then
2185
+ { { printf " %s\n" " $as_me :${as_lineno-$LINENO } : error: in '$ac_pwd ':" >&5
2186
+ printf " %s\n" " $as_me : error: in '$ac_pwd ':" >&2 ; }
2187
+ as_fn_error $? " The SHA256 checksum of $( basename ${bottle} ) didn't match
2188
+ See 'config.log' for more details" " $LINENO " 5; }
2189
+ fi
2190
+ { printf " %s\n" " $as_me :${as_lineno-$LINENO } : result: yes" >&5
2191
+ printf " %s\n" " yes" >&6 ; }
2192
+
2193
+ # General setup
2194
+ BREWDIR=" $PWD /.deps"
2195
+ mkdir -p $BREWDIR
2196
+ tar -xf libs.tar.xz --strip 1 -C $BREWDIR
2197
+ rm -f libs.tar.xz
2198
+
2199
+ PKG_CFLAGS=" -I${BREWDIR} /include"
2200
+ PKG_LIBS=" -L${BREWDIR} /lib ${PKG_LIBS} -lssh2 -lcrypto -lcurl -lz -liconv -framework Security"
2201
+
2202
+ # Prevent linking against other libs in /usr/local/lib
2203
+ for FILE in $BREWDIR /lib/* .a; do
2204
+ BASENAME=$( basename $FILE )
2205
+ LIBNAME=$( echo " ${BASENAME% .* } " | cut -c4-)
2206
+ cp -f $FILE $BREWDIR /lib/libbrew$LIBNAME .a
2207
+ PKG_LIBS=$( echo $PKG_LIBS | sed " s/-l$LIBNAME /-lbrew$LIBNAME /g" )
2208
+ done
2171
2209
fi
2172
2210
;;
2173
2211
esac
@@ -2199,10 +2237,10 @@ if test "x${libgit2_ver_ok}" = xno; then
2199
2237
echo "
2200
2238
-----------------------------------------------------------------------
2201
2239
2202
- Unable to find ' libgit2 >= ${LIBGIT2_MIN_VERSION} ' on this system, please install :
2203
- libgit2-dev (package on e.g. Debian and Ubuntu )
2204
- libgit2-devel (package on e.g. Fedora, CentOS and RHEL )
2205
- libgit2 (Homebrew package on OS X )
2240
+ Configuration failed to find libgit2 library. Try installing :
2241
+ * brew: libgit2 (MacOS )
2242
+ * deb: libgit2-dev (Debian, Ubuntu, etc )
2243
+ * rpm: libgit2-devel (Fedora, CentOS, RHEL )
2206
2244
and try again.
2207
2245
2208
2246
If the libgit2 library is installed on your system but the git2r
@@ -2218,16 +2256,6 @@ if test "x${libgit2_ver_ok}" = xno; then
2218
2256
or download and install git2r in R using
2219
2257
install.packages('git2r', type='source', configure.vars='LIB_DIR=-L/path/to/libs INCLUDE_DIR=-I/path/to/headers')
2220
2258
2221
- On macOS, another possibility is to let the configuration
2222
- automatically download the libgit2 library from the Homebrew
2223
- package manager with:
2224
-
2225
- R CMD INSTALL git2r-.tar.gz --configure-vars='autobrew=yes'
2226
- or
2227
- R CMD INSTALL git2r/ --configure-vars='autobrew=yes'
2228
- or
2229
- install.packages('git2r', type='source', configure.vars='autobrew=yes')
2230
-
2231
2259
-----------------------------------------------------------------------
2232
2260
2233
2261
"
0 commit comments