From 62513d51843b2d1c9612fc54ae82f6ef504da004 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 09:54:31 +0100 Subject: [PATCH 01/11] git: build without the `-pdb` package by default This package would require `cv2pdb`, which is not available in regular MSYS2' (but only in Git for Windows') Pacman repositories. Besides, there is no precedent in MSYS2 for building `pdb` files, unlike Git for Windows, where many users are unfamiliar with `gdb` and much more familiar with debugging tools that require the symbols in such files. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index d7afbd14737b4..033fc6c21f6ae 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -76,7 +76,7 @@ STRIP= STRIP_OPTS= LDFLAGS= -if test -n "$WITHOUT_PDBS" +if test -z "$WITH_PDBS" then options+=('strip') elif [[ "$MSYSTEM" == CLANG* ]] From b08b58e4907d71f1b4cf6f8d0f4041139ff4cd0f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 10:08:58 +0100 Subject: [PATCH 02/11] git: correct the dependency on Python Python is not actually a _build-time_ dependency, and we should prefer the MINGW variant of Python. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 033fc6c21f6ae..c851a2965ab6f 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -26,7 +26,7 @@ url="https://gitforwindows.org/" license=('GPL2') options=() -makedepends=('python' 'less' 'openssh' 'patch' 'make' 'tar' 'diffutils' +makedepends=('less' 'openssh' 'patch' 'make' 'tar' 'diffutils' 'ca-certificates' 'xmlto' 'docbook-xsl-ns' "${MINGW_PACKAGE_PREFIX}-asciidoctor") install=git.install @@ -488,7 +488,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 From f16c5cc9a60bd88511d8fdc0a2d35b90459990b6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 10:11:40 +0100 Subject: [PATCH 03/11] git: add missing build-time dependencies We do require a C compiler to build it ;-) Also, we need PCRE2 and friends already when compiling... In Git for Windows, these dependencies are implicitly met, and therefore I forgot to add them as an explicit dependency. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index c851a2965ab6f..25af9e7d3ccdd 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -28,6 +28,11 @@ license=('GPL2') options=() makedepends=('less' 'openssh' 'patch' 'make' 'tar' 'diffutils' 'ca-certificates' 'xmlto' '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 From 486bce87dd7eda01f5a750145e5856932716ab12 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 10:53:49 +0100 Subject: [PATCH 04/11] git: drop build-time dependencies covered by base-devel They are installed always, no need to specify them explicitly. Signed-off-by: Johannes Schindelin Co-authored-by: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com> --- mingw-w64-git/PKGBUILD | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 25af9e7d3ccdd..904ee5d6622f5 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -26,8 +26,7 @@ url="https://gitforwindows.org/" license=('GPL2') options=() -makedepends=('less' 'openssh' 'patch' 'make' 'tar' 'diffutils' - 'ca-certificates' 'xmlto' 'docbook-xsl-ns' +makedepends=('openssh' 'ca-certificates' 'xmlto' 'docbook-xsl-ns' "${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-curl" "${MINGW_PACKAGE_PREFIX}-expat>=2.0" From 51416a8e6c3b8a15b4245fc1b9b20abe230e24fd Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 10:54:42 +0100 Subject: [PATCH 05/11] git: declare the `git` dependency to be able to clone the source repo The `mingw-w64-git` package definition is a bit of a unicorn in that it is not only used to build Git for Windows' official packages, but also its snapshots. Even for the official packages, there is usually no downloadable source code archive because the tag is only published once the build was successful, the manual testing gate passed, and the artifacts are uploaded to a new GitHub Release. As such, the package definition cannot rely on the common pattern to download a published source code archive. Instead, it relies on a Git clone, which means that `git` is required to clone it. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 904ee5d6622f5..4f7e76cde10eb 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -26,7 +26,7 @@ url="https://gitforwindows.org/" license=('GPL2') options=() -makedepends=('openssh' 'ca-certificates' 'xmlto' 'docbook-xsl-ns' +makedepends=('git' 'openssh' 'ca-certificates' 'xmlto' 'docbook-xsl-ns' "${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-curl" "${MINGW_PACKAGE_PREFIX}-expat>=2.0" From b91b03574e78cadc7167a11a0d4a2f987d6305f7 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 10:59:01 +0100 Subject: [PATCH 06/11] git: remove the optional `mintty` dependency This is already satisfied by MSYS2's base installation. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 2 -- 1 file changed, 2 deletions(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 4f7e76cde10eb..385b6c87b1e2d 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -35,8 +35,6 @@ makedepends=('git' 'openssh' 'ca-certificates' 'xmlto' 'docbook-xsl-ns' "${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' From 2a8846781f0611e9eba43efb77887216707c0bf9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 11:10:50 +0100 Subject: [PATCH 07/11] git: add the `docbook-xsl` build-time dependency This is needed to render Git's user manual. Co-authored-by: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com> Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 385b6c87b1e2d..12759b8a92e6d 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -26,7 +26,7 @@ url="https://gitforwindows.org/" license=('GPL2') options=() -makedepends=('git' 'openssh' '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" From ee351ca7897ce556e5f0891869b4a761cff89a96 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 11:35:41 +0100 Subject: [PATCH 08/11] git: declare which CPU architectures to build for (all of 'em) Co-authored-by: Maksim Bondarenkov <119937608+ognevny@users.noreply.github.com> Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 12759b8a92e6d..31ada94c3d758 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -22,6 +22,7 @@ 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') From f09c2cff117e0f8d5f968221fdded1db043cf74c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 12:49:38 +0100 Subject: [PATCH 09/11] git: do use the correct C compiler On `CLANG*`, we do not want to use `gcc`... Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 31ada94c3d758..10a4ce9833fb0 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -103,6 +103,7 @@ prepare () { cd "$srcdir/git" && cat >config.mak <<-EOF + CC = $CC USE_ASCIIDOCTOR = YesPlease COMPAT_CFLAGS += $COMPAT_CFLAGS LDFLAGS = $LDFLAGS From 69f4dd8cd2de6f404484cce7d6ea24bd6b88eecb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 11:07:32 +0100 Subject: [PATCH 10/11] git: avoid forcing to compile `wincred` with GCC Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 10a4ce9833fb0..36d686cb4fc54 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -135,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 && From 50c500f27054647587daa6cddda2c6a8e15ce97c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 20 Nov 2025 13:23:37 +0100 Subject: [PATCH 11/11] git: make the Perl module handling more robust The differences between CLANG64's Perl setup and MINGW64's point out some fragile logic I introduced in order to separate the `Git` Perl module's files from the `Git::SVN` ones. Let's move that logic into the Makefile which has all the relevant information to make the logic more robust. Signed-off-by: Johannes Schindelin --- mingw-w64-git/PKGBUILD | 11 ++++------- mingw-w64-git/mingw-w64-git.mak | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/mingw-w64-git/PKGBUILD b/mingw-w64-git/PKGBUILD index 36d686cb4fc54..56ee72e534076 100644 --- a/mingw-w64-git/PKGBUILD +++ b/mingw-w64-git/PKGBUILD @@ -70,7 +70,7 @@ sha256sums=('d21ed5eb108646012a7f59c354b3dd45f6b6138de6e2b582906517365962b18f' 'db754d6fe6722ad54d43df15ee93b1d9cead406158ed84dcbf35e5b4225469ed' 'cbed8b133eb9eec9972f146be5c3ff49db29b2fff8ab9c87a6d0c646c08a5128' '027155aa6ca5f11ad7bcb89550a470935a9f22a9d5b3ab80a9eb209983258c1f' - '387cbdb711453a7c41830558c351e448952bb7978158c258df093b1742543dfe' + '386e965e184f657a5373b117c59e9e8711713e09177623a77718358cbc46296e' '7413506c59d25621e475aa45447993748332c72cfbb4cf94cce6bee6f1218a09' '6d83e1cb1acdb6eb1f2d5cb9299298e57680f5ca43d43c3e67c9da17f21b9b01') @@ -184,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" @@ -332,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 () { @@ -390,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" diff --git a/mingw-w64-git/mingw-w64-git.mak b/mingw-w64-git/mingw-w64-git.mak index 43030387fa7b2..2baec5cd170dc 100644 --- a/mingw-w64-git/mingw-w64-git.mak +++ b/mingw-w64-git/mingw-w64-git.mak @@ -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: