From 60c9fabac140488e0c14677b03d9297b40918187 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Wed, 27 Mar 2024 18:16:46 +0100 Subject: [PATCH] - updated to 2.8; switched from SDL 1.x and wxGTK2-ansi to SDL2 and wxGTK3-unicode --- bochs-build.patch | 11 +++ bochs-wx.patch | 74 ---------------- bochs.spec | 213 ++++++++++++++++++++++++++++++---------------- 3 files changed, 149 insertions(+), 149 deletions(-) create mode 100644 bochs-build.patch delete mode 100644 bochs-wx.patch diff --git a/bochs-build.patch b/bochs-build.patch new file mode 100644 index 0000000..cad85d9 --- /dev/null +++ b/bochs-build.patch @@ -0,0 +1,11 @@ +--- bochs-2.8/instrument/stubs/instrument.cc.orig 2024-03-10 07:59:37.000000000 +0100 ++++ bochs-2.8/instrument/stubs/instrument.cc 2024-03-26 20:47:30.140134418 +0100 +@@ -24,6 +24,8 @@ + + #if BX_INSTRUMENTATION + ++class bxInstruction_c; ++ + void bx_instr_init_env(void) {} + void bx_instr_exit_env(void) {} + diff --git a/bochs-wx.patch b/bochs-wx.patch deleted file mode 100644 index 8c66254..0000000 --- a/bochs-wx.patch +++ /dev/null @@ -1,74 +0,0 @@ ---- bochs-2.3/gui/wx.cc.org 2006-12-16 03:08:18.928681500 +0100 -+++ bochs-2.3/gui/wx.cc 2006-12-16 03:12:05.546844250 +0100 -@@ -821,9 +821,13 @@ - case WXK_NUMPAD_UP: bx_key = BX_KEY_KP_UP; break; - case WXK_NUMPAD_RIGHT: bx_key = BX_KEY_KP_RIGHT; break; - case WXK_NUMPAD_DOWN: bx_key = BX_KEY_KP_DOWN; break; -+#if WXK_NUMPAD_PRIOR != WXK_NUMPAD_PAGEUP - case WXK_NUMPAD_PRIOR: bx_key = BX_KEY_KP_PAGE_UP; break; -+#endif - case WXK_NUMPAD_PAGEUP: bx_key = BX_KEY_KP_PAGE_UP; break; -+#if WXK_NUMPAD_NEXT != WXK_NUMPAD_PAGEDOWN - case WXK_NUMPAD_NEXT: bx_key = BX_KEY_KP_PAGE_DOWN; break; -+#endif - case WXK_NUMPAD_PAGEDOWN: bx_key = BX_KEY_KP_PAGE_DOWN; break; - case WXK_NUMPAD_END: bx_key = BX_KEY_KP_END; break; - case WXK_NUMPAD_BEGIN: bx_key = BX_KEY_KP_HOME; break; -@@ -849,7 +853,8 @@ - case 220: bx_key = BX_KEY_BACKSLASH; break; // \| - case 222: bx_key = BX_KEY_SINGLE_QUOTE; break; // '" - case 305: bx_key = BX_KEY_KP_5; break; // keypad 5 -- case 392: bx_key = BX_KEY_KP_ADD; break; // keypad plus -+/* same as WXK_NUMPAD_DIVIDE ?! */ -+// case 392: bx_key = BX_KEY_KP_ADD; break; // keypad plus - - default: - wxLogMessage(wxT ("Unhandled key event: %i (0x%x)"), key, key); ---- bochs-2.3/gui/wxdialog.h.org 2006-12-16 03:16:44.252262250 +0100 -+++ bochs-2.3/gui/wxdialog.h 2006-12-16 03:19:08.005246250 +0100 -@@ -5,6 +5,7 @@ - // wxWidgets dialogs for Bochs - - #include -+#include - - //////////////////////////////////////////////////////////////////// - // text messages used in several places ---- bochs-2.3/gui/wxdialog.cc.org 2006-12-16 03:20:44.187257250 +0100 -+++ bochs-2.3/gui/wxdialog.cc 2006-12-16 03:21:14.213133750 +0100 -@@ -818,7 +818,7 @@ - { - paramHash->BeginFind(); - wxNode *node; -- while ((node = paramHash->Next()) != NULL) { -+ while ((node = (wxNode *)paramHash->Next()) != NULL) { - // assume that no ParamStruct appears in the hash table under multiple - // keys. If so, we will delete it twice and corrupt memory. - ParamStruct *pstr = (ParamStruct*) node->GetData(); -@@ -1129,7 +1129,7 @@ - // loop through all the parameters - idHash->BeginFind(); - wxNode *node; -- while ((node = idHash->Next()) != NULL) { -+ while ((node = (wxNode *)idHash->Next()) != NULL) { - ParamStruct *pstr = (ParamStruct*) node->GetData(); - wxLogDebug(wxT("commit changes for param %s"), pstr->param->get_name()); - int type = pstr->param->get_type(); -@@ -1209,7 +1209,7 @@ - { - idHash->BeginFind(); - wxNode *node; -- while ((node = idHash->Next ()) != NULL) { -+ while ((node = (wxNode *)idHash->Next ()) != NULL) { - ParamStruct *pstr = (ParamStruct*) node->GetData(); - if (pstr->param->get_type() == BXT_PARAM_BOOL) - EnableChanged(pstr); -@@ -1410,7 +1410,7 @@ - // loop through all the parameters - idHash->BeginFind (); - wxNode *node; -- while ((node = idHash->Next ()) != NULL) { -+ while ((node = (wxNode *)idHash->Next ()) != NULL) { - ParamStruct *pstr = (ParamStruct*) node->GetData (); - IFDBG_DLG(wxLogDebug(wxT("refresh param %s"), pstr->param->get_name())); - int type = pstr->param->get_type (); diff --git a/bochs.spec b/bochs.spec index 64b125f..db7690a 100644 --- a/bochs.spec +++ b/bochs.spec @@ -1,35 +1,40 @@ # TODO: # - more subpackages (plugins) # -# Conditional build: -%bcond_without svga # without svgalib support -# Summary: Portable x86 PC Emulator Summary(pl.UTF-8): Przenośny emulator x86 PC Name: bochs -Version: 2.3 -Release: 0.1 -License: GPL +Version: 2.8 +Release: 1 +License: LGPL v2+ Group: Applications/Emulators -Source0: http://dl.sourceforge.net/bochs/%{name}-%{version}.tar.gz -# Source0-md5: 100c02fbcd402c2b4862d0251be539fd -Patch0: %{name}-wx.patch -URL: http://bochs.sourceforge.net/ -BuildRequires: SDL-devel -BuildRequires: autoconf +Source0: https://downloads.sourceforge.net/bochs/%{name}-%{version}.tar.gz +# Source0-md5: c65bc348938b5677f86feaef51c43efe +Patch0: %{name}-build.patch +URL: https://bochs.sourceforge.net/ +BuildRequires: SDL2-devel >= 2 +BuildRequires: alsa-lib-devel +BuildRequires: autoconf >= 2.71 BuildRequires: automake BuildRequires: docbook-dtd41-sgml -BuildRequires: gtk+2-devel >= 1:2.0 +BuildRequires: gtk+3-devel >= 3.0 +BuildRequires: libltdl-devel +BuildRequires: libsamplerate-devel BuildRequires: libstdc++-devel +BuildRequires: libtool +BuildRequires: libvncserver-devel BuildRequires: ncurses-devel BuildRequires: pkgconfig -%{?with_svga:BuildRequires: svgalib-devel} -BuildRequires: wxGTK2-devel -#BuildRequires: xorg-???-devel -BuildRequires: zlib-devel +BuildRequires: wxGTK3-unicode-devel +BuildRequires: xorg-lib-libX11-devel +BuildRequires: xorg-lib-libXpm-devel +BuildRequires: xorg-lib-libXrandr-devel #Requires: xorg-font-??? BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +# plugins use symbols from executable +%define skip_post_check_so libbx_.* + %description Bochs is a portable x86 PC emulation software package that emulates enough of the x86 CPU, related AT hardware, and BIOS to run DOS, @@ -47,61 +52,44 @@ Twoim komputerze. %build cp -f /usr/share/automake/config.sub . +%{__libtoolize} +%{__aclocal} %{__autoconf} -CXXFLAGS="%{rpmcflags} -I/usr/include/ncurses `pkg-config gdk-2.0 --cflags`" -LDFLAGS=`pkg-config gdk-2.0 --libs` -export CXXFLAGS LDFLAGS -# --enable-x86-64 (not supported together with --enable-sep) -# --enable-debugger --enable-iodebug --enable-x86-debugger (slowdowns emulation) -# --enable-apic (no need to specify, configure will choose best depending on nr cpus) - -WXGTK2CONFIG="" -[ -x /usr/bin/wx-gtk2-ansi-config ] && WXGTK2CONFIG=wx-gtk2-ansi-config -[ -x /usr/bin/wxgtk-2.4-config ] && WXGTK2CONFIG=wxgtk-2.4-config - -[ "x$WXGTK2CONFIG" == "x" ] && echo "Can't find wxGTK2 config file!" && exit 1 - +CPPFLAGS="%{rpmcppflags} -I/usr/include/ncurses" %configure \ - WX_CONFIG=$WXGTK2CONFIG \ - --enable-new-pit \ - --enable-plugins \ + WX_CONFIG="wx-gtk3-unicode-config" \ + --enable-3dnow \ + --enable-all-optimizations \ + --enable-cdrom \ + --enable-clgd54xx \ --enable-cpu-level=6 \ - --enable-compressed-hd \ - --enable-ne2000 \ - --enable-pci \ - --enable-usb \ - --enable-4meg-pages \ - --enable-pae \ - --enable-guest2host-tlb \ - --enable-repeat-speedups \ - --enable-icache \ + --enable-e1000 \ + --enable-es1370 \ %ifarch %{ix86} --enable-fast-function-calls \ %endif - --enable-global-pages \ - --enable-host-specific-asms \ - --enable-ignore-bad-msr \ - --enable-disasm \ - --enable-all-optimizations \ - --enable-readline \ - --enable-instrumentation \ - --enable-vbe \ --enable-fpu \ - --enable-mmx \ - --enable-3dnow \ - --enable-sse=2 \ - --enable-sep \ - --enable-cdrom \ - --enable-sb16=linux \ --enable-gameport \ - --with-x \ - --with-wx \ + --enable-instrumentation \ + --enable-monitor-mwait \ + --enable-ne2000 \ + --enable-pci \ + --enable-plugins \ + --enable-readline \ + --enable-repeat-speedups \ + --enable-sb16 \ + --enable-smp \ + --enable-usb \ + --enable-usb-ehci \ + --enable-usb-xhci \ + --enable-voodoo \ + --enable-x86-64 \ --with-rfb \ - --with-sdl \ - %{?with_svga:-with-svga} \ - --with-x11 \ + --with-sdl2 \ --with-term \ - --with-rfb + --with-vncsrv \ + --with-wx \ + --with-x11 %{__make} @@ -112,29 +100,104 @@ rm -rf $RPM_BUILD_ROOT DESTDIR=$RPM_BUILD_ROOT \ docdir=%{_docdir}/%{name}-%{version} -mv -f $RPM_BUILD_ROOT%{_datadir}/bochs/VGABIOS*{LICENSE,README} \ +%{__mv} $RPM_BUILD_ROOT%{_datadir}/bochs/VGABIOS*-{LICENSE,README} \ + $RPM_BUILD_ROOT%{_datadir}/bochs/Sea*BIOS-README \ $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} -cp -f TESTFORM.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} - -#rm -f $RPM_BUILD_ROOT%{_datadir}/bochs/*fonts -#rm -f $RPM_BUILD_ROOT%{_datadir}/bochs/*pcf +cp -pf TESTFORM.txt $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} -#find $RPM_BUILD_ROOT -type d -name CVS | xargs rm -rf +# lt_dlopened by libbx_*.so names +%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la %clean rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%attr(755,root,root) %{_bindir}/* +%attr(755,root,root) %{_bindir}/bochs +%attr(755,root,root) %{_bindir}/bxhub +%attr(755,root,root) %{_bindir}/bximage %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins -%attr(755,root,root) %{_libdir}/%{name}/plugins/*.so.* -%{_libdir}/%{name}/plugins/*.la +# -- gui plugins +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_rfb_gui.so* +# R: SDL2 +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_sdl2_gui.so* +# R: ncurses +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_term_gui.so* +# R: libvncserver +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vncsrv_gui.so* +# R: wxGTK3-unicode +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_wx_gui.so* +# R: libX11 libXpm libXrandr +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_x_gui.so* +# -- img plugins +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vbox_img.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vmware3_img.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vmware4_img.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vpc_img.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vvfat_img.so* +# -- eth plugins +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_linux.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_null.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_slirp.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_socket.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_tuntap.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_vde.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_eth_vnet.so* +# -- sound plugins +# R: alsa-lib +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_soundalsa.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_sounddummy.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_soundfile.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_soundoss.so* +# R: SDL2 +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_soundsdl.so* +# -- generic plugins +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_acpi.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_biosdev.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_cmos.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_dma.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_e1000.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_es1370.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_extfpuirq.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_floppy.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_gameport.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_harddrv.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_hpet.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_ioapic.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_keyboard.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_ne2k.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_parallel.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_pci.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_pci2isa.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_pci_ide.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_pic.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_pit.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_sb16.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_serial.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_speaker.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_svga_cirrus.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_textconfig.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_unmapped.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_ehci.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_floppy.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_hid.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_hub.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_msd.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_printer.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_uhci.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_usb_xhci.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_vga.so* +%attr(755,root,root) %{_libdir}/%{name}/plugins/libbx_voodoo.so* %dir %{_datadir}/%{name} -%dir %{_datadir}/%{name}/keymaps -%{_datadir}/%{name}/keymaps/*.map -%{_datadir}/%{name}/*BIOS* -%{_mandir}/man[15]/* +%{_datadir}/%{name}/keymaps +%{_datadir}/%{name}/BIOS-* +%{_datadir}/%{name}/VGABIOS-* +%{_datadir}/%{name}/bios.bin* +%{_datadir}/%{name}/vgabios-*.bin* +%{_mandir}/man1/bochs.1* +%{_mandir}/man1/bochs-dlx.1* +%{_mandir}/man1/bximage.1* +%{_mandir}/man5/bochsrc.5* %{_docdir}/%{name}-%{version} -- 2.43.0