anchor.diff:  { stdenv
   , cmake
  -, fetchhg
  -#, fetchurl
  +, fetchurl
   , ninja
   , yasm
   
  
positive.code: 
  # Optionals
  , cliSupport ? true # Build standalone CLI application
  , unittestsSupport ? false # Unit tests
  # Debugging options
  , debugSupport ? false # Run-time sanity checks (debugging)
  , werrorSupport ? false # Warnings as errors
  
negative.code:   inherit (stdenv)
      targetSystem;
    inherit (stdenv.lib)
      boolOn
      concatStringsSep
      elem
      optionals
      platforms;
  
    version = "2.0";
  
    src = fetchurl {
      url = "https://bitbucket.org/multicoreware/x265/downloads/"
        + "x265_${version}.tar.gz";
      multihash = "Qme81DrdptaPWWKmwKqgqwY3N3Ecp3MgcgzhQyTp1A5h9n";
      sha256 = "5a7f6797bee33310c690be5d9a6c63125f36663ac3478e98ac6b6142a70bce1f";
    };
  
    cmakeFlagsAll = [
      "-DCHECKED_BUILD=${boolOn debugSupport}"
      "-DENABLE_AGGRESSIVE_CHECKS=OFF"
      "-DENABLE_ASSEMBLY=ON"
      "-DENABLE_LIBNUMA=${boolOn (
        elem targetSystem platforms.linux
        && numactl != null)}"
      "-DENABLE_PIC=ON"
      "-DENABLE_PPA=OFF"
      "-DENABLE_TESTS=OFF"
      "-DENABLE_VTUNE=OFF"
      "-DWARNINGS_AS_ERRORS=OFF"
    ];
  in
  
  assert (elem targetSystem platforms.linux) -> numactl != null;
  
  /* By default, the compiled library is configured for only one
   * output bit depth.  Meaning, one has to rebuild libx265 if they
   * want to produce HEVC files with a different bit depth, which
   * is annoying.  However, upstream supports proper namespacing
   * for 8bit, 10bit & 12bit HEVC and linking all that together so
   * that the resulting library can produce all three of bit depths
   * instead of only one.  The API requires the bit depth parameter,
   * so that libx265 can then chose which variant of the encoder to use.  To
   * achieve this, we have to build one (static) library for each
   * non-main variant, and link it into the main library.  Upstream
   * documents using the 8bit variant as main library, hence we do not
  