Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created February 12, 2018 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsierles/6679fb5a5cf4cadc355e8e7c7cfb1f19 to your computer and use it in GitHub Desktop.
Save jsierles/6679fb5a5cf4cadc355e8e7c7cfb1f19 to your computer and use it in GitHub Desktop.
Guix module for google-brotli
(define-module (nextjournal packages compression)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system cmake))
(define-public google-brotli
(package
(name "google-brotli")
(version "0.6.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/google/brotli/archive/v"
version ".tar.gz"))
(sha256
(base32
"03zfr6lw6ry643l6pbg0myg52clypxd0y0igd84dslchf3svvkb9"))))
(build-system cmake-build-system)
(arguments
`(#:configure-flags
(list ;; Defaults to "lib64" on 64-bit archs.
(string-append "-DCMAKE_INSTALL_LIBDIR="
(assoc-ref %outputs "out") "/lib")
;; XXX It's tricky to build shared and static in the same build for
;; brotli 0.6.0:
;; https://github.com/google/brotli/issues/542
"-DBUILD_SHARED_LIBS=OFF"
"-DBUILD_STATIC_LIBS=ON")))
(home-page "https://github.com/google/brotli")
(synopsis "General-purpose lossless compression")
(description "Brotli is a generic-purpose lossless compression algorithm
that compresses data using a combination of a modern variant of the LZ77
algorithm, Huffman coding and 2nd order context modeling, with a compression
ratio comparable to the best currently available general-purpose compression
methods. It is similar in speed with deflate but offers more dense compression.
The specification of the Brotli Compressed Data Format is defined in RFC 7932.")
(license expat)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment