Skip to content
Merged
31 changes: 16 additions & 15 deletions mingw-w64-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ pkgver=2.52.0.1
pkgrel=1
pkgdesc="The fast distributed version control system (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://gitforwindows.org/"
license=('GPL2')

options=()
makedepends=('python' 'less' 'openssh' 'patch' 'make' 'tar' 'diffutils'
'ca-certificates' 'xmlto' 'docbook-xsl-ns'
makedepends=('git' 'openssh' 'ca-certificates' 'xmlto' 'docbook-xsl' 'docbook-xsl-ns'
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-expat>=2.0"
"${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-pcre2"
"${MINGW_PACKAGE_PREFIX}-asciidoctor")
install=git.install

optdepends=("mintty")

source=("${_realname}"::"git+https://github.com/git-for-windows/git.git#tag=v$tag"
'git-for-windows.ico'
'start-ssh-agent.cmd'
Expand Down Expand Up @@ -67,7 +70,7 @@ sha256sums=('d21ed5eb108646012a7f59c354b3dd45f6b6138de6e2b582906517365962b18f'
'db754d6fe6722ad54d43df15ee93b1d9cead406158ed84dcbf35e5b4225469ed'
'cbed8b133eb9eec9972f146be5c3ff49db29b2fff8ab9c87a6d0c646c08a5128'
'027155aa6ca5f11ad7bcb89550a470935a9f22a9d5b3ab80a9eb209983258c1f'
'387cbdb711453a7c41830558c351e448952bb7978158c258df093b1742543dfe'
'386e965e184f657a5373b117c59e9e8711713e09177623a77718358cbc46296e'
'7413506c59d25621e475aa45447993748332c72cfbb4cf94cce6bee6f1218a09'
'6d83e1cb1acdb6eb1f2d5cb9299298e57680f5ca43d43c3e67c9da17f21b9b01')

Expand All @@ -76,7 +79,7 @@ STRIP=
STRIP_OPTS=
LDFLAGS=

if test -n "$WITHOUT_PDBS"
if test -z "$WITH_PDBS"
then
options+=('strip')
elif [[ "$MSYSTEM" == CLANG* ]]
Expand All @@ -100,6 +103,7 @@ prepare () {
cd "$srcdir/git" &&

cat >config.mak <<-EOF
CC = $CC
USE_ASCIIDOCTOR = YesPlease
COMPAT_CFLAGS += $COMPAT_CFLAGS
LDFLAGS = $LDFLAGS
Expand Down Expand Up @@ -131,8 +135,8 @@ build() {
# 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 &&
make -C contrib/credential/wincred clean &&
make -C contrib/credential/wincred &&

targets= &&
case "${pkgname[@]}" in ''|*-git|*-git\ *) targets="$targets all";; esac &&
Expand Down Expand Up @@ -180,8 +184,9 @@ package_git () {

# Remove git-svn (packaged separately)
rm -f "$pkgdir/$MINGW_PREFIX/libexec/git-core/git-svn"

# Remove Git.pm and other Perl modules (packaged separately in git-perl & git-svn)
rm -rf "$pkgdir/$MINGW_PREFIX"/share/perl5
make -j1 -f ../mingw-w64-git.mak DESTDIR="$pkgdir" uninstall-perl-modules

# Remove git-archimport (packaged separately)
rm -f "$pkgdir/$MINGW_PREFIX/libexec/git-core/git-archimport"
Expand Down Expand Up @@ -328,8 +333,6 @@ package_git-perl () {

# Install Git.pm and related Perl modules (excluding Git::SVN)
make -j1 -f ../mingw-w64-git.mak DESTDIR="$pkgdir" install-perl-module
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type f -path "*/Git/SVN*" -delete
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type d -empty -delete
}

package_git-send-email () {
Expand Down Expand Up @@ -386,9 +389,7 @@ package_git-svn () {
install -m755 git-svn "$pkgdir/$MINGW_PREFIX/libexec/git-core/"

# Install Git::SVN Perl modules only
make -j1 DESTDIR="$pkgdir" -f ../mingw-w64-git.mak install-perl-module
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type f ! -path "*/Git/SVN*" -delete
find "$pkgdir/$MINGW_PREFIX/share/perl5" -type d -empty -delete
make -j1 DESTDIR="$pkgdir" -f ../mingw-w64-git.mak install-perl-svn-module

# Install documentation
install -d -m755 "$pkgdir/$MINGW_PREFIX/share/man/man1"
Expand Down Expand Up @@ -488,7 +489,7 @@ package_git-gui () {

package_git-p4 () {
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}"
"python")
"${MINGW_PACKAGE_PREFIX}-python")
pkgdesc="Perforce support for Git (mingw-w64)"

cd "$srcdir"/git
Expand Down
15 changes: 15 additions & 0 deletions mingw-w64-git/mingw-w64-git.mak
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ install-perl-module:
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
(cd perl/build/lib && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type f -path "*/Git/SVN*" -delete
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete

install-perl-svn-module:
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perllibdir_SQ)'
(cd perl/build/lib && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(perllibdir_SQ)' && umask 022 && $(TAR) xof -)
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type f ! -path "*/Git/SVN*" -delete
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete

uninstall-perl-modules:
rm $(patsubst perl/%.pm,'$(DESTDIR_SQ)$(perllibdir_SQ)/%.pm',$(LIB_CPAN))
rm '$(DESTDIR_SQ)$(perllibdir_SQ)/Git.pm'
rm -r '$(DESTDIR_SQ)$(perllibdir_SQ)/Git'
find '$(DESTDIR_SQ)$(perllibdir_SQ)' -type d -empty -delete
endif

install-pdbs:
Expand Down