Kakoune on Msys2

So, I have to use Windows at work :frowning:
I already have Msys2 installed for git and ctags, and I prefer it to Cygwin for a few other reasons.

I’m just posting this as a discussion for anyone who wants to try to run Kakoune on Msys2, as opposed to Cygwin.

If your curious, here are some of the differences between Msys2 and Cygwin.

Build

To build on Msys2:

  • install Msys2
  • run pacman -S base base-devel msys2-devel gcc git ncurses-devel to install build dependencies
  • checkout Kakoune, and run the following to ensure UNIX line endings
git config core.autocrlf input
find . -type f -not -path "*.git/*" -delete
git checkout .
  • add the following lines under the Cygwin section of the Makefile:
else ifneq (,$(findstring MSYS_NT,$(os)))
    CPPFLAGS += -D_XOPEN_SOURCE=700
    LIBS += -lncursesw -ldbghelp
  • MAKEFLAGS="$MAKEFLAGS -j$(($(nproc)+1))" make test

The build proceeds without problem (not even any warnings). Most of the tests pass, except the ‘indent’ tests and a few ‘regression’ tests.

Notes

  • ConEmu doesn’t like any colorscheme other than default, but mintty is fine.
  • Msys2 doesn’t support symlinks. there are two alternatives: copy instead; or use Windows cmd mklink utility to make native NTFS symlinks (note: I’ve heard there are some limitations to NTFS symlinks, but they seem to work well enough).
  • For some reason indent related tests fail when using make test normally, but pass when using makepkg with the modified AUR PKGBUILD.

Would using junction over mklink yield advantages?

I’m not familiar with junction, so IDK

Here’s a fork of the Arch PKGBUILD, for installing on Msys2.

Edit: all tests passing as of Kakoune git master 4916471029dfa9853473679823bf557bad2c4a52

1 Like