Skip to content

Commit

Permalink
bochs: interfaces substitute Booleans
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonTorres committed Sep 16, 2024
1 parent 0e3afc4 commit 6f84f70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
24 changes: 3 additions & 21 deletions pkgs/by-name/bo/bochs/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,10 @@

{
options = {
SDL2 = lib.mkOption {
default = true;
interfaces = lib.mkOption {
default = [ "SDL2" "term" "wx" "x11" ];
description = ''
Enable SDL2 interface.
'';
};
term = lib.mkOption {
default = true;
description = ''
Enable ncurses terminal interface.
'';
};
wx = lib.mkOption {
default = true;
description = ''
Enable wxWidgets interface.
'';
};
X11 = lib.mkOption {
default = true;
description = ''
Enable X11 interface.
Interfaces to be enabled.
'';
};
};
Expand Down
20 changes: 12 additions & 8 deletions pkgs/by-name/bo/bochs/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ let
];
};
inherit (eval) config;
enable_SDL2 = lib.elem "SDL2" config.interfaces;
enable_term = lib.elem "term" config.interfaces;
enable_wx = lib.elem "wx" config.interfaces;
enable_x11 = lib.elem "x11" config.interfaces;
in
stdenv.mkDerivation (finalAttrs: {
pname = "bochs";
Expand All @@ -53,14 +57,14 @@ stdenv.mkDerivation (finalAttrs: {
curl
readline
wget
] ++ lib.optionals config.SDL2 [
] ++ lib.optionals enable_SDL2 [
SDL2
] ++ lib.optionals config.term [
] ++ lib.optionals enable_term [
ncurses
] ++ lib.optionals config.wx [
] ++ lib.optionals enable_wx [
gtk3
wxGTK32
] ++ lib.optionals config.X11 [
] ++ lib.optionals enable_x11 [
libGL
libGLU
libX11
Expand Down Expand Up @@ -124,13 +128,13 @@ stdenv.mkDerivation (finalAttrs: {
"--enable-voodoo"
"--enable-x86-64"
"--enable-x86-debugger"
] ++ lib.optionals config.SDL2 [
] ++ lib.optionals enable_SDL2 [
"--with-sdl2"
] ++ lib.optionals config.term [
] ++ lib.optionals enable_term [
"--with-term"
] ++ lib.optionals config.wx [
] ++ lib.optionals enable_wx [
"--with-wx"
] ++ lib.optionals config.X11 [
] ++ lib.optionals enable_x11 [
"--with-x"
"--with-x11"
] ++ lib.optionals (!stdenv.isDarwin) [
Expand Down

0 comments on commit 6f84f70

Please sign in to comment.