-
Notifications
You must be signed in to change notification settings - Fork 2
/
git.cygport
202 lines (169 loc) · 7.81 KB
/
git.cygport
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# git.cygport - directions for packaging git for cygwin
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Eric Blake
# This file is free software; I give unlimited permission to copy and/or
# distribute it, with or without modifications, as long as this notice is
# preserved.
inherit perl
NAME="git"
VERSION=2.36.0
RELEASE=1
CATEGORY="Devel"
SUMMARY="Distributed version control system"
DESCRIPTION="Git is a free and open source distributed version control system
designed to handle everything from small to very large projects with speed and
efficiency. Git is easy to learn and has a tiny footprint with lightning fast
performance. It outclasses SCM tools like Subversion, CVS, Perforce, and
ClearCase with features like cheap local branching, convenient staging areas,
and multiple workflows."
HOMEPAGE="https://git-scm.com/"
SRC_URI="https://git.kernel.org/pub/scm/git/git.git/snapshot/${PN}-v${PV}.tar.gz
build-requires.txt"
SRC_DIR="${PN}-v${PV}"
PATCH_URI='1.8.5.2-cygwin.patch'
BUILD_REQUIRES="$(tr '\n' ' ' <build-requires.txt)"
PKG_NAMES="git gitk gitweb git-cvs git-email git-gui git-p4 git-svn"
git_REQUIRES="cygutils less openssh rsync"
git_CONTENTS="--exclude=gitk* --exclude=git-cvs* --exclude=git-*email*
--exclude=git-gui* --exclude=git-svn* --exclude=SVN* --exclude=Git.SVN.*
--exclude=git-instaweb* --exclude=gitweb* --exclude=*p4*
usr/bin/ usr/libexec/git-core/ ${PYTHON_SITELIB#/} usr/share/"
git_OBSOLETES="git-completion"
gitk_SUMMARY="Git repository browser"
gitk_REQUIRES="git xorg-x11-fonts-dpi75"
gitk_CONTENTS="usr/bin/gitk usr/share/doc/git/html/gitk* usr/share/gitk
usr/share/man/man1/gitk.1*"
gitweb_SUMMARY="Web interface for Git version control system"
gitweb_REQUIRES="git lighttpd perl-CGI ruby"
gitweb_CONTENTS="usr/libexec/git-core/git-instaweb* usr/share/doc/git/html/*[^-]web*
usr/share/gitweb/ usr/share/man/man1/*[^-]web* usr/share/man/man5/gitweb*"
git_cvs_SUMMARY="CVS compatibilty support for Git version control system"
git_cvs_REQUIRES="git cvsps perl-DBD-SQLite"
git_cvs_CONTENTS="usr/bin/git-cvs* usr/libexec/git-core/git-cvs*
usr/share/doc/git/html/git-cvs* usr/share/man/man1/git-cvs*"
git_email_SUMMARY="Email tools for Git version control system"
git_email_REQUIRES="git perl-MailTools"
git_email_CONTENTS="usr/libexec/git-core/git-*email*
usr/share/doc/git/html/git-*email* usr/share/man/man1/git-*email*"
git_gui_SUMMARY="Graphical interface for Git version control system"
git_gui_REQUIRES="git gitk"
git_gui_CONTENTS="usr/libexec/git-core/git-gui* usr/share/doc/git/html/git-gui*
usr/share/git-gui/ usr/share/man/man1/git-gui.1*"
git_p4_SUMMARY="Perforce compatibility support for Git version control system"
git_p4_REQUIRES="git"
git_p4_CONTENTS="usr/libexec/git-core/git-p4 usr/libexec/git-core/mergetools/p4merge
usr/share/doc/git/html/git-p4* usr/share/man/man1/git-p4.1*"
git_svn_SUMMARY="Subversion compatibility support for Git version control system"
git_svn_REQUIRES="git"
git_svn_CONTENTS="usr/libexec/git-core/git-svn usr/share/perl*/Git/SVN*
usr/share/doc/git/html/git-svn* usr/share/man/man1/git-svn.1*"
MAKEOPTS+=" INSTALLDIRS=vendor"
DIFF_EXCLUDES='configure GIT-VERSION-FILE random_seed trustdb.gpg'
src_compile() {
# Disable CPAN fallbacks in favour of Cygwin-packaged Perl modules.
export NO_PERL_CPAN_FALLBACKS=YesPlease
# Look for the AsciiDoc dblatex files in the right place.
dblatex_path="$(python3 -c 'import asciidoc; print(asciidoc.__path__[0])')/resources/dblatex"
MAKEOPTS+=" ASCIIDOC_DBLATEX_DIR=${dblatex_path}"
# Avoid warnings about Parserdetails.ini.
found_parserdetails=
while read -d $'\0' -r perlpath; do
if [[ -f "$perlpath"/XML/SAX/ParserDetails.ini ]]; then
found_parserdetails=Yes
break
fi
done < <(perl -e 'print join("\0", @INC) . "\0"')
[[ "$found_parserdetails" ]] || perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
# The configure script is not distributed, and VPATH builds aren't supported
cd ${S}
cygmake configure perllibdir="$PERL_VENDORLIB"
lndirs
cd ${B}
cygconf --htmldir=/usr/share/doc/git/html --mandir=/usr/share/man --with-libpcre
cygmake all
cygmake html
cygmake man
cygmake info
cygmake pdf
}
src_install() {
cd ${B}
cyginstall install-html install-man install-info install-pdf pdfdir=/usr/share/doc/git
# Ship bash completion
insinto "$(pkg-config --variable=completionsdir bash-completion)"
newins ${S}/contrib/completion/git-completion.bash git
}
src_test() {
# Test t4018 fails if the files in the build directory are left as
# symlinks rather than being real files.
rm ${B}/t/t4018/*
cp ${S}/t/t4018/* ${B}/t/t4018
cd ${B}
# Unless GIT_SKIP_TESTS is already set, in which case trust the version
# that comes from the environment (including if it's the null string),
# always skip known failures.
if [[ ! -v GIT_SKIP_TESTS ]]; then
known_failures=()
# https://github.com/me-and/Cygwin-Git/issues/47
# https://github.com/me-and/Cygwin-Git/issues/52
known_failures+=(t0021.12)
# https://github.com/me-and/Cygwin-Git/issues/51
known_failures+=(t0301.{13,{26..30}})
# https://github.com/me-and/Cygwin-Git/issues/42
known_failures+=(
t3070.{{114..120..2},{674..680..2},{734..740..2}}
t3070.{{744..750..2},{954..960..2},{964..970..2}}
t3070.{{974..980..2},{1284..1290..2},{1374..1380..2}}
t3070.{{1414..1420..2},{1424..1430..2}}
)
# https://github.com/me-and/Cygwin-Git/issues/45
known_failures+=(
t5500.{145,148,164,165,242,245,261,262,339,342,358,359}
)
# https://github.com/me-and/Cygwin-Git/issues/54
[[ "$ARCH_x86_64" ]] && known_failures+=(t5562)
# https://github.com/me-and/Cygwin-Git/issues/43
known_failures+=(t5580.6)
# https://github.com/me-and/Cygwin-Git/issues/46
known_failures+=(t5601.{{62..64},66})
export GIT_SKIP_TESTS="${known_failures[*]}"
fi
# Also pull in skips set in GIT_SKIP_ADDITIONAL_TESTS. That's an
# environment variable made up for this script rather than one
# suggested by the Git build infrastructure. The idea is that setting
# GIT_SKIP_TESTS would override the previous block for skipping known
# failures, GIT_SKIP_ADDITIONAL_TESTS will be an addition to the
# previous block.
[[ -v GIT_SKIP_ADDITIONAL_TESTS ]] && export GIT_SKIP_TESTS="${GIT_SKIP_TESTS}${GIT_SKIP_TESTS:+ }${GIT_SKIP_ADDITIONAL_TESTS}"
# Create an array of tests to skip for the main run, but which
# shouldn't be listed in the GIT_SKIP_TESTS environment variable,
# because we may want to try to run them later.
main_run_skip_tests=()
# On 64-bit only, skip t0021, since it seems to hang when run through
# prove in GitHub Actions. Run it later, outside prove, where it
# doesn't have that problem.
# https://github.com/me-and/Cygwin-Git/issues/53
[[ "$ARCH_x86_64" ]] && main_run_skip_tests+=('t0021')
# Skip t7900 from the main run as it needs a lot of disk space. If
# there's sufficient space later, we can run it then.
main_run_skip_tests+=('t7900')
# Return code. Set to zero now, it'll be set to non-zero by any test
# that fails. We want to know about all failures, but we also want to
# run later tests even if earlier ones fail.
rc=0
GIT_SKIP_TESTS="${GIT_SKIP_TESTS}${GIT_SKIP_TESTS:+ }${main_run_skip_tests[*]}" GIT_TEST_OPTS='--tee -l' DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="--jobs $(($(nproc 2>/dev/null) + 1)) --timer" make -k test || rc=$?
# Run t0021 if it was skipped earlier.
if [[ "$ARCH_x86_64" ]]; then
( cd ${B}/t && echo t0021-*.sh && ./t0021-*.sh --tee -l; ) || rc="$?"
fi
# Run t7900 if there's at least 10GB free disk space. It's much more
# likely that that's the case now other tests aren't running at the
# same time.
if (( $(($(stat -f --format="%a*%S" .) / 1024 / 1024 / 1024)) > 10 )); then
( cd ${B}/t && echo t7900-*.sh && ./t7900-*.sh --tee -l; ) || rc="$?"
else
echo 'Skipping t7900 due to lack of disk space'
rc=1
fi
return "$rc"
}
# vim: set noexpandtab tabstop=8 listchars=tab\:\ \ ,trail\:-,lead\:-: