Skip to content

Commit

Permalink
Merge branch 'bug/make' into 'master'
Browse files Browse the repository at this point in the history
真是受够了这个 libgit2 的问题

core依赖libgit2-v0.23.4,然而手动编译搞来搞去要么提示头文件找不到要么提示动态链接库找不到(哪怕我给了 `-DCMAKE_INSTALL_PREFIX=/usr/local/lib` )

用 git apply 强行让brew回滚版本。。发现还挺好用的,于是推荐一下这种手段,在回滚版本的同时不会把自己的开发环境搞得脏兮兮的。

@platform

See merge request !21
  • Loading branch information
timfeirg committed Oct 31, 2016
2 parents a0da712 + b1f64bd commit 8bc542b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 33 deletions.
37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,10 @@ Core
We use v0.23.4 because v0.24 sucks

```shell
$ wget https://github.com/libgit2/libgit2/archive/v0.23.4.zip
$ unzip v0.23.4.zip
```
Install dependencies: `libssh2`, `http-parser`, `cmake`, `libcurl`.

```shell
On Mac OSX:
$ brew install libssh2 http-parser cmake libcurl

On CentOS:
$ yum install libssh2-devel http-parser cmake libcurl-devel
```
Then install libgit2.

```shell
$ cmake . -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DUSE_SSH=YES
$ make && make install
```
Note on Mac OSX may need to set CFLAGS="-std=c99".
Now libgit2 is installed under `/usr/local/lib` as default. We still need to set pkg-config and link dynamic libraries.

```shell
On Mac OSX:
$ cd /usr/local/lib/pkgconfig
$ ln -s /path/to/libgit2/pkgconfig/libgit2.pc libgit2.pc
$ cd /usr/local/lib
$ ln -s /path/to/libgit2/libgit2.23.dylib libgit2.23.dylib

On CentOS:
$ cd /usr/lib64/pkgconfig/
$ ln -s /usr/local/lib/pkgconfig/libgit2.pc libgit2.pc
$ cd /usr/lib64
$ ln -s /usr/local/lib/libgit2.so.23 libgit2.so.23
cp devtools/libgit2.rb.patch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git apply libgit2.rb.patch && git add libgit2.rb && git commit -m "patch libgit2 version for eru-core" && rm libgit2.rb.patch
cd -
```

## setup dev environment
Expand Down
15 changes: 15 additions & 0 deletions devtools/libgit2.rb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/Formula/libgit2.rb b/Formula/libgit2.rb
index b91f4ff..45205f1 100644
--- a/Formula/libgit2.rb
+++ b/Formula/libgit2.rb
@@ -1,8 +1,8 @@
class Libgit2 < Formula
desc "C library of Git core methods that is re-entrant and linkable"
homepage "https://libgit2.github.com/"
- url "https://github.com/libgit2/libgit2/archive/v0.24.2.tar.gz"
- sha256 "00f0a7403143fba69601accc80cacf49becc568b890ba232f300c1b2a37475e6"
+ url "https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz"
+ sha256 "c7f5e2d7381dbc4d7e878013d14f9993ae8a41bd23f032718e39ffba57894029"
head "https://github.com/libgit2/libgit2.git"

bottle do

0 comments on commit 8bc542b

Please sign in to comment.