git: Revert to 2.13.0
[termux-packages] / packages / git / build.sh
1 TERMUX_PKG_HOMEPAGE=https://git-scm.com/
2 TERMUX_PKG_DESCRIPTION="Distributed version control system designed to handle everything from small to very large projects with speed and efficiency"
3 # less is required as a pager for git log, and the busybox less does not handle used escape sequences.
4 TERMUX_PKG_DEPENDS="libcurl, less"
5 TERMUX_PKG_VERSION=2.13.1.1
6 # Work around broken git build for 2.13.1:
7 _REAL_VERSION=2.13.0
8 TERMUX_PKG_SRCURL=https://www.kernel.org/pub/software/scm/git/git-${_REAL_VERSION}.tar.xz
9 TERMUX_PKG_SHA256=4bbf2ab6f2341253a38f95306ec7936833eb1c42572da5c1fa61f0abb2191258
10 ## This requires a working $TERMUX_PREFIX/bin/sh on the host building:
11 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
12 ac_cv_fread_reads_directories=yes
13 ac_cv_header_libintl_h=no
14 ac_cv_snprintf_returns_bogus=no
15 --with-curl
16 --without-tcltk
17 --with-shell=$TERMUX_PREFIX/bin/sh
18 "
19 # expat is only used by git-http-push for remote lock management over DAV, so disable:
20 # NO_INSTALL_HARDLINKS to use symlinks instead of hardlinks (which does not work on Android M):
21 TERMUX_PKG_EXTRA_MAKE_ARGS="NO_NSEC=1 NO_GETTEXT=1 NO_EXPAT=1 NO_INSTALL_HARDLINKS=1 PERL_PATH=$TERMUX_PREFIX/bin/perl"
22 TERMUX_PKG_BUILD_IN_SRC="yes"
23
24 # Things to remove to save space:
25 # bin/git-cvsserver - server emulating CVS
26 # bin/git-shell - restricted login shell for Git-only SSH access
27 TERMUX_PKG_RM_AFTER_INSTALL="
28 bin/git-cvsserver
29 bin/git-shell
30 libexec/git-core/git-shell
31 libexec/git-core/git-cvsserver
32 share/man/man1/git-cvsserver.1
33 share/man/man1/git-shell.1
34 "
35
36 termux_step_pre_configure () {
37 # Setup perl so that the build process can execute it:
38 rm -f $TERMUX_PREFIX/bin/perl
39 ln -s `which perl` $TERMUX_PREFIX/bin/perl
40
41 # Force fresh perl files (otherwise files from earlier builds
42 # remains without bumped modification times, so are not picked
43 # up by the package):
44 rm -Rf $TERMUX_PREFIX/share/git-perl
45
46 # Fixes build if utfcpp is installed:
47 CPPFLAGS="-I$TERMUX_PKG_SRCDIR $CPPFLAGS"
48 }
49
50 termux_step_post_make_install () {
51 # Installing man requires asciidoc and xmlto, so git uses separate make targets for man pages
52 make install-man
53
54 mkdir -p $TERMUX_PREFIX/etc/bash_completion.d/
55 cp $TERMUX_PKG_SRCDIR/contrib/completion/git-completion.bash \
56 $TERMUX_PREFIX/etc/bash_completion.d/
57
58 # Remove the build machine perl setup in termux_step_pre_configure to avoid it being packaged:
59 rm $TERMUX_PREFIX/bin/perl
60
61 # Remove clutter:
62 rm -Rf $TERMUX_PREFIX/lib/*-linux*/perl
63
64 # Remove duplicated binaries in bin/ with symlink to the one in libexec/git-core:
65 (cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git git)
66 (cd $TERMUX_PREFIX/bin; ln -s -f ../libexec/git-core/git-upload-pack git-upload-pack)
67 }
68
69 termux_step_post_massage () {
70 if [ ! -f libexec/git-core/git-remote-https ]; then
71 termux_error_exit "Git built without https support"
72 fi
73 }