lol
1{ stdenv, fetchFromGitHub, cmake }:
2
3# ?TODO: there's also python lib in there
4
5stdenv.mkDerivation rec {
6 name = "brotli-${version}";
7 version = "1.0.5";
8
9 src = fetchFromGitHub {
10 owner = "google";
11 repo = "brotli";
12 rev = "v" + version;
13 sha256 = "0ssj7mnhpdpk7qnwr49qfd4gxhkmvbli5mhs274pz55cx1xp7xja";
14 };
15
16 nativeBuildInputs = [ cmake ];
17
18 outputs = [ "out" "dev" "lib" ];
19
20 doCheck = true;
21
22 checkTarget = "test";
23
24 # This breaks on Darwin because our cmake hook tries to make a build folder
25 # and the wonderful bazel BUILD file is already there (yay case-insensitivity?)
26 prePatch = "rm BUILD";
27
28 # Don't bother with "man" output for now,
29 # it currently only makes the manpages hard to use.
30 postInstall = ''
31 mkdir -p $out/share/man/man{1,3}
32 cp ../docs/*.1 $out/share/man/man1/
33 cp ../docs/*.3 $out/share/man/man3/
34 '';
35
36 meta = with stdenv.lib; {
37 inherit (src.meta) homepage;
38
39 description = "A generic-purpose lossless compression algorithm and tool";
40
41 longDescription =
42 '' Brotli is a generic-purpose lossless compression algorithm that
43 compresses data using a combination of a modern variant of the LZ77
44 algorithm, Huffman coding and 2nd order context modeling, with a
45 compression ratio comparable to the best currently available
46 general-purpose compression methods. It is similar in speed with
47 deflate but offers more dense compression.
48
49 The specification of the Brotli Compressed Data Format is defined
50 in the following internet draft:
51 http://www.ietf.org/id/draft-alakuijala-brotli
52 '';
53
54 license = licenses.mit;
55 maintainers = [ maintainers.vcunat ];
56 platforms = platforms.all;
57 };
58}
59