Skip to content

Commit 3cbe3f3

Browse files
committed
compile using oniguruma
Signed-off-by: Miguel Molina <[email protected]>
1 parent 35065f7 commit 3cbe3f3

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ before_install:
1919
- docker pull pilosa/pilosa:v0.9.0
2020
- docker run -d --name pilosa -p 127.0.0.1:10101:10101 pilosa/pilosa:v0.9.0
2121
- docker ps -a
22+
- sudo apt-get install -y libonig2 libonig-dev
2223
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 90
2324
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 90
2425

@@ -66,6 +67,8 @@ jobs:
6667
- echo "skipping before_script for macOS"
6768

6869
script:
70+
- brew update
71+
- brew install oniguruma
6972
- make packages || echo "" # will fail because of docker being missing
7073
- if [ ! -f "build/gitbase_darwin_amd64/gitbase" ]; then echo "gitbase binary not generated" && exit 1; fi
7174
- cd build

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Package configuration
22
PROJECT = gitbase
33
COMMANDS = cmd/gitbase
4+
GO_TAGS = oniguruma
45

56
# Including ci Makefile
67
CI_REPOSITORY ?= https://github.com/src-d/ci.git

docs/using-gitbase/getting-started.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ On Linux and macOS:
4848
go get -u github.com/src-d/gitbase/...
4949
```
5050

51+
#### Oniguruma support
52+
53+
On linux and macOS you can choose to build gitbase with oniguruma support, resulting in faster results for queries using the `language` UDF.
54+
55+
macOS:
56+
57+
```
58+
brew install oniguruma
59+
```
60+
61+
Linux:
62+
63+
```
64+
sudo apt-get install libonig2
65+
```
66+
67+
Then build gitbase like this:
68+
69+
```
70+
go build -tags oniguruma -o gitbase ./cmd/gitbase/main.go
71+
```
72+
5173
On Windows:
5274

5375
Because gitbase uses [bblfsh's client-go](https://github.com/bblfsh/client-go), which uses cgo, you need to install some dependencies by hand instead of just using `go get`. Use this instead:

0 commit comments

Comments
 (0)