anchor.diff:      # Propagated for #include <X11/Xlib.h> and <X11/Xatom.h> in SDL_syswm.h.
       ++ optionals x11Support [ libX11 xorgproto ];
   
  -  dlopenBuildInputs = [ ]
  -    ++ optionals  alsaSupport [ alsa-lib audiofile ]
  -    ++ optional  dbusSupport dbus
  -    ++ optional  pulseaudioSupport libpulseaudio
  -    ++ optional  udevSupport udev
  +  dlopenBuildInputs = optionals alsaSupport [ alsa-lib audiofile ]
  +    ++ optional dbusSupport dbus
  +    ++ optional pulseaudioSupport libpulseaudio
  +    ++ optional udevSupport udev
       ++ optionals waylandSupport [ wayland wayland-protocols libxkbcommon ]
       ++ optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ];
   
     buildInputs = [ libiconv ]
       ++ dlopenBuildInputs
  -    ++ optional  ibusSupport ibus
  -    ++ optional  fcitxSupport fcitx
  +    ++ optional ibusSupport ibus
  +    ++ optional fcitxSupport fcitx
       ++ optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
   
     enableParallelBuilding = true;
  
positive.code:   #
    # You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to
    # list the symbols used in this way.
    postFixup = let
      rpath = makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
    in optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
      for lib in $out/lib/*.so* ; do
        if ! [[ -L "$lib" ]]; then
          patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib"
        fi
      done
    '';
  
    setupHook = ./setup-hook.sh;
  
  
negative.code:   configureFlags = [
      "--disable-oss"
    ] ++ optional (!x11Support) "--without-x"
    ++ optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib"
    ++ optional stdenv.targetPlatform.isWindows "--disable-video-opengles"
    ++ optional stdenv.isDarwin "--disable-sdltest";
  
    # We remove libtool .la files when static libs are requested,
    # because they make the builds of downstream libs like `SDL_tff`
  