anchor.diff:      sha1 = "e3872a46d58cb321a98f4fd4b93a989fb6920b9c";
     };
   
  -  nativeBuildInputs = [ pkgs.unzip ];
  +  nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
     outputs = [ "out" "doc" ];
   
     enableParallelBuilding = true;
   
  -  preBuild = ''
  +  preConfigure = ''
       cd ./INCHI_API/libinchi/gcc
  +  '' + lib.optionalString stdenv.isDarwin ''
  +    substituteInPlace makefile \
  +      --replace ",--version-script=libinchi.map" "" \
  +      --replace "LINUX_Z_RELRO = ,-z,relro" "" \
  +      --replace "-soname" "-install_name" \
  +      --replace "gcc" $CC
     '';
     installPhase = ''
  +    runHook preInstall
  +
       cd ../../..
       mkdir -p $out/lib
       mkdir -p $out/include/inchi
  
positive.code: { pkgs, fetchurl, lib, stdenv, unzip }:
  stdenv.mkDerivation {
    pname = "inchi";
    version = "1.05";
  
negative.code:     install -m 644 INCHI_BASE/src/*.h $out/include/inchi
  
      runHook postInstall
    '';
  
    preFixup = lib.optionalString stdenv.isDarwin ''
      fixDarwinDylibNames $(find "$out" -name "*.so.*")
    '';
  
    postInstall =
  