summary refs log tree commit diff
path: root/pkgs/development/libraries/x265/hg.nix
blob: d615acebc01bbb2d7282d3c21cd4e60c99391cdb (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
49
50
51
52
{ stdenv, cmake, fetchhg, yasm
, highBitDepth ? false
, debuggingSupport ? false
, enableCli ? true
, testSupport ? false
}:

stdenv.mkDerivation rec {
  name = "x265-hg";

  src = fetchhg {
    url = "https://bitbucket.org/multicoreware/x265/src";
    rev = "eebb372eec893efc50e66806fcc19b1c1bd89683";
    sha256 = "03dpbjqcmbmyid45560byabybfzy2bvic0gqa6k6hxci6rvmynpi";
  };

  cmakeFlags = with stdenv.lib;
    ''
      ${if debuggingSupport
        then "-DCHECKED_BUILD=ON"
        else "-DCHECKED_BUILD=OFF"
      }
      -DSTATIC_LINK_CRT=OFF
      ${if (stdenv.system == "x86_64-linux" && highBitDepth)
        then "-DHIGH_BIT_DEPTH=ON"
        else "-DHIGH_BIT_DEPTH=OFF"
      }
      -DWARNINGS_AS_ERRORS=OFF
      -DENABLE_PPA=OFF
      -DENABLE_SHARED=ON
      ${if enableCli
        then "-DENABLE_CLI=ON"
        else "-DENABLE_CLI=OFF"
      }
      ${if testSupport
        then "-DENABLE_TESTS=ON"
        else "-DENABLE_TESTS=OFF"
      }
    '';

  preConfigure = "cd source";

  buildInputs = [ cmake yasm ];

  meta = with stdenv.lib; {
    homepage = "http://x265.org";
    description = "Library for encoding h.265/HEVC video streams";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = with maintainers; [ codyopel ];
  };
}