diff --git a/Building-Git.md b/Building-Git.md new file mode 100644 index 0000000..7a14d2f --- /dev/null +++ b/Building-Git.md @@ -0,0 +1,40 @@ +We build Git for Windows using [MSys2](https://msys2.github.io/). + +As we are in the process of switching away from msysGit as our development environment, the following instructions are a little rough on the edges. This situation should become better over the next months. + +# Installing a build environment + +1. Install MSys2 from https://msys2.github.io/, into `C:/msys32` and `C:/msys64` (if you only want to build for one architecture, you can skip the other one). This will install three Shells into the Start Menu: the *MSys*, the *MinGW 32* and the *MinGW 64* Shell. To build Git, you should start the *MinGW* shell corresponding to the architecture of the installed MSys2. + +2. Add the Git for Windows-specific Pacman repository: insert the following lines into your `/etc/pacman.conf`, **before** the `[mingw]` line (it is important : +> [git-for-windows] +> Server = https://git-for-windows.github.io/pacman-repository/$arch +> SigLevel = Optional + +3. Update via Pacman: `pacman -Syu` (as the msys2-runtime gets updated, the *MSys Shell* needs to be restarted afterwards). + +# Build Git + +1. Install (MSys2) Git: `pacman -S git`. That Git is based on MSys2, i.e. it is *not* a MinGW Git. However, we need a working Git to check out the Git source, eh? :grinning: + +2. Clone Git: `cd /usr/src/ && git clone https://github.com/git-for-windows/git`. + +3. Install the Toolchain (gcc etc): `pacman -S mingw-w64--toolchain`, where `` is either `i686` or `x86-64`. + +4. Install Git's dependencies: `pacman -S python less openssh patch make perl-Error perl perl-Authen-SASL perl-libwww perl-MIME-tools perl-Net-SMTP-SSL perl-TermReadKey winpty-git mingw-w64--curl mingw-w64--expat mingw-w64--openssl mingw-w64--tcl` + +5. Temporarily: In /usr/src/git/, check out the `tentative-2.3.0` branch: `git remote add -f dscho https://github.com/dscho/git && git checkout -t dscho/tentative-2.3.0`. + +6. Build Git. Some dependencies might be missing, still, e.g. subversion, gettext, man, mingw-w64--gdb, mingw-w64--pcre, binutils or texinfo (these packages were installed manually before the first successful Git for Windows build). + +# Build the `msys2-⁠runtime` + +1. Install the MSys2 Toolchain: `pacman -⁠S gcc binutils make`. + +2. Clone the MSYS2-packages repository: `cd /usr/src && git clone https://github.com/git-for-windows/MSYS2-packages`. + +3. Temporarily: In MSYS2-packages, check out the `msys-runtime` branch: `git remote add -f dscho https://github.com/dscho/MSYS2-packages && git checkout -t dscho/msys-runtime`. + +4. Build the package: `makepkg -⁠s`. + +(You might need to call `pacman -S ca-certificates` to reinstall that package, it seems that it was not installed properly at least in one MSys2 32-bit setup.) \ No newline at end of file