anchor.diff:          sha256 = "0jfaqckhg388jh9b4msrpkv6wrd6xzlw18m0bngbby8k8ywalp9i";
         };
   
  -  buildInputs = [ polyml z3 veriT vampire eprover-ho ]
  -    ++ lib.optionals (!stdenv.isDarwin) [ nettools java ];
  -
  -  sourceRoot = dirname;
  +  buildInputs = [ polyml z3 veriT vampire eprover-ho nettools ]
  +    ++ lib.optionals (!stdenv.isDarwin) [ java ];
  +
  +  sourceRoot = "${dirname}${lib.optionalString stdenv.isDarwin ".app"}";
  +
  +  postUnpack = if stdenv.isDarwin then ''
  +    mv $sourceRoot ${dirname}
  +    sourceRoot=${dirname}
  +  '' else null;
   
     postPatch = ''
       patchShebangs .
  
positive.code:     homepage = "https://isabelle.in.tum.de/";
      license = licenses.bsd3;
      maintainers = [ maintainers.jwiegley maintainers.jvanbruegge ];
      platforms = platforms.linux;
    };
  } // {
    withComponents = f:
  
negative.code:       --replace '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"'
  
      rm -r heaps
    '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
      substituteInPlace lib/scripts/isabelle-platform \
        --replace 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' ""
    '' + (if ! stdenv.isLinux then "" else ''
      arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux" else "x86-linux"}
      for f in contrib/*/$arch/{bash_process,epclextract,nunchaku,SPASS,zipperposition}; do
  