anchor.diff:              --add-flags "-xkbdir ${xorg.xkeyboardconfig}/share/X11/xkb"
           '';
           passthru.version = version; # needed by virtualbox guest additions
  -      } else {
  -        buildInputs = commonBuildInputs ++ [
  -          args.bootstrap_cmds args.automake args.autoconf
  -          args.apple_sdk.libs.Xplugin
  -          args.apple_sdk.frameworks.Carbon
  -          args.apple_sdk.frameworks.Cocoa
  -        ];
  -        propagatedBuildInputs = commonPropagatedBuildInputs ++ [
  -          libAppleWM applewmproto
  -        ];
  -        # Patches can be pulled from the server-*-apple branches of:
  -        # http://cgit.freedesktop.org/~jeremyhu/xserver/
  -        patches = commonPatches ++ [
  -          ./darwin/0002-sdksyms.sh-Use-CPPFLAGS-not-CFLAGS.patch
  -          ./darwin/0004-Use-old-miTrapezoids-and-miTriangles-routines.patch
  -          ./darwin/0006-fb-Revert-fb-changes-that-broke-XQuartz.patch
  -          ./darwin/private-extern.patch
  -          ./darwin/bundle_main.patch
  -          ./darwin/stub.patch
  -        ];
  -        configureFlags = [
  -          # note: --enable-xquartz is auto
  -          "CPPFLAGS=-I${./darwin/dri}"
  -          "--with-default-font-path="
  -          "--with-apple-application-name=XQuartz"
  -          "--with-apple-applications-dir=\${out}/Applications"
  -          "--with-bundle-id-prefix=org.nixos.xquartz"
  -          "--with-sha1=CommonCrypto"
  -        ];
  -        preConfigure = ''
  -          ensureDir $out/Applications
  -          export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error"
  -          substituteInPlace hw/xquartz/pbproxy/Makefile.in --replace -F/System -F${args.apple_sdk.frameworks.ApplicationServices}
  -        '';
  -        postInstall = ''
  -          rm -fr $out/share/X11/xkb/compiled
  -          ln -s /var/tmp $out/share/X11/xkb/compiled
  -
  -          cp -rT ${darwinOtherX}/bin $out/bin
  -          rm -f $out/bin/X
  -          ln -s Xquartz $out/bin/X
  -
  -          cp ${darwinOtherX}/share/man -rT $out/share/man
  -        '' ;
  -        passthru.version = version;
         });
   
     lndir = attrs: attrs // {
  
positive.code:         # Remove useless DocBook XML files.
          rm -rf $out/share/doc
        '';
      CPP = stdenv.lib.optionalString stdenv.isDarwin "clang -E -";
      outputs = [ "out" "man" ];
    };
  
  
negative.code:       sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
      '';
      propagatedBuildInputs = [ xorg.libSM ];
      CPP = stdenv.lib.optionalString stdenv.cc.isClang "clang -E -";
      outputs = [ "out" "doc" "man" ];
    };
  
  