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