From a166b351107d297e76a945e627b0aa56c7cfdc63 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 28 Oct 2022 22:22:30 +0200 Subject: [PATCH] bochs: unbreak on darwin --- pkgs/applications/emulators/bochs/default.nix | 65 +++++++++++-------- pkgs/top-level/all-packages.nix | 3 +- 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/pkgs/applications/emulators/bochs/default.nix b/pkgs/applications/emulators/bochs/default.nix index 8b7cc9fad067..3bfbf08c185c 100644 --- a/pkgs/applications/emulators/bochs/default.nix +++ b/pkgs/applications/emulators/bochs/default.nix @@ -1,21 +1,26 @@ { lib , stdenv , fetchurl -, SDL2 -, curl , docbook_xml_dtd_45 , docbook_xsl -, gtk2 +, libtool +, pkg-config +, curl +, readline +, wget +, libobjc +, enableX11 ? !stdenv.isDarwin , libGL , libGLU , libX11 , libXpm -, libtool +, enableSdl2 ? true +, SDL2 +, enableTerm ? true , ncurses -, pkg-config -, readline -, wget +, enableWx ? !stdenv.isDarwin , wxGTK +, gtk3 }: stdenv.mkDerivation (finalAttrs: { @@ -35,23 +40,26 @@ stdenv.mkDerivation (finalAttrs: { ]; buildInputs = [ - SDL2 curl - gtk2 + readline + wget + ] ++ lib.optionals stdenv.isDarwin [ + libobjc + ] ++ lib.optionals enableX11 [ libGL libGLU libX11 libXpm + ] ++ lib.optionals enableSdl2 [ + SDL2 + ] ++ lib.optionals enableTerm [ ncurses - readline - wget + ] ++ lib.optionals enableWx [ wxGTK + gtk3 ]; configureFlags = [ - "--with-x=yes" - "--with-x11=yes" - "--with-rfb=no" "--with-vncsrv=no" "--with-nogui" @@ -84,8 +92,6 @@ stdenv.mkDerivation (finalAttrs: { "--enable-cpu-level=6" # from 3 to 6 "--enable-debugger" #conflicts with gdb-stub option "--enable-debugger-gui" - "--enable-e1000" - "--enable-es1370" "--enable-evex" "--enable-fpu" "--enable-gdb-stub=no" # conflicts with debugger option @@ -94,12 +100,8 @@ stdenv.mkDerivation (finalAttrs: { "--enable-iodebug" "--enable-large-ramfile" "--enable-largefile" - "--enable-ne2000" "--enable-pci" - "--enable-plugins=yes" - "--enable-pnic" "--enable-repeat-speedups" - "--enable-sb16" "--enable-show-ips" "--enable-smp" "--enable-vmx=2" @@ -112,11 +114,23 @@ stdenv.mkDerivation (finalAttrs: { "--enable-voodoo" "--enable-x86-64" "--enable-x86-debugger" - ] - # Boolean flags - ++ lib.optionals (SDL2 != null) [ "--with-sdl2" ] - ++ lib.optionals (ncurses != null) [ "--with-term" ] - ++ lib.optionals (gtk2 != null && wxGTK != null) [ "--with-wx" ]; + ] ++ lib.optionals (!stdenv.isDarwin) [ + "--enable-e1000" + "--enable-es1370" + "--enable-ne2000" + "--enable-plugins" + "--enable-pnic" + "--enable-sb16" + ] ++ lib.optionals enableX11 [ + "--with-x" + "--with-x11" + ] ++ lib.optionals enableSdl2 [ + "--with-sdl2" + ] ++ lib.optionals enableTerm [ + "--with-term" + ] ++ lib.optionals enableWx [ + "--with-wx" + ]; enableParallelBuilding = true; @@ -131,7 +145,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.lgpl2Plus; maintainers = with maintainers; [ AndersonTorres ]; platforms = platforms.unix; - broken = stdenv.isDarwin; }; }) # TODO: a better way to organize the options diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4f4e672994a5..c3c9c67492fd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1489,7 +1489,8 @@ with pkgs; basiliskii = callPackage ../applications/emulators/basiliskii { }; bochs = callPackage ../applications/emulators/bochs { - wxGTK = wxGTK30; + inherit (darwin) libobjc; + wxGTK = wxGTK32; }; box64 = callPackage ../applications/emulators/box64 { };