nixpkgs-suyu/pkgs/applications/emulators/bochs/default.nix

152 lines
3.5 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
2022-10-30 15:28:31 +01:00
, SDL2
, curl
, docbook_xml_dtd_45
, docbook_xsl
2022-10-30 15:28:31 +01:00
, gtk3
, libGL
, libGLU
, libX11
, libXpm
2022-10-30 15:28:31 +01:00
, libobjc
, libtool
, ncurses
2022-10-30 15:28:31 +01:00
, pkg-config
, readline
, wget
, wxGTK
2022-10-30 15:28:31 +01:00
, enableSDL2 ? true
, enableTerm ? true
, enableWx ? !stdenv.isDarwin
, enableX11 ? !stdenv.isDarwin
}:
2022-07-02 17:36:06 +02:00
stdenv.mkDerivation (finalAttrs: {
pname = "bochs";
version = "2.7";
src = fetchurl {
2022-10-30 15:28:31 +01:00
url = "mirror://sourceforge/project/bochs/bochs/${finalAttrs.version}/bochs-${finalAttrs.version}.tar.gz";
hash = "sha256-oBCrG/3HKsWgjS4kEs1HHA/r1mrx2TSbwNeWh53lsXo=";
};
nativeBuildInputs = [
docbook_xml_dtd_45
docbook_xsl
libtool
pkg-config
];
2022-07-02 17:36:06 +02:00
buildInputs = [
curl
2022-10-28 22:22:30 +02:00
readline
wget
2022-10-30 15:28:31 +01:00
] ++ lib.optionals enableSDL2 [
2022-10-28 22:22:30 +02:00
SDL2
] ++ lib.optionals enableTerm [
ncurses
2022-10-28 22:22:30 +02:00
] ++ lib.optionals enableWx [
gtk3
2022-10-30 15:28:31 +01:00
wxGTK
] ++ lib.optionals enableX11 [
libGL
libGLU
libX11
libXpm
] ++ lib.optionals stdenv.isDarwin [
libobjc
];
configureFlags = [
"--with-rfb=no"
"--with-vncsrv=no"
2021-09-17 03:10:20 +02:00
"--with-nogui"
# 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"
2017-07-10 12:55:09 +02:00
# These are completely configurable, and they don't depend of external tools
"--enable-a20-pin"
"--enable-avx"
"--enable-busmouse"
"--enable-cdrom"
"--enable-clgd54xx"
"--enable-configurable-msrs"
"--enable-cpu-level=6" # from 3 to 6
"--enable-debugger" #conflicts with gdb-stub option
"--enable-debugger-gui"
"--enable-evex"
"--enable-fpu"
"--enable-gdb-stub=no" # conflicts with debugger option
"--enable-handlers-chaining"
"--enable-idle-hack"
"--enable-iodebug"
"--enable-large-ramfile"
"--enable-largefile"
"--enable-pci"
"--enable-repeat-speedups"
"--enable-show-ips"
"--enable-smp"
2021-09-12 03:23:32 +02:00
"--enable-vmx=2"
"--enable-svm"
"--enable-trace-linking"
"--enable-usb"
"--enable-usb-ehci"
"--enable-usb-ohci"
"--enable-usb-xhci"
"--enable-voodoo"
"--enable-x86-64"
"--enable-x86-debugger"
2022-10-30 15:28:31 +01:00
] ++ lib.optionals enableSDL2 [
"--with-sdl2"
] ++ lib.optionals enableTerm [
"--with-term"
] ++ lib.optionals enableWx [
"--with-wx"
] ++ lib.optionals enableX11 [
"--with-x"
"--with-x11"
2022-10-28 22:22:30 +02:00
] ++ lib.optionals (!stdenv.isDarwin) [
"--enable-e1000"
"--enable-es1370"
"--enable-ne2000"
"--enable-plugins"
"--enable-pnic"
"--enable-sb16"
];
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://bochs.sourceforge.io/";
description = "An open-source IA-32 (x86) PC emulator";
longDescription = ''
2017-07-10 12:55:09 +02: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.
'';
license = licenses.lgpl2Plus;
2019-12-29 18:48:29 +01:00
maintainers = with maintainers; [ AndersonTorres ];
2017-07-10 12:55:09 +02:00
platforms = platforms.unix;
};
2022-07-02 17:36:06 +02:00
})
2017-07-10 12:55:09 +02:00
# TODO: a better way to organize the options
# TODO: docbook (docbook-tools from RedHat mirrors should help)