forked from wal-g/wal-g
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tamal Saha <[email protected]>
- Loading branch information
1 parent
24dd6e0
commit cd0fbf0
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
set -e -x | ||
|
||
if ! which dep > /dev/null; then | ||
go get -u github.com/golang/dep/cmd/dep # install dependencies management system | ||
fi | ||
|
||
make deps # install dependencies | ||
|
||
test -d tmp || mkdir tmp | ||
|
||
cp -rf vendor/github.com/google/brotli/* tmp/ | ||
cp -rf submodules/brotli/* vendor/github.com/google/brotli/ | ||
|
||
readonly CWD=$PWD | ||
|
||
cd vendor/github.com/google/brotli/go/cbrotli | ||
|
||
readonly LIB_DIR=../../dist # dist will contain binaries and it is in the google/brotli/.gitignore | ||
|
||
# patch cgo.go to force usage of static libraries for linking | ||
sed -i -e "s|#cgo LDFLAGS: -lbrotlicommon|#cgo CFLAGS: -I../../c/include|" cgo.go | ||
sed -i -e "s|\(#cgo LDFLAGS:\) \(-lbrotli.*\)|\1 -L$LIB_DIR \2-static -lbrotlicommon-static|" cgo.go | ||
sed -i -e "/ -lm$/ n; /brotlienc/ s|$| -lm|" cgo.go | ||
|
||
mkdir -p ${LIB_DIR} | ||
|
||
cd ${LIB_DIR} | ||
../configure-cmake --disable-debug | ||
make | ||
|
||
cd ${CWD} | ||
make | ||
|
||
rm -rf vendor/github.com/google/brotli/* | ||
mv tmp/* vendor/github.com/google/brotli/ | ||
rm -rf tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM golang:1.11-alpine | ||
|
||
RUN apk add --update --no-cache ca-certificates cmake bash build-base git | ||
|