diff --git a/scripts/z-run b/scripts/z-run index c165c19..29d45c0 100644 --- a/scripts/z-run +++ b/scripts/z-run @@ -134,7 +134,7 @@ build \ -v \ -mod readonly \ - -tags 'netgo nobrotli' \ + -tags 'netgo brotli' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \ -gcflags 'all=-l=4' \ -o "${_outputs}/binaries/release/kawipiko-archiver" \ @@ -186,7 +186,7 @@ build \ -v \ -mod readonly \ - -tags 'netgo nobrotli' \ + -tags 'netgo brotli' \ -ldflags 'all=-s -extld=gcc -extldflags=-static' \ -gcflags 'all=-l=4' \ -o "${_outputs}/binaries/release/kawipiko" \ diff --git a/sources/go.mod b/sources/go.mod index bb1090d..0d7b5b9 100644 --- a/sources/go.mod +++ b/sources/go.mod @@ -8,6 +8,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2 // indirect github.com/google/brotli v1.0.7 + github.com/itchio/go-brotli v0.0.0-20190702114328-3f28d645a45c // indirect github.com/klauspost/compress v1.7.6 // indirect github.com/klauspost/cpuid v1.2.1 // indirect github.com/kr/pretty v0.1.0 // indirect diff --git a/sources/go.sum b/sources/go.sum index 563888d..50af4e0 100644 --- a/sources/go.sum +++ b/sources/go.sum @@ -12,6 +12,8 @@ github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2 h1:VA6jElpcJ+wkwE github.com/foobaz/go-zopfli v0.0.0-20140122214029-7432051485e2/go.mod h1:Yi95+RbwKz7uGndSuUhoq7LJKh8qH8DT9fnL4ewU30k= github.com/google/brotli v1.0.7 h1:fxwwohNEPaVS6qvtnjwgzRR62Upa70pkw0f9qarjrQs= github.com/google/brotli v1.0.7/go.mod h1:XpGqLY1HgMKTQI5TU8iAKE/okaKqS9h1e6KRlRztlOU= +github.com/itchio/go-brotli v0.0.0-20190702114328-3f28d645a45c h1:Jf20xV/yR/O6eSUqLTuXhka/+54YR59sGwN7b3MkxYk= +github.com/itchio/go-brotli v0.0.0-20190702114328-3f28d645a45c/go.mod h1:oRXh43p/JW9kWosasd+2kHfDpb1ec4m7YrZ5E39s1iI= github.com/klauspost/compress v1.4.0 h1:8nsMz3tWa9SWWPL60G1V6CUsf4lLjWLTNEtibhe8gh8= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.7.6 h1:GH2karLOcuZtA5a3+KuzSU33A2cvcHGbtEWM6K4t7oU= diff --git a/sources/lib/archiver/compress-brotli-with.go b/sources/lib/archiver/compress-brotli-with.go index f6be4c1..f371e5f 100644 --- a/sources/lib/archiver/compress-brotli-with.go +++ b/sources/lib/archiver/compress-brotli-with.go @@ -7,7 +7,7 @@ package archiver import "bytes" -import "github.com/google/brotli/go/cbrotli" +import brotli "github.com/itchio/go-brotli/enc" @@ -16,7 +16,9 @@ func CompressBrotli (_data []byte) ([]byte, string, error) { _buffer := & bytes.Buffer {} - _encoder := cbrotli.NewWriter (_buffer, cbrotli.WriterOptions { Quality : 11, LGWin : 24}) + _options := brotli.BrotliWriterOptions { Quality : 11, LGWin : 24} + + _encoder := brotli.NewBrotliWriter (_buffer, &_options) if _, _error := _encoder.Write (_data); _error != nil { return nil, "", _error