mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-06-22 10:53:36 +02:00
ENH: Compile git with SSL support
Older versions of git included in older linux distributions are not able to download source from Github. A newer version is required with a newer OpenSSL. This requires to also build curl with the same OpenSSL. CMake is downloaded precompiled if available (64bits system) or compiled from source otherwise.
This commit is contained in:
44
imagefiles/build-and-install-git.sh
Executable file
44
imagefiles/build-and-install-git.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
if ! command -v curl &> /dev/null; then
|
||||
echo >&2 'error: "curl" not found!'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v tar &> /dev/null; then
|
||||
echo >&2 'error: "tar" not found!'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${GIT_VERSION}" == "" ]]; then
|
||||
echo >&2 'error: GIT_VERSION env. variable must be set to a non-empty value'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
(cat /etc/ld.so.conf.d/usr-local.conf 2> /dev/null | grep -q "^/usr/local/lib$") ||
|
||||
echo '/usr/local/lib' >> /etc/ld.so.conf.d/usr-local.conf
|
||||
ldconfig
|
||||
|
||||
cd /usr/src
|
||||
|
||||
url="https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.gz"
|
||||
echo "Downloading $url"
|
||||
curl -# -LO $url
|
||||
|
||||
tar xvzf git-${GIT_VERSION}.tar.gz
|
||||
rm -f git-${GIT_VERSION}.tar.gz
|
||||
|
||||
pushd git-${GIT_VERSION}
|
||||
./configure --prefix=/usr/local --with-curl
|
||||
make
|
||||
make install
|
||||
popd
|
||||
|
||||
ldconfig
|
||||
|
||||
rm -rf git-${GIT_VERSION}
|
||||
|
||||
# turn the detached message off
|
||||
git config --global advice.detachedHead false
|
Reference in New Issue
Block a user