Files
2026-03-06 18:01:24 +07:00

41 lines
1.1 KiB
Bash

#!/bin/bash
. ./scripts/colors.sh
. ./scripts/funcs.sh
. ./scripts/config.sh
. ./scripts/curl.sh
git_build() {
if [ ! -d $build/curl ]; then
curl
fi
pkgname=git
pkgver=2.46.0
srcurl=https://www.kernel.org/pub/software/scm/git/${pkgname}-${pkgver}.tar.xz
print_info "** Building and installing ${pkgname}"
[ -d $build/${pkgname} ] && return 0
mkdir -p $build/git
cd $build/git
if [ ! -f $root/downloads/${pkgname}-${pkgver}.tar.xz ]; then
print_info "** Downloading $srcurl"
cd $root/downloads
wget $srcurl
check $? "download $srcurl"
cd -
fi
tar -xf $root/downloads/${pkgname}-${pkgver}.tar.xz
check $? "Extract ${pkgname}"
cd ${pkgname}-${pkgver}
./configure \
--prefix=/usr \
--host=$CROSS_COMPILE \
NO_ICONV=true \
ac_cv_fread_reads_directories=true \
ac_cv_snprintf_returns_bogus=false
check $? "Configure ${pkgname}"
make $makeflags
check $? "Build ${pkgname}"
make DESTDIR=$rootfspath install
print_info "** SUCCESS: Building and installing ${pkgname}"
}