anchor.diff:        exit 1
       fi
   
  -    if ! grep -q "YOSYS_VER := ${version}" Makefile; then
  -      echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (${version}), failing."
  +    if ! grep -q "YOSYS_VER := $version" Makefile; then
  +      echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package ($version), failing."
         exit 1
       fi
     '';
  
positive.code: , fetchFromGitHub
  , flex
  , libffi
  , pkgconfig
  , protobuf
  , python3
  , readline
  , tcl
  , verilog
  , zlib
  }:
  
  # NOTE: as of late 2020, yosys has switched to an automation robot that
  
negative.code:   };
  
    enableParallelBuilding = true;
    nativeBuildInputs = [ pkg-config protobuf flex bison python3 ];
    buildInputs = [ tcl readline libffi python3 protobuf zlib ];
  
    makeFlags = [ "ENABLE_PROTOBUF=1" "PREFIX=${placeholder "out"}"];
  
    patchPhase = ''
      substituteInPlace ./Makefile \
        --replace 'echo UNKNOWN' 'echo ${builtins.substring 0 10 src.rev}'
      chmod +x ./misc/yosys-config.in
      patchShebangs ./misc/yosys-config.in
      patchShebangs tests
    '';
  
  