2017-07-10 11:55:09 +01:00
|
|
|
{ stdenv, fetchurl
|
2014-09-29 02:20:34 +01:00
|
|
|
, pkgconfig, libtool
|
2019-11-10 16:44:34 +00:00
|
|
|
, gtk2, libGLU, libGL, readline, libX11, libXpm
|
2014-09-29 02:20:34 +01:00
|
|
|
, docbook_xml_dtd_45, docbook_xsl
|
2014-11-18 12:52:12 +00:00
|
|
|
, sdlSupport ? true, SDL2 ? null
|
2017-07-10 11:55:09 +01:00
|
|
|
, termSupport ? true, ncurses ? null
|
2015-07-25 17:30:43 +01:00
|
|
|
, wxSupport ? true, wxGTK ? null
|
2013-11-23 01:22:05 +00:00
|
|
|
, wgetSupport ? false, wget ? null
|
2014-09-29 02:20:34 +01:00
|
|
|
, curlSupport ? false, curl ? null
|
|
|
|
}:
|
2013-11-23 01:22:05 +00:00
|
|
|
|
2014-11-18 12:52:12 +00:00
|
|
|
assert sdlSupport -> (SDL2 != null);
|
2014-09-29 02:20:34 +01:00
|
|
|
assert termSupport -> (ncurses != null);
|
2016-09-11 22:24:51 +01:00
|
|
|
assert wxSupport -> (gtk2 != null && wxGTK != null);
|
2013-11-23 01:22:05 +00:00
|
|
|
assert wgetSupport -> (wget != null);
|
|
|
|
assert curlSupport -> (curl != null);
|
|
|
|
|
2017-07-10 11:55:09 +01:00
|
|
|
with stdenv.lib;
|
2013-11-23 01:22:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "bochs";
|
2020-03-31 03:28:44 +01:00
|
|
|
version = "2.6.11";
|
2013-11-23 01:22:05 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "mirror://sourceforge/project/bochs/bochs/${version}/${pname}-${version}.tar.gz";
|
2020-03-31 03:28:44 +01:00
|
|
|
sha256 = "0ql8q6y1k356li1g9gbvl21448mlxphxxi6kjb2b3pxvzd0pp2b3";
|
2013-11-23 01:22:05 +00:00
|
|
|
};
|
2014-03-22 09:01:42 +00:00
|
|
|
|
2020-03-31 03:28:44 +01:00
|
|
|
patches = [ ./bochs-2.6.11-glibc-2.26.patch ./fix-build-smp.patch ];
|
2017-11-16 12:58:39 +00:00
|
|
|
|
2019-12-30 18:13:16 +00:00
|
|
|
buildInputs =
|
2019-11-10 16:44:34 +00:00
|
|
|
[ pkgconfig libtool gtk2 libGLU libGL readline libX11 libXpm docbook_xml_dtd_45 docbook_xsl ]
|
2014-09-29 02:20:34 +01:00
|
|
|
++ optionals termSupport [ ncurses ]
|
2014-11-18 12:52:12 +00:00
|
|
|
++ optionals sdlSupport [ SDL2 ]
|
2014-08-11 01:06:39 +01:00
|
|
|
++ optionals wxSupport [ wxGTK ]
|
2013-11-23 01:22:05 +00:00
|
|
|
++ optionals wgetSupport [ wget ]
|
|
|
|
++ optionals curlSupport [ curl ];
|
|
|
|
|
2014-09-29 02:20:34 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-x=yes"
|
|
|
|
"--with-x11=yes"
|
|
|
|
|
|
|
|
"--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"
|
|
|
|
"--enable-readline=yes"
|
|
|
|
"--enable-all-optimizations=yes"
|
|
|
|
"--enable-logging=yes"
|
|
|
|
"--enable-xpm=yes"
|
|
|
|
|
|
|
|
# ... whereas these, always "no"!
|
|
|
|
"--enable-cpp=no"
|
|
|
|
"--enable-instrumentation=no"
|
|
|
|
|
|
|
|
"--enable-docbook=no" # Broken - it requires docbook2html
|
|
|
|
|
|
|
|
# Dangerous options - they are marked as "incomplete/experimental" on Bochs documentation
|
|
|
|
"--enable-3dnow=no"
|
|
|
|
"--enable-monitor-mwait=no"
|
|
|
|
"--enable-raw-serial=no" ]
|
|
|
|
# Boolean flags
|
2017-07-10 11:55:09 +01:00
|
|
|
++ optionals termSupport [ "--with-term" ]
|
|
|
|
++ optionals sdlSupport [ "--with-sdl2" ]
|
|
|
|
++ optionals wxSupport [ "--with-wx" ]
|
|
|
|
# These are completely configurable, and they don't depend of external tools
|
|
|
|
++ [ "--enable-cpu-level=6" # from 3 to 6
|
|
|
|
"--enable-largefile"
|
|
|
|
"--enable-idle-hack"
|
|
|
|
"--enable-plugins=no" # Plugins are a bit buggy in Bochs
|
|
|
|
"--enable-a20-pin"
|
|
|
|
"--enable-x86-64"
|
|
|
|
"--enable-smp"
|
|
|
|
"--enable-large-ramfile"
|
|
|
|
"--enable-repeat-speedups"
|
|
|
|
"--enable-handlers-chaining"
|
|
|
|
"--enable-trace-linking"
|
|
|
|
"--enable-configurable-msrs"
|
|
|
|
"--enable-show-ips"
|
|
|
|
"--enable-debugger" #conflicts with gdb-stub option
|
|
|
|
"--enable-disasm"
|
|
|
|
"--enable-debugger-gui"
|
|
|
|
"--enable-gdb-stub=no" # conflicts with debugger option
|
|
|
|
"--enable-iodebug"
|
|
|
|
"--enable-fpu"
|
|
|
|
"--enable-svm"
|
|
|
|
"--enable-avx"
|
|
|
|
"--enable-evex"
|
|
|
|
"--enable-x86-debugger"
|
|
|
|
"--enable-pci"
|
|
|
|
"--enable-usb"
|
|
|
|
"--enable-usb-ohci"
|
|
|
|
"--enable-usb-ehci"
|
|
|
|
"--enable-usb-xhci"
|
|
|
|
"--enable-ne2000"
|
|
|
|
"--enable-pnic"
|
|
|
|
"--enable-e1000"
|
|
|
|
"--enable-clgd54xx"
|
|
|
|
"--enable-voodoo"
|
|
|
|
"--enable-cdrom"
|
|
|
|
"--enable-sb16"
|
|
|
|
"--enable-es1370"
|
|
|
|
"--enable-busmouse" ];
|
2013-11-23 01:22:05 +00:00
|
|
|
|
2016-09-11 22:24:51 +01:00
|
|
|
NIX_CFLAGS_COMPILE="-I${gtk2.dev}/include/gtk-2.0/ -I${libtool}/include/";
|
2015-10-06 12:23:53 +01:00
|
|
|
NIX_LDFLAGS="-L${libtool.lib}/lib";
|
2016-02-09 10:29:34 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-09 10:29:34 +00:00
|
|
|
|
2017-11-16 12:58:39 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-07-10 11:55:09 +01:00
|
|
|
meta = {
|
2013-11-23 01:22:05 +00:00
|
|
|
description = "An open-source IA-32 (x86) PC emulator";
|
|
|
|
longDescription = ''
|
2017-07-10 11:55:09 +01:00
|
|
|
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.
|
2013-11-23 01:22:05 +00:00
|
|
|
'';
|
2019-12-30 18:13:16 +00:00
|
|
|
homepage = "http://bochs.sourceforge.net/";
|
2014-09-10 19:59:54 +01:00
|
|
|
license = licenses.lgpl2Plus;
|
2019-12-29 17:48:29 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2017-07-10 11:55:09 +01:00
|
|
|
platforms = platforms.unix;
|
2013-11-23 01:22:05 +00:00
|
|
|
};
|
2013-11-24 15:30:16 +00:00
|
|
|
}
|
2017-07-10 11:55:09 +01:00
|
|
|
# TODO: plugins
|
|
|
|
# TODO: svga support - the Bochs sources explicitly cite /usr/include/vga.h
|
|
|
|
# TODO: a better way to organize the options
|