-
Notifications
You must be signed in to change notification settings - Fork 2
/
git.cygport
206 lines (177 loc) · 7.58 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
203
204
205
206
# 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.44.1
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}"
LICENSE='GPL-2.0-only'
PATCH_URI='expect-cygwin-test-failures.patch github-actions-memory.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 gettext"
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*
usr/share/git-core/templates/hooks/*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*"
DEPS_PATH=/usr/libexec/git-core
MAKEOPTS="${MAKEOPTS:+$MAKEOPTS }INSTALLDIRS=vendor"
DIFF_EXCLUDES='configure GIT-VERSION-FILE random_seed trustdb.gpg'
src_compile() {
local dblatex_path found_parserdetails perlpath
# 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="${MAKEOPTS:+$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"')
if [[ -z "$found_parserdetails" ]]; then
perl -MXML::SAX -e "XML::SAX->add_parser(q(XML::SAX::PurePerl))->save_parsers()"
fi
# The configure script is not distributed, and VPATH builds aren't supported
cd "$S"
cygmake configure perllibdir="$PERL_VENDORLIB"
lndirs
cd "$B"
cygconf --with-libpcre
# Make the user manual XML file separately, in an attempt to avoid an
# apparent race condition I see intermittently.
cygmake -C Documentation user-manual.xml
cygmake all html man info 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() {
local t
local -i nproc
local -a known_failures space_hungry_tests
# Use a subshell for this function so it can `cd` safely.
git_test_single_script () (
local script_name="$1"
local timeout="$2"
local script
local -a scripts
cd "$B/t"
scripts=("$script_name"-*.sh)
if (( "${#scripts[*]}" != 1 )); then
warning "Unexpected number of scripts for ${1@Q}: ${#scripts[*]} (${scripts[*]@Q})"
return 1
fi
script="${scripts[0]}"
if ! [[ -x "$script" && -f "$script" ]]; then
warning "Could not find script ${1@Q}: glob found ${scripts[*]@Q}"
return 1
fi
echo "Starting $script"
if [[ "$timeout" ]]; then
echo "Script timeout: $timeout"
time timeout -k5m -v "$timeout" ./"$script" --tee -l
else
echo "Starting $script"
time ./"$script" --tee -l
fi
echo "Finished $script"
)
# 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=(
t0021.12 # https://github.com/cygporter/git/issues/53
t5562 # https://github.com/cygporter/git/issues/54
)
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.
if [[ -v GIT_SKIP_ADDITIONAL_TESTS ]]; then
export GIT_SKIP_TESTS="${GIT_SKIP_TESTS:+$GIT_SKIP_TESTS }${GIT_SKIP_ADDITIONAL_TESTS}"
fi
# Skip tests that need lots of disk space during the main run; we can
# run them later when there's more space available.
space_hungry_tests=(t7508 t7900)
# Temporarily redefine make to have a timeout when it gets called by
# cygmake, after checking that make *is* currently a file executable
# rather than an alias or another function.
[[ "$(type -t make)" = file ]]
make () { timeout -k5m -v 2h make "$@"; }
# Run the main tests in parallel.
nproc="$(nproc 2>/dev/null)"
GIT_SKIP_TESTS="${GIT_SKIP_TESTS:+$GIT_SKIP_TESTS }${space_hungry_tests[*]}" GIT_TEST_OPTS='--tee -l' DEFAULT_TEST_TARGET=prove GIT_PROVE_OPTS="--jobs $(( nproc + 1 )) --timer" cygtest
unset -f make
# Run the space hungry tests now, when there's (hopefully) more space
# available given other tests aren't trying to run at the same time.
for t in "${space_hungry_tests[@]}"; do
df -h .
git_test_single_script "$t" 10m
done
# Clean up the environment.
unset -f git_test_single_script
}
# vim: set noexpandtab tabstop=8 listchars=tab\:\ \ ,trail\:-,lead\:-