Mercurial > vanilla
comparison dev/git/git.sh @ 1150:e3e1828b8f15
dev/git: initial import, closes #1077
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 27 Sep 2019 21:05:00 +0200 |
parents | |
children | 6710613b88b9 |
comparison
equal
deleted
inserted
replaced
1149:ee4b956157fe | 1150:e3e1828b8f15 |
---|---|
1 #!/bin/sh | |
2 # | |
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr> | |
4 # | |
5 # Permission to use, copy, modify, and/or distribute this software for any | |
6 # purpose with or without fee is hereby granted, provided that the above | |
7 # copyright notice and this permission notice appear in all copies. | |
8 # | |
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
16 # | |
17 | |
18 PKGNAME=git | |
19 PKGVERSION=2.23.0 | |
20 PKGREVISION=1 | |
21 PKGLICENSE="GPLv20+" | |
22 PKGSUMMARY="fast, scalable, distributed revision control system" | |
23 PKGDOWNLOAD="https://mirrors.edge.kernel.org/pub/software/scm/$PKGNAME/$PKGNAME-$PKGVERSION.tar.xz" | |
24 PKGDEPENDS="asciidoc:build" | |
25 PKGOPTIONS="CURL NLS PERL REGEX SSL XML ZLIB" | |
26 | |
27 : ${CC:=clang} | |
28 : ${CFLAGS:=-O2} | |
29 : ${LDFLAGS:=} | |
30 : ${CURL:=yes} | |
31 : ${NLS:=yes} | |
32 : ${PERL:=yes} | |
33 : ${REGEX:=yes} # Note: regular expression through pcre2. | |
34 : ${SSL:=yes} | |
35 : ${XML:=yes} # Note: HTTP support through expat. | |
36 : ${ZLIB:=yes} | |
37 | |
38 if [ "$CURL" = "yes" ]; then | |
39 PKGDEPENDS="curl $PKGDEPENDS" | |
40 else | |
41 with_curl="NO_CURL=YesPlease" | |
42 fi | |
43 | |
44 if [ "$NLS" = "yes" ]; then | |
45 PKGDEPENDS="gettext $PKGDEPENDS" | |
46 else | |
47 with_nls="NO_GETTEXT=YesPlease" | |
48 fi | |
49 | |
50 if [ "$PERL" = "yes" ]; then | |
51 PKGDEPENDS="perl $PKGDEPENDS" | |
52 with_perl="NO_PERL_CPAN_FALLBACKS=1" | |
53 else | |
54 with_perl="NO_PERL=YesPlease NO_PERL_CPAN_FALLBACKS=1" | |
55 fi | |
56 | |
57 if [ "$REGEX" = "yes" ]; then | |
58 PKGDEPENDS="pcre2 $PKGDEPENDS" | |
59 with_regex="USE_LIBPCRE=Yes" | |
60 fi | |
61 | |
62 if [ "$SSL" = "yes" ]; then | |
63 PKGDEPENDS="libressl $PKGDEPENDS" | |
64 else | |
65 with_ssl="NO_SSL=YesPlease" | |
66 fi | |
67 | |
68 if [ "$XML" = "yes" ]; then | |
69 PKGDEPENDS="expat $PKGDEPENDS" | |
70 else | |
71 with_xml="NO_EXPAT=YesPlease" | |
72 fi | |
73 | |
74 if [ "$ZLIB" = "yes" ]; then | |
75 PKGDEPENDS="zlib $PKGDEPENDS" | |
76 else | |
77 with_zlib="NO_ZLIB=YesPlease" | |
78 fi | |
79 | |
80 perl_config() | |
81 { | |
82 perl -e "use Config; print \$Config{$1};" | |
83 } | |
84 | |
85 build() | |
86 { | |
87 rm -rf $PKGNAME-$PKGVERSION | |
88 tar xvf $PKGNAME-$PKGVERSION.tar.xz | |
89 cd $PKGNAME-$PKGVERSION | |
90 | |
91 # NO_PYTHON: only for 2.7 which is deprecated in Vanilla Linux. | |
92 # NO_REGEX: does not build without. | |
93 make \ | |
94 V=1 \ | |
95 CC="$CC" \ | |
96 CFLAGS="$CFLAGS" \ | |
97 LDFLAGS="$LDFLAGS" \ | |
98 DESTDIR="$DESTDIR" \ | |
99 NO_REGEX=YesPlease \ | |
100 prefix= \ | |
101 perllibdir=$(perl_config vendorlib) \ | |
102 $with_curl \ | |
103 $with_nls \ | |
104 $with_perl \ | |
105 $with_regex \ | |
106 $with_ssl \ | |
107 $with_xml \ | |
108 $with_zlib \ | |
109 NO_PYTHON=YesPlease \ | |
110 all man install install-man | |
111 | |
112 cd .. | |
113 rm -rf $PKGNAME-$PKGVERSION | |
114 } |