3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

msys2でlibgit2のビルドとgit2goのインストール

Last updated at Posted at 2017-02-12

MSYS2上でlibgit2をビルドし、git2goをインストールする方法いつも忘れるのでメモ。

ビルド手順

(1) ビルド環境の準備

$ pacman -S mingw-w64-x86_64-{gcc,make,cmake,pkg-config,glib2,curl,zlib,http-parser,openssl,libssh2}

(2) libgit2のビルド

$ git clone https://github.com/libgit2/libgit2/
$ cd libgit2
$ git checkout v0.25.1
$ mkdir build && cd build
$ start cmake .. -G "MinGW Makefiles"  -DCMAKE_INSTALL_PREFIX=/mingw64/x86_64-w64-mingw32
$ cmake --build . --target install

1回目のcmakeの呼び出し時をstart経由にしているのは、cmakeはshがPATHに含まれているとエラーになるため。

(3) git2goのインストール

$ PKG_CONFIG_PATH=/mingw64/x86_64-w64-mingw32/lib/pkgconfig/ go get gopkg.in/libgit2/git2go.v25

参考リンク

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?