filhodanuvem / gitql

💊 A git query language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't build on Windows with Git bash and MinGW

jcubic opened this issue · comments

Here is a question on StackOverflow with answer suggesting that this is a problem with the project.
Can't run Cmake on windows with MinGW and git bash

Did you fix it @jcubic?

@luizperes No, I don't know how to create CMakeLists.txt file.

I will try to replicate and fix that myself and answer you back @jcubic

Anyone alive here? I built it with MSYS toolchain, with some trouble. Do you want a PR?

So, just for the records: I forked both gitql and git2go (see in my github dir), and made some changes in the branch issue-42-by-budden.

I use -G "MSYS Makefiles" to build, which I try to enable conditionally under MINGW only.
For the successul build, one has to install some packages:

pacman -S openssl openssl-devel libssh2 libssh2-devel

Without that, go build would pointlessly complain about PKG_CONFIG_PATH

Also I changed my /etc/profile:

  • ORIGINAL_PATH altered to contain paths to go and to git (go and git were installed outside of MSYS) so that MSYS recognizes them,
  • export GOPATH=/home/my-user-name/go was placed near huge export statement.

Also cmake itself seem to be not configured well by pacman -S mingw-w64-x86_64-cmake installer, so I did the following (maybe it's only necessary for MSVS build, I didn't check) :

ln -s `which cmake` /usr/bin/cmake
export PATH=$PATH:/mingw64/bin
ln -s /mingw64/share/cmake-3.12 /usr/share/cmake-3.12

Finally, I didn't check make install. To run gitql.exe from the build directory, one has to manually copy libgit2/install/bin/libgit2.dll to the root of gitql sources (near gitql.exe).

And P.S. - I didn't check if Linux build is not broken :)

Hey @budden ! It's really good that you made gitql running on windows, a pull request is really welcome, can you open it? I will check if the build for linux/mac still working (actually we need to put the build process in CI process with github actions, for example).

My mistake, You already did it on cloudson/git2go. I will check it asap and come back here. Thanks a lot.

Yeah, I opened PR after posting the comment. Now I checked "make install" in the MinGW - it does not work and it seems that MinGW does not support /usr/local/lib and /usr/local/bin, also I didn't yet found ldconfig. So some more work is required here.

Updated the PR - I conditionalized installation process, so for MinGW it is very simplified and seem to work. Again, I'm not an expert in MinGW, only glanced at stackoverflow and googled throw docs. It "just works" here and now.

Seem to have installed on Linux successfully.

That's cool, thanks again.

With all the help of @budden , I'm closing this long issue. Thank you guy.