【发布时间】:2015-11-18 11:02:11
【问题描述】:
这类似于git clone: fatal: Unable to find remote helper for 'https'。这与其他类似问题略有不同。另一个类似的问题是在 Ubuntu 上,它有一个提供最新组件的包管理器。
这个设置基本上是一个废弃的操作系统。没有现有的 Git,也没有可用的包管理器(如 Yum、Apt-Get、Homebrew 或 Macports)。 Git 和 cURL 所需的一切都是从头开始构建并安装在 /usr/local 中的,它包括:
- libz(Zlib 库)
- libssl 和 libcrypto(OpenSSL 库)
- libidn(IDN 库)
- libiconv(iConvert 库)
- libpcre(PERL RE 库)
- libcurl(cURL 库)
我正在使用下面的 cURL 配方。 cURL 同时支持 HTTP 和 HTTPS。 cURL 可以很好地配置、构建、测试和安装。
我正在使用以下 Git 配方。 Git 可以很好地配置和构建。根据configure --help,我只需要调用 cURL 即可获得 HTTP 和 HTTPS 支持:
$ ./configure --help | egrep -i "(http|openssl)" --with-openssl use OpenSSL library (default is YES) ARG can be prefix for openssl library and headers --with-curl support http(s):// transports (default is YES)
但是,当尝试通过 HTTP 和 HTTPS 执行克隆时,Git 会失败。我已经从零开始构建了两次,所以无论我做错了什么,我现在都做了两次。
为什么 Git 无法构建它需要的助手?
Git 食谱
curl -k https://www.kernel.org/pub/software/scm/git/git-2.4.8.tar.gz -o git-2.4.8.tar.gz
tar zf git-2.4.8.tar.gz
cd git-2.4.8
make configure
sed -i "" 's|-lcrypto|/usr/local/lib/libcrypto.a|g' configure.ac configure Makefile
sed -i "" 's|-lssl|/usr/local/lib/libssl.a|g' configure.ac configure Makefile
sed -i "" 's|-lcurl|/usr/local/lib/libcurl.a|g' configure.ac configure Makefile
sed -i "" 's|-lpcre|/usr/local/lib/libpcre2-posix.a|g' configure.ac configure Makefile
./configure --with-openssl=/usr/local --with-libpcre=/usr/local --with-curl=/usr/local \
--with-zlib=/usr/local --with-iconv=/usr/local --prefix=/usr/local
cURL 配方
curl -k http://curl.haxx.se/download/curl-7.44.0.tar.gz -o curl-7.44.0.tar.gz
tar zf curl-7.44.0.tar.gz
cd curl-7.44.0
sed -i "" 's|-lidn|/usr/local/lib/libidn.a|g' configure.ac configure lib/Makefile.m32 src/Makefile.m32
./configure --enable-optimize --disable-ldap --disable-ldaps --disable-rtsp --disable-dict \
--disable-ntlm-wb --disable-tls-srp --enable-http --enable-file --enable-proxy \
--enable-telnet --enable-tftp --enable-pop3 --enable-imap --enable-ftp --enable-smb \
--enable-smtp --enable-gopher --enable-manual --enable-ipv6 --enable-unix-sockets \
--enable-cookies --without-darwinssl --without-libssh2 --without-winidn --with-gnu-ld \
--with-libidn=/usr/local --with-glib=/usr/local --with-ssl=/usr/local \
--with-ca-path=/usr/share/curl --prefix=/usr/local
配方中对sed 的调用确保我使用的是静态链接。它在 OS X 上是必需的,因为 Apple 总是使用 *.dylibs(如果它们可用)(即使使用像 -Bstatic 这样的选项)。更糟糕的是,这是在 PowerPC 上运行 OS X 10.5 的旧 PowerMac。它用于测试处理器上的软件。
【问题讨论】:
标签: git macos curl configuration makefile