anchor.diff:      ++ lib.optional (postgresql != null) postgresql;
   
     nativeBuildInputs =
  -    [ bison flex gperf lndir perl pkg-config which ];
  +    [ bison flex gperf lndir perl pkg-config which ]
  +    ++ lib.optionals stdenv.isDarwin [ xcbuild ];
   
     propagatedNativeBuildInputs = [ lndir ];
   
  
positive.code:   coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3,
    which,
    # darwin support
    darwin, libiconv,
  
    dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite,
    libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng,
  
negative.code:       then
          ''
            sed -i \
                -e 's|/usr/bin/xcode-select|xcode-select|' \
                -e 's|/usr/bin/xcrun|xcrun|' \
                -e 's|/usr/bin/xcodebuild|xcodebuild|' \
                -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
                ./configure
                substituteInPlace ./mkspecs/common/mac.conf \
                    --replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/"
                substituteInPlace ./mkspecs/common/mac.conf \
                    --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/"
          ''
        else
          lib.optionalString libGLSupported
            ''
  