1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 gumbo,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "litehtml";
11 version = "0.9";
12
13 src = fetchFromGitHub {
14 owner = "litehtml";
15 repo = "litehtml";
16 rev = "v${finalAttrs.version}";
17 hash = "sha256-ZE/HKzo3ejKpW/ih3sJwn2hzCtsBhAXeJWGezYd6Yc4";
18 };
19
20 # Don't search for non-existent gumbo cmake config
21 # This will mislead cmake that litehtml is not found
22 # Affects build of pkgs that depend on litehtml
23 postPatch = ''
24 substituteInPlace cmake/litehtmlConfig.cmake \
25 --replace-fail "find_dependency(gumbo)" ""
26 '';
27
28 nativeBuildInputs = [
29 cmake
30 ];
31
32 buildInputs = [
33 gumbo
34 ];
35
36 cmakeFlags = [
37 "-DEXTERNAL_GUMBO=ON"
38 # BuildTesting need to download test data online
39 "-DLITEHTML_BUILD_TESTING=OFF"
40 ];
41
42 meta = with lib; {
43 description = "Fast and lightweight HTML/CSS rendering engine";
44 homepage = "http://www.litehtml.com/";
45 license = licenses.bsd3;
46 platforms = platforms.all;
47 maintainers = with maintainers; [ fgaz ];
48 };
49})