···11+{ stdenv, fetchFromGitHub }:
22+33+# ?TODO: there's also python lib in there
44+55+stdenv.mkDerivation rec {
66+ name = "brotli-20160112";
77+ version = "bed93862";
88+99+ src = fetchFromGitHub {
1010+ owner = "google";
1111+ repo = "brotli";
1212+ rev = "bed93862608d4d232ebe6d229f04e48399775e8b";
1313+ sha256 = "0g94kqh984qkbqbj4fpkkyji9wnbrb9cs32r9d6niw1sqfnfkd6f";
1414+ };
1515+1616+ preConfigure = "cd tools";
1717+1818+ # Debian installs "brotli" instead of "bro" but let's keep upstream choice for now.
1919+ installPhase = ''
2020+ mkdir -p "$out/bin"
2121+ mv ./bro "$out/bin/"
2222+ '';
2323+2424+ meta = with stdenv.lib; {
2525+ inherit (src.meta) homepage;
2626+2727+ description = "A generic-purpose lossless compression algorithm and tool";
2828+2929+ longDescription =
3030+ '' Brotli is a generic-purpose lossless compression algorithm that
3131+ compresses data using a combination of a modern variant of the LZ77
3232+ algorithm, Huffman coding and 2nd order context modeling, with a
3333+ compression ratio comparable to the best currently available
3434+ general-purpose compression methods. It is similar in speed with
3535+ deflate but offers more dense compression.
3636+3737+ The specification of the Brotli Compressed Data Format is defined
3838+ in the following internet draft:
3939+ http://www.ietf.org/id/draft-alakuijala-brotli
4040+ '';
4141+4242+ license = licenses.mit;
4343+ maintainers = [];
4444+ platforms = platforms.all;
4545+ };
4646+}