anchor.diff:        "-DUSE_OPENMP=ON"
         # warning: high RAM usage
         "-DSERIALIZE_CHIPDB=OFF"
  -      # use PyPy for icestorm if enabled
  -      "-DPYTHON_EXECUTABLE=${icestorm.pythonInterp}"
       ]
       ++ (lib.optional (!enableGui) "-DBUILD_GUI=OFF")
       ++ (lib.optional (enableGui && stdenv.isDarwin)
  
positive.code: in
  with stdenv; mkDerivation rec {
    pname = "nextpnr";
    version = "2019.08.31";
  
    src = fetchFromGitHub {
      owner  = "yosyshq";
      repo   = "nextpnr";
      rev    = "c0b7379e8672b6263152d5e340e62f22179fdc8b";
      sha256 = "174n962xiwyzy53cn192h9rq95h951k3xy6bs43p5ya592ai5mjh";
    };
  
    nativeBuildInputs
  
negative.code:   patchPhase = with builtins; ''
      substituteInPlace ./CMakeLists.txt \
        --replace 'git log -1 --format=%h' 'echo ${substring 0 11 src.rev}'
  
      # use PyPy for icestorm if enabled
      substituteInPlace ./ice40/family.cmake \
        --replace ''\'''${PYTHON_EXECUTABLE}' '${icestorm.pythonInterp}'
    '';
  
  
  