anchor.diff: -{ stdenv, fetchurl, config
  +{ stdenv, fetchurl
   , pkgconfig, libtool
   , gtk2, mesa, readline, libX11, libXpm
   , docbook_xml_dtd_45, docbook_xsl
   , sdlSupport ? true, SDL2 ? null
  -, termSupport ? true , ncurses ? null
  +, termSupport ? true, ncurses ? null
   , wxSupport ? true, wxGTK ? null
  -# Optional, undocumented dependencies
   , wgetSupport ? false, wget ? null
   , curlSupport ? false, curl ? null
   }:
  
positive.code: 
      # Dangerous options - they are marked as "incomplete/experimental" on Bochs documentation
      "--enable-3dnow=no"
      "--enable-usb-xhci=no"
      "--enable-monitor-mwait=no"
      "--enable-raw-serial=no" ]
      # Boolean flags
      ++ stdenv.lib.optional termSupport "--with-term"
      ++ stdenv.lib.optional sdlSupport "--with-sdl2"
      ++ stdenv.lib.optional wxSupport "--with-wx"
      ++ stdenv.lib.optional largefile "--enable-largefile"
      ++ stdenv.lib.optional idleHack "--enable-idle-hack"
      ++ stdenv.lib.optional plugins "--enable-plugins"
      ++ stdenv.lib.optional a20Pin "--enable-a20-pin"
      ++ stdenv.lib.optional emulate64Bits "--enable-x86-64"
      ++ stdenv.lib.optional smp "--enable-smp"
      ++ stdenv.lib.optional largeRamfile "--enable-large-ramfile"
      ++ stdenv.lib.optional repeatSpeedups "--enable-repeat-speedups"
      ++ stdenv.lib.optional handlersChaining "--enable-handlers-chaining"
      ++ stdenv.lib.optional traceLinking "--enable-trace-linking"
      ++ stdenv.lib.optional configurableMSRegs "--enable-configurable-msrs"
      ++ stdenv.lib.optional showIPS "--enable-show-ips"
      ++ stdenv.lib.optional debugger "--enable-debugger"
      ++ stdenv.lib.optional disasm "--enable-disasm"
      ++ stdenv.lib.optional debuggerGui "--enable-debugger-gui"
      ++ stdenv.lib.optional gdbStub "--enable-gdb-stub"
      ++ stdenv.lib.optional IODebug "--enable-iodebug"
      ++ stdenv.lib.optional fpu "--enable-fpu"
      ++ stdenv.lib.optional svm "--enable-svm"
      ++ stdenv.lib.optional avx "--enable-avx"
      ++ stdenv.lib.optional evex "--enable-evex"
      ++ stdenv.lib.optional x86Debugger "--enable-x86-debugger"
      ++ stdenv.lib.optional pci "--enable-pci"
      ++ stdenv.lib.optional uhci "--enable-usb"
      ++ stdenv.lib.optional ohci "--enable-usb-ohci"
      ++ stdenv.lib.optional ne2k "--enable-ne2000"
      ++ stdenv.lib.optional pNIC "--enable-pnic"
      ++ stdenv.lib.optional e1000 "--enable-e1000"
      ++ stdenv.lib.optional clgd54xx "--enable-clgd54xx"
      ++ stdenv.lib.optional voodoo "--enable-voodoo"
      ++ stdenv.lib.optional cdrom "--enable-cdrom"
      ++ stdenv.lib.optional sb16 "--enable-sb16"
      ++ stdenv.lib.optional es1370 "--enable-es1370"
      ++ stdenv.lib.optional busMouse "--enable-busmouse"
      ;
  
    NIX_CFLAGS_COMPILE="-I${gtk2.dev}/include/gtk-2.0/ -I${libtool}/include/";
    NIX_LDFLAGS="-L${libtool.lib}/lib";
  
    hardeningDisable = [ "format" ];
  
    meta = with stdenv.lib; {
      description = "An open-source IA-32 (x86) PC emulator";
      longDescription = ''
      Bochs is an open-source (LGPL), highly portable IA-32 PC emulator,
      written in C++, that runs on most popular platforms. It includes
      emulation of the Intel x86 CPU, common I/O devices, and a custom
      BIOS.
      '';
      homepage = http://bochs.sourceforge.net/;
      license = licenses.lgpl2Plus;
      maintainers = [ maintainers.AndersonTorres ];
      platforms = platforms.linux;
    };
  }
  
  # TODO: study config.bochs.* implementation (like config.ffmpeg.* options)
  # TODO: investigate the wxWidgets problem (maybe upstream devteam didn't update wxGTK GUI)
  # TODO: investigate svga support - the Bochs sources explicitly cite /usr/include/svga.h
  
negative.code:     "--with-rfb=no"
      "--with-vncsrv=no"
      "--with-svga=no" # it doesn't compile on NixOS
  
      # These will always be "yes" on NixOS
      "--enable-ltdl-install=yes"
  