anchor.diff:  , file
   , legacySupport ? false
   , static ? stdenv.hostPlatform.isStatic
  +# these need to be ran on the host, thus disable when cross-compiling
  +, buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform
  +, doCheck ? stdenv.hostPlatform == stdenv.buildPlatform
   }:
   
   stdenv.mkDerivation rec {
  
positive.code:       --replace "zstdcat" "$bin/bin/zstdcat"
    '' + lib.optionalString stdenv.isDarwin ''
      install_name_tool -change @rpath/libzstd.1.dylib $out/lib/libzstd.1.dylib $bin/bin/pzstd
    '';
  
    outputs = [ "bin" "dev" ]
  
negative.code: 
    preInstall = ''
      mkdir -p $bin/bin
      substituteInPlace ../programs/zstdgrep \
        --replace ":-grep" ":-${gnugrep}/bin/grep" \
        --replace ":-zstdcat" ":-$bin/bin/zstdcat"
  