rgburke / grv

GRV is a terminal interface for viewing git repositories
GNU General Public License v3.0
4.03k stars 99 forks source link

Compile under go1.11 with libgit2-dev #75

Open vit1251 opened 6 years ago

vit1251 commented 6 years ago

I checkout master source code and try compile with go-1.11 with go.mod dependency manager and receive error:

could not determine kind of name for C.git_blob_create_fromstream
could not determine kind of name for C.git_blob_create_fromstream_commit

Do u have version working without patch OS system library?

rgburke commented 6 years ago

Please try using make install to build grv. Using the Makefile method will fetch all dependecies (as they're git submodules) and build them. A static version of libgit2 will be built and included in the final grv binary.

vit1251 commented 6 years ago

make command right now require checkout and compile inside GOPATH directory. It creates inconvenience. go-1.11 resolve this problem.

Version go-1.11 resolve dependency issue for you and provide comfortable and developer common way to dependencies resolution without reinvent the wheel: custom scenarios, handy source code/module manipulation and etc..

Another one issue is make stop on recipe "install-static" with Error 2. Last error message about libgit2.pc is no exists on execution pkg-config goal with exit status 1.

What you think about original problem in 1-th post? How I can fix it?

rgburke commented 6 years ago

The issue is that GRV is tied to git2go (and so libgit2) v0.27 but the version of libgit2 on your system will be different. On my system libgit2 v0.26 is installed, so if I perform the following steps then it will build:

sed -i 's/git2go\.v27/git2go.v26/g' cmd/grv/*.go
go get gopkg.in/libgit2/git2go.v26
go build ./cmd/grv

I agree that modules are the way to proceed in future. However I'm not sure they'll help in this case yet. For example, git2go doesn't tag any releases, they're only available as branches. This is why the import statements in the source code are tied to a specific version, and why we had to do the sed command above.