Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / by-name / bo / bochs / package.nix
blob803d6ae2852e3851135720f126e97c027f3b2e96
1 { lib
2 , stdenv
3 , fetchurl
4 , SDL2
5 , curl
6 , darwin
7 , docbook_xml_dtd_45
8 , docbook_xsl
9 , gtk3
10 , libGL
11 , libGLU
12 , libX11
13 , libXpm
14 , libtool
15 , ncurses
16 , pkg-config
17 , readline
18 , wget
19 , wxGTK32
20 , enableSDL2 ? true
21 , enableTerm ? true
22 , enableWx ? !stdenv.isDarwin
23 , enableX11 ? !stdenv.isDarwin
26 stdenv.mkDerivation (finalAttrs: {
27   pname = "bochs";
28   version = "2.7";
30   src = fetchurl {
31     url = "mirror://sourceforge/project/bochs/bochs/${finalAttrs.version}/bochs-${finalAttrs.version}.tar.gz";
32     hash = "sha256-oBCrG/3HKsWgjS4kEs1HHA/r1mrx2TSbwNeWh53lsXo=";
33   };
35   nativeBuildInputs = [
36     docbook_xml_dtd_45
37     docbook_xsl
38     libtool
39     pkg-config
40   ];
42   buildInputs = [
43     curl
44     readline
45     wget
46   ] ++ lib.optionals enableSDL2 [
47     SDL2
48   ] ++ lib.optionals enableTerm [
49     ncurses
50   ] ++ lib.optionals enableWx [
51     gtk3
52     wxGTK32
53   ] ++ lib.optionals enableX11 [
54     libGL
55     libGLU
56     libX11
57     libXpm
58   ] ++ lib.optionals stdenv.isDarwin [
59     darwin.libobjc
60   ];
62   configureFlags = [
63     "--with-rfb=no"
64     "--with-vncsrv=no"
65     "--with-nogui"
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"
72     "--enable-xpm=yes"
74     # ... whereas these, always "no"!
75     "--enable-cpp=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
81     "--enable-3dnow=no"
82     "--enable-monitor-mwait=no"
83     "--enable-raw-serial=no"
85     # These are completely configurable, and they don't depend of external tools
86     "--enable-a20-pin"
87     "--enable-avx"
88     "--enable-busmouse"
89     "--enable-cdrom"
90     "--enable-clgd54xx"
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"
95     "--enable-evex"
96     "--enable-fpu"
97     "--enable-gdb-stub=no" # conflicts with debugger option
98     "--enable-handlers-chaining"
99     "--enable-idle-hack"
100     "--enable-iodebug"
101     "--enable-large-ramfile"
102     "--enable-largefile"
103     "--enable-pci"
104     "--enable-repeat-speedups"
105     "--enable-show-ips"
106     "--enable-smp"
107     "--enable-vmx=2"
108     "--enable-svm"
109     "--enable-trace-linking"
110     "--enable-usb"
111     "--enable-usb-ehci"
112     "--enable-usb-ohci"
113     "--enable-usb-xhci"
114     "--enable-voodoo"
115     "--enable-x86-64"
116     "--enable-x86-debugger"
117   ] ++ lib.optionals enableSDL2 [
118     "--with-sdl2"
119   ] ++ lib.optionals enableTerm [
120     "--with-term"
121   ] ++ lib.optionals enableWx [
122     "--with-wx"
123   ] ++ lib.optionals enableX11 [
124     "--with-x"
125     "--with-x11"
126   ] ++ lib.optionals (!stdenv.isDarwin) [
127     "--enable-e1000"
128     "--enable-es1370"
129     "--enable-ne2000"
130     "--enable-plugins"
131     "--enable-pnic"
132     "--enable-sb16"
133   ];
135   enableParallelBuilding = true;
137   meta = {
138     homepage = "https://bochs.sourceforge.io/";
139     description = "An open-source IA-32 (x86) PC emulator";
140     longDescription = ''
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.
144     '';
145     license = lib.licenses.lgpl2Plus;
146     maintainers = with lib.maintainers; [ AndersonTorres ];
147     platforms = lib.platforms.unix;
148   };
150 # TODO: a better way to organize the options
151 # TODO: docbook (docbook-tools from RedHat mirrors should help)