anchor.diff:      };
     };
   in
  -stdenv.mkDerivation rec {
  +stdenvNoCC.mkDerivation {
     inherit version;
     pname = "libreoffice";
     src = fetchurl {
  -    inherit (dist."${stdenv.hostPlatform.system}") url sha256;
  +    inherit (dist.${stdenvNoCC.hostPlatform.system} or
  +      (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}")) url sha256;
     };
   
     nativeBuildInputs = [ undmg ];
     sourceRoot = "${appName}";
  -  dontPatch = true;
  -  dontConfigure = true;
  -  dontBuild = true;
   
     installPhase = ''
  -    runHook preInstallPhase
  +    runHook preInstall
       mkdir -p $out/{Applications/${appName},bin}
       cp -R . $out/Applications/${appName}
  -    ln -s $out/Applications/${appName}/Contents/MacOS/soffice $out/bin
  -    runHook postInstallPhase
  +    cat > $out/bin/${scriptName} << EOF
  +    #!${stdenvNoCC.shell}
  +    open -na $out/Applications/${appName} --args "$@"
  +    EOF
  +    chmod +x $out/bin/${scriptName}
  +    runHook postInstall
     '';
   
     passthru.updateScript =
  
positive.code: 
  let
    appName = "LibreOffice.app";
    version = "7.2.5";
    baseUrl = "https://download.documentfoundation.org/libreoffice/stable";
    dist = {
  
negative.code: { stdenvNoCC
  , lib
  , fetchurl
  , undmg
  