anchor.diff:      sha256 = "0fqkhfhr22gzavxn60cpnj3agwdf5afivszxf3haj5k1sny7jk9n";
     };
   
  -  enableParallelBuilding = true;
  -
     patches = [
       # Fix build on ARM (#406)
       (fetchpatch {
  
positive.code: { stdenv, fetchurl, fetchpatch, cmake, nasm, numactl
  , numaSupport ? stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isx86 || stdenv.hostPlatform.isAarch64)  # Enabled by default on NUMA platforms
  , debugSupport ? false # Run-time sanity checks (debugging)
  , highbitdepthSupport ? false # false=8bits per channel, true=10/12bits per channel
  , werrorSupport ? false # Warnings as errors
  , ppaSupport ? false # PPA profiling instrumentation
  , vtuneSupport ? false # Vtune profiling instrumentation
  
negative.code:     })
    ];
  
    buildLib = has12Bit: stdenv.mkDerivation rec {
      name = "libx265-${if has12Bit then "12" else "10"}-${version}";
      inherit src patches;
      enableParallelBuilding = true;
  
      postPatch = ''
        sed -i 's/unknown/${version}/g' source/cmake/version.cmake
      '';
  
      cmakeLibFlags = [
        "-DENABLE_CLI=OFF"
        "-DENABLE_SHARED=OFF"
        "-DENABLE_HDR10_PLUS=ON"
        "-DEXPORT_C_API=OFF"
        "-DHIGH_BIT_DEPTH=ON"
      ];
      cmakeFlags = [(mkFlag has12Bit "MAIN12")] ++ cmakeLibFlags ++ cmakeFlagsAll;
  
      preConfigure = ''
        cd source
      '';
  
      nativeBuildInputs = [cmake nasm] ++ stdenv.lib.optional numaSupport numactl;
    };
  
    libx265-10 = buildLib false;
    libx265-12 = buildLib true;
  in
  
  stdenv.mkDerivation rec {
    pname = "x265";
    inherit version src patches;
  
    enableParallelBuilding = true;
  
    postPatch = ''
      sed -i 's/unknown/${version}/g' source/cmake/version.cmake
    '';
  
    cmakeFlags = [
      "-DENABLE_SHARED=ON"
      "-DHIGH_BIT_DEPTH=OFF"
      "-DENABLE_HDR10_PLUS=OFF"
      "-DEXTRA_LIB=${libx265-10}/lib/libx265.a;${libx265-12}/lib/libx265.a"
      "-DLINKED_10BIT=ON"
      "-DLINKED_12BIT=ON"
      (mkFlag cliSupport "ENABLE_CLI")
    ] ++ cmakeFlagsAll;
  
    preConfigure = ''
      cd source
  