about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/litehtml/default.nix
blob: b7626733210de1504615754160e2f07ccb837fc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, stdenv
, fetchFromGitHub
, cmake
, gumbo
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "litehtml";
  version = "0.9";

  src = fetchFromGitHub {
    owner = "litehtml";
    repo = "litehtml";
    rev = "v${finalAttrs.version}";
    hash = "sha256-ZE/HKzo3ejKpW/ih3sJwn2hzCtsBhAXeJWGezYd6Yc4";
  };

  # Don't search for non-existant gumbo cmake config
  # This will mislead cmake that litehtml is not found
  # Affects build of pkgs that depend on litehtml
  postPatch = ''
    substituteInPlace cmake/litehtmlConfig.cmake \
      --replace-fail "find_dependency(gumbo)" ""
  '';

  nativeBuildInputs = [
    cmake
  ];

  buildInputs = [
    gumbo
  ];

  cmakeFlags = [
    "-DEXTERNAL_GUMBO=ON"
    # BuildTesting need to download test data online
    "-DLITEHTML_BUILD_TESTING=OFF"
  ];

  meta = with lib; {
    description = "Fast and lightweight HTML/CSS rendering engine";
    homepage = "http://www.litehtml.com/";
    license = licenses.bsd3;
    platforms = platforms.all;
    maintainers = with maintainers; [ fgaz ];
  };
})