anchor.diff:  
       outputs = [ "out" "devdoc" ];
   
  -    nativeBuildInputs = [ pkgconfig flex bison libxslt ] ++ extraNativeBuildInputs;
  +    nativeBuildInputs = [
  +      pkgconfig flex bison libxslt
  +    ] ++ lib.optional (stdenv.isDarwin && (atLeast "0.38")) expat
  +      ++ extraNativeBuildInputs;
   
  -    buildInputs = [ glib libiconv libintl ] ++ extraBuildInputs;
  +    buildInputs = [
  +      glib libiconv libintl
  +    ] ++ lib.optional (atLeast "0.38") graphviz
  +      ++ extraBuildInputs;
   
       meta = with stdenv.lib; {
         description = "Compiler for GObject type system";
  
positive.code: 
    vala_0_36 = generic {
      major   = "0.36";
      minor   = "12";
      sha256  = "1nvw721piwdh15bipg0sdll9kvgpz0y9i5fpszlc7y9w64yis25l";
    };
  
    vala_0_38 = generic {
      major   = "0.38";
      minor   = "4";
      sha256  = "1sg5gaq3jhgr9vzh2ypiw475167k150wmyglymr7wwqppmikmcrc";
      extraNativeBuildInputs = [ autoconf ] ++ stdenv.lib.optionals stdenv.isDarwin [ libtool expat ];
      extraBuildInputs = [ graphviz ];
    };
  
    vala_0_40 = generic {
      major   = "0.40";
      minor   = "0";
      sha256  = "0wcfljl55a9qvslfcc4sf76wdpwgn83n96b7fgb7r49ib35qz20m";
      extraNativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ expat ];
      extraBuildInputs = [ graphviz ];
    };
  
    vala = vala_0_38;
  
negative.code: { stdenv, lib, fetchurl, pkgconfig, flex, bison, libxslt, autoconf, graphviz
  , glib, libiconv, libintl, libtool, expat
  }:
  
  let
    generic = { major, minor, sha256, extraNativeBuildInputs ? [], extraBuildInputs ? [] }:
    let
      atLeast = lib.versionAtLeast "${major}.${minor}";
    in stdenv.mkDerivation rec {
      name = "vala-${major}.${minor}";
  
      src = fetchurl {
  