forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 45
/
PKGBUILD
347 lines (289 loc) · 9.54 KB
/
PKGBUILD
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# Maintainer: Martell Malone <[email protected]>
# Maintainer: Ray Donnelly <[email protected]>
_realname=git
pkgbase="mingw-w64-${_realname}"
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-doc-html"
"${MINGW_PACKAGE_PREFIX}-${_realname}-doc-man"
"${MINGW_PACKAGE_PREFIX}-${_realname}-test-artifacts")
tag=2.47.0.windows.2
pkgver=2.47.0.2.1f8a83cba6
pkgrel=1
pkgdesc="The fast distributed version control system (mingw-w64)"
arch=('any')
url="https://git-for-windows.github.io/"
license=('GPL2')
options=()
makedepends=('python' 'less' 'openssh' 'patch' 'make' 'tar' 'diffutils'
'ca-certificates' 'xmlto' "${MINGW_PACKAGE_PREFIX}-asciidoctor")
install=git.install
case "$(printf "%s\n%s\n" "$pkgver" "2.18.0" | sort -V)" in
2.18.0*) pcre="${MINGW_PACKAGE_PREFIX}-pcre2";;
*) pcre="${MINGW_PACKAGE_PREFIX}-pcre";;
esac
depends=("${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-ca-certificates"
"${MINGW_PACKAGE_PREFIX}-expat>=2.0"
"${MINGW_PACKAGE_PREFIX}-openssl"
"$pcre"
"${MINGW_PACKAGE_PREFIX}-tcl"
"${MINGW_PACKAGE_PREFIX}-tk"
"perl-Error"
"perl>=5.14.0"
"perl-Authen-SASL"
"perl-libwww"
"perl-MIME-tools"
"perl-Net-SMTP-SSL"
"perl-TermReadKey")
optdepends=("mintty")
source=("${_realname}"::"git+https://github.com/git-for-windows/git.git#tag=v$tag"
'git-for-windows.ico'
'start-ssh-agent.cmd'
'start-ssh-pageant.cmd'
'git-wrapper.c'
'git-bash.rc'
'git-bash.txt'
'git-cmd.rc'
'git-wrapper.rc'
'gitk.rc'
'compat-bash.rc'
'tig.rc'
'mingw-w64-git.mak'
'cv2pdb-strip'
'edit-git-bash.c')
sha256sums=('SKIP'
'a9dcba5aebc93ae7aacdee03275780fc6c0f15e88fda30c93041e75851e75090'
'f16b345aba17acd124ab5940635dfa2d87445df73eedbeb80e0285f29c85415a'
'80b0b11efe5a2f9b4cd92f28c260d0b3aad8b809c34ed95237c59b73e08ade0b'
'20613488bbd66bced2ef786448dc335c9cc7a5ef8be800e0d5bab83e36faf584'
'dab3e41e935a33f443a4ff4ef4ce92c191b6d952d9eb37e14885540ad5af99ed'
'c975292adae1f2666f07f8ee9b7d50576da249d9151c6bd211602adc8d37b6ab'
'53e630f581bee400100d074189754413afb6670ba1c09a5a3a09c5b575e41e60'
'db754d6fe6722ad54d43df15ee93b1d9cead406158ed84dcbf35e5b4225469ed'
'db754d6fe6722ad54d43df15ee93b1d9cead406158ed84dcbf35e5b4225469ed'
'cbed8b133eb9eec9972f146be5c3ff49db29b2fff8ab9c87a6d0c646c08a5128'
'027155aa6ca5f11ad7bcb89550a470935a9f22a9d5b3ab80a9eb209983258c1f'
'5618204ad488f053430131ab3b12b89e96bdff87856bbec4f27f8efa9f5c17dc'
'7413506c59d25621e475aa45447993748332c72cfbb4cf94cce6bee6f1218a09'
'6d83e1cb1acdb6eb1f2d5cb9299298e57680f5ca43d43c3e67c9da17f21b9b01')
COMPAT_CFLAGS=
STRIP=
STRIP_OPTS=
LDFLAGS=
if [[ "$MSYSTEM" == CLANG* && -z "$WITHOUT_PDBS" ]]
then
pkgname+=("${MINGW_PACKAGE_PREFIX}-${_realname}-pdb")
options+=('!strip')
STRIP=llvm-strip
STRIP_OPTS=--strip-debug
LDFLAGS="-Wl,-pdb=" # Ensures that Clang generates PDB files
elif test -z "$WITHOUT_PDBS"
then
pkgname+=("${MINGW_PACKAGE_PREFIX}-${_realname}-pdb")
makedepends+=("${MINGW_PACKAGE_PREFIX}-cv2pdb")
options+=('!strip')
COMPAT_CFLAGS="-gdwarf-4 -gstrict-dwarf" # cv2pdb cannot really handle DWARF5 yet
STRIP="${BASH_SOURCE%/*}/src/cv2pdb-strip"
else
options+=('strip')
fi
pkgver() {
cd "$srcdir/git"
basever=${tag%.windows.*}
test "$tag" = "$basever" ||
basever="$basever.${tag##*.windows.}"
basever="${basever/-/.}"
printf "%s.%s" "${basever}" "$(git rev-parse --short HEAD)"
}
case "$CARCH" in
i686)
SHAREDIR=/mingw32/share/git
;;
x86_64)
SHAREDIR=/mingw64/share/git
;;
aarch64)
SHAREDIR=/clangarm64/share/git
;;
esac
prepare () {
cd "$srcdir/git" &&
cat >config.mak <<-EOF
USE_ASCIIDOCTOR = YesPlease
COMPAT_CFLAGS += $COMPAT_CFLAGS
LDFLAGS = $LDFLAGS
EOF
cp ../git-bash.txt Documentation/
# Slightly dirty workaround for missing docbook-xsl-ns
grep -q http://docbook.sourceforge.net/release/xsl-ns/current /etc/xml/catalog || {
(cd /usr/share/xml/ &&
test -d docbook-xsl-ns-1.78.1 ||
curl -L https://sourceforge.net/projects/docbook/files/docbook-xsl-ns/1.78.1/docbook-xsl-ns-1.78.1.tar.bz2/download |
tar xjf -)
for rewrite in System URI
do
xmlcatalog --noout --add "rewrite$rewrite" \
http://docbook.sourceforge.net/release/xsl-ns/current \
/usr/share/xml/docbook-xsl-ns-1.78.1 \
/etc/xml/catalog
done
}
}
build() {
test -z "$PARALLEL_BUILD" || {
echo "WARNING: PARALLEL_BUILD is deprecated. Use MAKEFLAGS=-j15 instead" >&2
export MAKEFLAGS="$PARALLEL_BUILD $MAKEFLAGS"
}
export PYTHON_PATH=/usr/bin/python2
cd "$srcdir/git"
if test false != "$(git config core.autocrlf)"
then
git config core.autocrlf false
rm .git/index
git reset --hard
fi
# Git wants to decide itself whether to use ANSI stdio emulation or not
CPPFLAGS="$(echo "$CPPFLAGS" |
sed 's/-D__USE_MINGW_ANSI_STDIO\(=[0-9]*\)\?//')"
# Make git-bash.exe first, to avoid triggering `* new link flags`
rm -f *.res &&
make -f ../mingw-w64-git.mak git-wrapper.exe \
git-bash.exe git-cmd.exe compat-bash.exe \
cmd/git.exe cmd/gitk.exe cmd/git-gui.exe \
cmd/git-receive-pack.exe cmd/git-upload-pack.exe \
cmd/tig.exe edit-git-bash.exe &&
rm -f *.res &&
# Also build git-credential-wincred.exe before the rest, so that those
# LDFLAGS *really* do not cause `git.exe` to be re-linked after it was
# stripped.
export PATH="$MINGW_PREFIX/bin:$PATH"
CC=gcc make -C contrib/credential/wincred clean &&
CC=gcc make -C contrib/credential/wincred &&
targets= &&
case "${pkgname[@]}" in ''|*-git|*-git\ *) targets="$targets all";; esac &&
case "${pkgname[@]}" in ''|*html*) targets="$targets html";; esac &&
case "${pkgname[@]}" in ''|*man*) targets="$targets man";; esac &&
counter=0 &&
while ! make $targets
do
counter=$(($counter+1))
test $counter -lt 5 || {
echo "Could not build (tried 5 times)" >&2
exit 1
}
done &&
case "${pkgname[@]}" in *pdb*)
make -f ../mingw-w64-git.mak STRIP="$STRIP" STRIP_OPTS=$STRIP_OPTS strip-all &&
if [[ "$MSYSTEM" == CLANG* ]]; then
# Clang doesn't generate PDBs for the files below, because they're hard linked to git-remote-http.
for i in git-remote-https.pdb git-remote-ftp.pdb git-remote-ftps.pdb
do
ln git-remote-http.pdb $i ||
return 1
done
fi
;;
esac &&
case " $targets " in
*" all "*)
make -f ../mingw-w64-git.mak sign-executables &&
make -f ../mingw-w64-git.mak print-builtins | tr ' ' '\n' > builtins.txt
;;
esac
}
package_git () {
export PYTHON_PATH=/usr/bin/python2
cd "$srcdir"/git
make -j1 DESTDIR="$pkgdir" install
# completions
PREFIX="$(expr "$(cat < GIT-PREFIX)" : '[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*')"
install -d "$pkgdir/$PREFIX/share/git/completion/"
install contrib/completion/* "$pkgdir/$PREFIX/share/git/completion/"
# subtree, for backwards-compatibility with MSys2's Git package
make -C contrib/subtree prefix="$pkgdir/$PREFIX" install
# git-credential-wincred.exe
make -C contrib/credential/wincred prefix="$pkgdir/$PREFIX" install
# Git Bash, Git CMD
install -d -m755 $pkgdir$SHAREDIR
install -m755 ../git-for-windows.ico $pkgdir$SHAREDIR
install -m755 git-bash.exe git-cmd.exe $pkgdir
install -m755 edit-git-bash.exe $pkgdir$SHAREDIR
# Compatibility Bash, git-wrapper.exe
install -m755 compat-bash.exe git-wrapper.exe $pkgdir$SHAREDIR
# Install Git wrapper into /cmd/
install -d -m755 $pkgdir/cmd
install -m755 cmd/git.exe cmd/gitk.exe cmd/git-gui.exe \
cmd/git-receive-pack.exe cmd/git-upload-pack.exe \
cmd/tig.exe ../start-ssh-agent.cmd ../start-ssh-pageant.cmd \
$pkgdir/cmd
# Scalar
test ! -x $pkgdir/$PREFIX/bin/scalar.exe ||
install -m755 cmd/git.exe $pkgdir/cmd/scalar.exe
# Install builtins.txt
install -m644 builtins.txt $pkgdir$SHAREDIR
}
package_git-doc-html () {
cd "$srcdir"/git
make DESTDIR="$pkgdir" install-html
# subtree, for backwards-compatibility with MSys2's Git package
make -C contrib/subtree prefix="$pkgdir/$PREFIX" install-html
}
package_git-doc-man () {
cd "$srcdir"/git
make DESTDIR="$pkgdir" install-man
# subtree, for backwards-compatibility with MSys2's Git package
make -C contrib/subtree prefix="$pkgdir/$PREFIX" install-man
}
package_git-test-artifacts () {
cd "$srcdir"/git
make -f ../mingw-w64-git.mak DESTDIR="$pkgdir" install-mingit-busybox-test-artifacts
}
package_git-pdb () {
cd "$srcdir"/git
make -f ../mingw-w64-git.mak DESTDIR="$pkgdir" install-pdbs
}
package_mingw-w64-i686-git () {
package_git
}
package_mingw-w64-i686-git-doc-html () {
package_git-doc-html
}
package_mingw-w64-i686-git-doc-man () {
package_git-doc-man
}
package_mingw-w64-i686-git-test-artifacts () {
package_git-test-artifacts
}
package_mingw-w64-i686-git-pdb () {
package_git-pdb
}
package_mingw-w64-x86_64-git () {
package_git
}
package_mingw-w64-x86_64-git-doc-html () {
package_git-doc-html
}
package_mingw-w64-x86_64-git-doc-man () {
package_git-doc-man
}
package_mingw-w64-x86_64-git-test-artifacts () {
package_git-test-artifacts
}
package_mingw-w64-x86_64-git-pdb () {
package_git-pdb
}
package_mingw-w64-clang-aarch64-git () {
package_git
}
package_mingw-w64-clang-aarch64-git-doc-html () {
package_git-doc-html
}
package_mingw-w64-clang-aarch64-git-doc-man () {
package_git-doc-man
}
package_mingw-w64-clang-aarch64-git-test-artifacts () {
package_git-test-artifacts
}
package_mingw-w64-clang-aarch64-git-pdb () {
package_git-pdb
}