From bae86ca7dd0f41cf1f0b69e9c3f896acf8166e77 Mon Sep 17 00:00:00 2001 From: siddontang Date: Wed, 1 Oct 2014 16:47:35 +0800 Subject: [PATCH] support godep --- .gitignore | 1 + Godeps/Godeps.json | 54 +++++++++++++++++++++++++++++++++++++++++++ Godeps/Readme | 5 ++++ Makefile | 6 ++--- README.md | 3 +++ bootstrap.sh | 8 +++++++ tools/build_config.sh | 8 +++++++ 7 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 Godeps/Godeps.json create mode 100644 Godeps/Readme diff --git a/.gitignore b/.gitignore index 1955ca3..42e539f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build nohup.out build_config.mk var +_workspace \ No newline at end of file diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json new file mode 100644 index 0000000..343f3a7 --- /dev/null +++ b/Godeps/Godeps.json @@ -0,0 +1,54 @@ +{ + "ImportPath": "github.com/siddontang/ledisdb", + "GoVersion": "go1.3.2", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/BurntSushi/toml", + "Rev": "2ceedfee35ad3848e49308ab0c9a4f640cfb5fb2" + }, + { + "ImportPath": "github.com/boltdb/bolt", + "Comment": "data/v1-228-g8fb50d5", + "Rev": "8fb50d5ee57110936b904a7539d4c5f2bf2359db" + }, + { + "ImportPath": "github.com/siddontang/go/bson", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/go/filelock", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/go/hack", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/go/log", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/go/num", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/go/snappy", + "Rev": "466d5bc779ad45f5923d0f59efbc5d696bf2099c" + }, + { + "ImportPath": "github.com/siddontang/goleveldb/leveldb", + "Rev": "c1f6d721561c48f467b26a277741e55fd224df1e" + }, + { + "ImportPath": "github.com/szferi/gomdb", + "Rev": "d8a6d8371e2409b0787a782bf9b0c5daca364a3d" + }, + { + "ImportPath": "github.com/ugorji/go/codec", + "Rev": "71c2886f5a673a35f909803f38ece5810165097b" + } + ] +} diff --git a/Godeps/Readme b/Godeps/Readme new file mode 100644 index 0000000..4cdaa53 --- /dev/null +++ b/Godeps/Readme @@ -0,0 +1,5 @@ +This directory tree is generated automatically by godep. + +Please do not edit. + +See https://github.com/tools/godep for more information. diff --git a/Makefile b/Makefile index f5b6dcd..6764157 100644 --- a/Makefile +++ b/Makefile @@ -16,13 +16,13 @@ export GO_BUILD_TAGS all: build build: - go install -tags '$(GO_BUILD_TAGS)' ./... + $(GO) install -tags '$(GO_BUILD_TAGS)' ./... clean: - go clean -i ./... + $(GO) clean -i ./... test: - go test -tags '$(GO_BUILD_TAGS)' ./... + $(GO) test -tags '$(GO_BUILD_TAGS)' ./... pytest: sh client/ledis-py/tests/all.sh diff --git a/README.md b/README.md index 05ba17d..3d1cf57 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,9 @@ Create a workspace and checkout ledisdb source make make test +## Godep support + +LedisDB supports building with [godep](https://github.com/tools/godep) which can manage LedisDB go dependence automatically. ## LevelDB support diff --git a/bootstrap.sh b/bootstrap.sh index e6d4071..ca844b2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,6 +2,14 @@ . ./dev.sh +# Test godep install +godep path > /dev/null 2>&1 +if [ "$?" = 0 ]; then + GOPATH=`godep path` + godep restore + exit 0 +fi + go get github.com/siddontang/goleveldb/leveldb go get github.com/szferi/gomdb diff --git a/tools/build_config.sh b/tools/build_config.sh index 22b7bf2..c97e13d 100755 --- a/tools/build_config.sh +++ b/tools/build_config.sh @@ -13,6 +13,14 @@ touch $OUTPUT source ./dev.sh +# Test godep install +godep path > /dev/null 2>&1 +if [ "$?" = 0 ]; then + echo "GO=godep go" >> $OUTPUT +else + echo "GO=go" >> $OUTPUT +fi + echo "CGO_CFLAGS=$CGO_CFLAGS" >> $OUTPUT echo "CGO_CXXFLAGS=$CGO_CXXFLAGS" >> $OUTPUT echo "CGO_LDFLAGS=$CGO_LDFLAGS" >> $OUTPUT