1 { brotli, cmake, pkg-config, fetchFromGitHub, lib, stdenv
2 , static ? stdenv.hostPlatform.isStatic
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
13 sha256 = "13l4g536h0pr84ww4wxs2za439s0xp1va55g6l478rfbb1spp44y";
16 outputs = [ "out" "dev" "lib" ];
18 # Need to explicitly link to brotlicommon
19 patches = lib.optional static ./brotli-static.patch;
21 nativeBuildInputs = [ cmake pkg-config ];
24 "-DCANONICAL_PREFIXES=ON"
25 "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
26 ] ++ lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE";
28 propagatedBuildInputs = [ brotli ];
31 # without this binaries only get built if shared libs are disable
32 sed 's@^if (NOT BUILD_SHARED_LIBS)$@if (TRUE)@g' -i CMakeLists.txt
36 description = "Webfont compression reference code";
37 homepage = "https://github.com/google/woff2";
38 license = licenses.mit;
39 maintainers = [ maintainers.hrdinka ];
40 platforms = platforms.unix;