22 , enableWx ? !stdenv.isDarwin
23 , enableX11 ? !stdenv.isDarwin
26 stdenv.mkDerivation (finalAttrs: {
31 url = "mirror://sourceforge/project/bochs/bochs/${finalAttrs.version}/bochs-${finalAttrs.version}.tar.gz";
32 hash = "sha256-oBCrG/3HKsWgjS4kEs1HHA/r1mrx2TSbwNeWh53lsXo=";
46 ] ++ lib.optionals enableSDL2 [
48 ] ++ lib.optionals enableTerm [
50 ] ++ lib.optionals enableWx [
53 ] ++ lib.optionals enableX11 [
58 ] ++ lib.optionals stdenv.isDarwin [
67 # These will always be "yes" on NixOS
68 "--enable-ltdl-install=yes"
69 "--enable-readline=yes"
70 "--enable-all-optimizations=yes"
71 "--enable-logging=yes"
74 # ... whereas these, always "no"!
76 "--enable-instrumentation=no"
78 "--enable-docbook=no" # Broken - it requires docbook2html
80 # Dangerous options - they are marked as "incomplete/experimental" on Bochs documentation
82 "--enable-monitor-mwait=no"
83 "--enable-raw-serial=no"
85 # These are completely configurable, and they don't depend of external tools
91 "--enable-configurable-msrs"
92 "--enable-cpu-level=6" # from 3 to 6
93 "--enable-debugger" #conflicts with gdb-stub option
94 "--enable-debugger-gui"
97 "--enable-gdb-stub=no" # conflicts with debugger option
98 "--enable-handlers-chaining"
101 "--enable-large-ramfile"
104 "--enable-repeat-speedups"
109 "--enable-trace-linking"
116 "--enable-x86-debugger"
117 ] ++ lib.optionals enableSDL2 [
119 ] ++ lib.optionals enableTerm [
121 ] ++ lib.optionals enableWx [
123 ] ++ lib.optionals enableX11 [
126 ] ++ lib.optionals (!stdenv.isDarwin) [
135 enableParallelBuilding = true;
138 homepage = "https://bochs.sourceforge.io/";
139 description = "An open-source IA-32 (x86) PC emulator";
141 Bochs is an open-source (LGPL), highly portable IA-32 PC emulator, written
142 in C++, that runs on most popular platforms. It includes emulation of the
143 Intel x86 CPU, common I/O devices, and a custom BIOS.
145 license = lib.licenses.lgpl2Plus;
146 maintainers = with lib.maintainers; [ AndersonTorres ];
147 platforms = lib.platforms.unix;
150 # TODO: a better way to organize the options
151 # TODO: docbook (docbook-tools from RedHat mirrors should help)