anchor.diff:  
       makeFlags = [ "DMD=$DMD" ];
   
  -    # Disable tests on Darwin for now because of
  -    # https://github.com/NixOS/nixpkgs/issues/41099
  -    # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
  -    doCheck = !bootstrapVersion && !stdenv.hostPlatform.isDarwin;
  +    doCheck = !bootstrapVersion;
   
       checkPhase = ''
         # Build and run LDC D unittests.
  
positive.code: , python, libconfig, lit, gdb, unzip, darwin, bash
  , callPackage, makeWrapper, targetPackages
  , bootstrapVersion ? false
  , version ? "1.11.0"
  , ldcSha256 ? "0w4z261gzji31hn1xdnmi9dfkbyydpy6rz8aj4456q5w8yp4yil5"
  }:
  
  let
  
    bootstrapLdc = if !bootstrapVersion then
      # LDC 0.17.x is the last version which doesn't need a working D compiler to
      # build so we use that version to bootstrap the actual build.
      callPackage ./default.nix {
        bootstrapVersion = true;
        version = "0.17.5";
        ldcSha256 = "0200r5y8hs5yv2cx24csgyh00dlg18877b9cfblixypr6nhl19bs";
      }
    else
      "";
  
negative.code: 
      buildInputs = [ curl tzdata ];
  
      #"-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
      # Xcode 9.0.1 fixes that bug according to ldc release notes
      #"-DRT_ARCHIVE_WITH_LDC=OFF"
        #"-DD_FLAGS=TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/"
        #"-DCMAKE_BUILD_TYPE=Release"
        #"-DCMAKE_SKIP_RPATH=ON"
  
        #-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc
        #
      cmakeFlagsString = stdenv.lib.optionalString (!bootstrapVersion) ''
        "-DD_FLAGS=-d-version=TZDatabaseDir;-J$PWD"
      '';
  
      preConfigure = stdenv.lib.optionalString (!bootstrapVersion) ''
        cmakeFlagsArray=(
          ${cmakeFlagsString}
        )
      '';
  
      postConfigure = ''
        export DMD=$PWD/bin/ldmd2
  