@@ -0,0 +1,47 @@
1+{ stdenv, fetchFromGitHub }:
2+
3+# ?TODO: there's also python lib in there
4+
5+stdenv.mkDerivation rec {
6+ name = "brotli-${version}";
7+ version = "0.3.0";
8+
9+ src = fetchFromGitHub {
10+ owner = "google";
11+ repo = "brotli";
12+ rev = "v" + version;
13+ sha256 = "1ijwr8fbrajp4gh8x6lrrpf8gymm0i6w06s97rv294q5dcszn299";
14+ };
15+
16+ preConfigure = "cd tools";
17+
18+ # Debian installs "brotli" instead of "bro" but let's keep upstream choice for now.
19+ installPhase = ''
20+ mkdir -p "$out/bin"
21+ mv ./bro "$out/bin/"
22+ '';
23+
24+ meta = with stdenv.lib; {
25+ inherit (src.meta) homepage;
26+
27+ description = "A generic-purpose lossless compression algorithm and tool";
28+
29+ longDescription =
30+ '' Brotli is a generic-purpose lossless compression algorithm that
31+ compresses data using a combination of a modern variant of the LZ77
32+ algorithm, Huffman coding and 2nd order context modeling, with a
33+ compression ratio comparable to the best currently available
34+ general-purpose compression methods. It is similar in speed with
35+ deflate but offers more dense compression.
36+
37+ The specification of the Brotli Compressed Data Format is defined
38+ in the following internet draft:
39+ http://www.ietf.org/id/draft-alakuijala-brotli
40+ '';
41+
42+ license = licenses.mit;
43+ maintainers = [ maintainers.vcunat ];
44+ platforms = platforms.all;
45+ };
46+}
47+