Mercurial > vanilla
changeset 1150:e3e1828b8f15
dev/git: initial import, closes #1077
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 27 Sep 2019 21:05:00 +0200 |
parents | ee4b956157fe |
children | 8604ee710a55 |
files | dev/git/git.sh dev/git/git.sha1 |
diffstat | 2 files changed, 115 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev/git/git.sh Fri Sep 27 21:05:00 2019 +0200 @@ -0,0 +1,114 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier <markand@malikania.fr> +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=git +PKGVERSION=2.23.0 +PKGREVISION=1 +PKGLICENSE="GPLv20+" +PKGSUMMARY="fast, scalable, distributed revision control system" +PKGDOWNLOAD="https://mirrors.edge.kernel.org/pub/software/scm/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz" +PKGDEPENDS="asciidoc:build" +PKGOPTIONS="CURL NLS PERL REGEX SSL XML ZLIB" + +: ${CC:=clang} +: ${CFLAGS:=-O2} +: ${LDFLAGS:=} +: ${CURL:=yes} +: ${NLS:=yes} +: ${PERL:=yes} +: ${REGEX:=yes} # Note: regular expression through pcre2. +: ${SSL:=yes} +: ${XML:=yes} # Note: HTTP support through expat. +: ${ZLIB:=yes} + +if [ "$CURL" = "yes" ]; then + PKGDEPENDS="curl $PKGDEPENDS" +else + with_curl="NO_CURL=YesPlease" +fi + +if [ "$NLS" = "yes" ]; then + PKGDEPENDS="gettext $PKGDEPENDS" +else + with_nls="NO_GETTEXT=YesPlease" +fi + +if [ "$PERL" = "yes" ]; then + PKGDEPENDS="perl $PKGDEPENDS" + with_perl="NO_PERL_CPAN_FALLBACKS=1" +else + with_perl="NO_PERL=YesPlease NO_PERL_CPAN_FALLBACKS=1" +fi + +if [ "$REGEX" = "yes" ]; then + PKGDEPENDS="pcre2 $PKGDEPENDS" + with_regex="USE_LIBPCRE=Yes" +fi + +if [ "$SSL" = "yes" ]; then + PKGDEPENDS="libressl $PKGDEPENDS" +else + with_ssl="NO_SSL=YesPlease" +fi + +if [ "$XML" = "yes" ]; then + PKGDEPENDS="expat $PKGDEPENDS" +else + with_xml="NO_EXPAT=YesPlease" +fi + +if [ "$ZLIB" = "yes" ]; then + PKGDEPENDS="zlib $PKGDEPENDS" +else + with_zlib="NO_ZLIB=YesPlease" +fi + +perl_config() +{ + perl -e "use Config; print \$Config{$1};" +} + +build() +{ + rm -rf $PKGNAME-$PKGVERSION + tar xvf $PKGNAME-$PKGVERSION.tar.xz + cd $PKGNAME-$PKGVERSION + + # NO_PYTHON: only for 2.7 which is deprecated in Vanilla Linux. + # NO_REGEX: does not build without. + make \ + V=1 \ + CC="$CC" \ + CFLAGS="$CFLAGS" \ + LDFLAGS="$LDFLAGS" \ + DESTDIR="$DESTDIR" \ + NO_REGEX=YesPlease \ + prefix= \ + perllibdir=$(perl_config vendorlib) \ + $with_curl \ + $with_nls \ + $with_perl \ + $with_regex \ + $with_ssl \ + $with_xml \ + $with_zlib \ + NO_PYTHON=YesPlease \ + all man install install-man + + cd .. + rm -rf $PKGNAME-$PKGVERSION +}