anchor.diff:    # add a symlink to fake things so that both variants work the same way. this
     # is also needed at build time for the test suite.
     postBuild   = "ln -sfv ${abc-verifier}/bin/abc ./yosys-abc";
  -  postInstall = "ln -sfv ${abc-verifier}/bin/abc $out/bin/yosys-abc";
  +  postInstall = ''
  +    ln -sfv ${abc-verifier}/bin/abc $out/bin/yosys-abc
  +
  +    mkdir -p $out/share/yosys/plugins
  +    for plugin in $plugins; do
  +        ln -sfv $plugin/share/yosys/plugins/* $out/share/yosys/plugins/
  +    done
  +  '';
   
     meta = with stdenv.lib; {
       description = "Open RTL synthesis framework and tools";
  
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
    '';
  
  