Skip to content

Commit 8bc542b

Browse files
committed
Merge branch 'bug/make' into 'master'
真是受够了这个 libgit2 的问题 core依赖libgit2-v0.23.4,然而手动编译搞来搞去要么提示头文件找不到要么提示动态链接库找不到(哪怕我给了 `-DCMAKE_INSTALL_PREFIX=/usr/local/lib` ) 用 git apply 强行让brew回滚版本。。发现还挺好用的,于是推荐一下这种手段,在回滚版本的同时不会把自己的开发环境搞得脏兮兮的。 @platform See merge request !21
2 parents a0da712 + b1f64bd commit 8bc542b

File tree

2 files changed

+19
-33
lines changed

2 files changed

+19
-33
lines changed

README.md

+4-33
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,10 @@ Core
55
We use v0.23.4 because v0.24 sucks
66

77
```shell
8-
$ wget https://github.com/libgit2/libgit2/archive/v0.23.4.zip
9-
$ unzip v0.23.4.zip
10-
```
11-
Install dependencies: `libssh2`, `http-parser`, `cmake`, `libcurl`.
12-
13-
```shell
14-
On Mac OSX:
15-
$ brew install libssh2 http-parser cmake libcurl
16-
17-
On CentOS:
18-
$ yum install libssh2-devel http-parser cmake libcurl-devel
19-
```
20-
Then install libgit2.
21-
22-
```shell
23-
$ cmake . -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DUSE_SSH=YES
24-
$ make && make install
25-
```
26-
Note on Mac OSX may need to set CFLAGS="-std=c99".
27-
Now libgit2 is installed under `/usr/local/lib` as default. We still need to set pkg-config and link dynamic libraries.
28-
29-
```shell
30-
On Mac OSX:
31-
$ cd /usr/local/lib/pkgconfig
32-
$ ln -s /path/to/libgit2/pkgconfig/libgit2.pc libgit2.pc
33-
$ cd /usr/local/lib
34-
$ ln -s /path/to/libgit2/libgit2.23.dylib libgit2.23.dylib
35-
36-
On CentOS:
37-
$ cd /usr/lib64/pkgconfig/
38-
$ ln -s /usr/local/lib/pkgconfig/libgit2.pc libgit2.pc
39-
$ cd /usr/lib64
40-
$ ln -s /usr/local/lib/libgit2.so.23 libgit2.so.23
8+
cp devtools/libgit2.rb.patch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
9+
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
10+
git apply libgit2.rb.patch && git add libgit2.rb && git commit -m "patch libgit2 version for eru-core" && rm libgit2.rb.patch
11+
cd -
4112
```
4213

4314
## setup dev environment

devtools/libgit2.rb.patch

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/Formula/libgit2.rb b/Formula/libgit2.rb
2+
index b91f4ff..45205f1 100644
3+
--- a/Formula/libgit2.rb
4+
+++ b/Formula/libgit2.rb
5+
@@ -1,8 +1,8 @@
6+
class Libgit2 < Formula
7+
desc "C library of Git core methods that is re-entrant and linkable"
8+
homepage "https://libgit2.github.com/"
9+
- url "https://github.com/libgit2/libgit2/archive/v0.24.2.tar.gz"
10+
- sha256 "00f0a7403143fba69601accc80cacf49becc568b890ba232f300c1b2a37475e6"
11+
+ url "https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz"
12+
+ sha256 "c7f5e2d7381dbc4d7e878013d14f9993ae8a41bd23f032718e39ffba57894029"
13+
head "https://github.com/libgit2/libgit2.git"
14+
15+
bottle do

0 commit comments

Comments
 (0)