Higan: adding config.higan.{guiToolkit,profile} options

Now we can parametrize Higan locally.
By default, guiToolkit = "gtk" and profile = "performance" (the accuracy
profile is seriously slow on my machine :) )

Closes #4340
This commit is contained in:
AndersonTorres 2014-09-30 17:35:53 -03:00 committed by Mateusz Kowalczyk
parent 0e9cf136af
commit 1c0d37a038
2 changed files with 12 additions and 13 deletions

View File

@ -4,12 +4,12 @@
, udev , udev
, mesa, SDL , mesa, SDL
, libao, openal, pulseaudio , libao, openal, pulseaudio
, profile ? "accuracy" # Options: accuracy, balanced, performance , profile ? "performance" # Options: accuracy, balanced, performance
, gui ? "gtk" # can be gtk or qt4 , guiToolkit ? "gtk" # can be gtk or qt4
, gtk ? null, qt4 ? null }: , gtk ? null, qt4 ? null }:
assert gui == "gtk" || gui == "qt4"; assert guiToolkit == "gtk" || guiToolkit == "qt4";
assert (gui == "gtk" -> gtk != null) || (gui == "qt4" -> qt4 != null); assert (guiToolkit == "gtk" -> gtk != null) || (guiToolkit == "qt4" -> qt4 != null);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -18,19 +18,19 @@ stdenv.mkDerivation rec {
sourceName = "higan_v${version}-source"; sourceName = "higan_v${version}-source";
src = fetchurl { src = fetchurl {
url = "http://byuu.org/files/${sourceName}.tar.xz"; urls = [ "http://byuu.org/files/${sourceName}.tar.xz" "http://byuu.net/files/${sourceName}.tar.xz" ];
sha256 = "06qm271pzf3qf2labfw2lx6k0xcd89jndmn0jzmnc40cspwrs52y"; sha256 = "06qm271pzf3qf2labfw2lx6k0xcd89jndmn0jzmnc40cspwrs52y";
curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick... curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick...
}; };
buildInputs = with stdenv.lib; buildInputs = with stdenv.lib;
[ pkgconfig libX11 libXv udev mesa SDL libao openal pulseaudio ] [ pkgconfig libX11 libXv udev mesa SDL libao openal pulseaudio ]
++ optionals (gui == "gtk") [ gtk ] ++ optionals (guiToolkit == "gtk") [ gtk ]
++ optionals (gui == "qt4") [ qt4 ]; ++ optionals (guiToolkit == "qt4") [ qt4 ];
buildPhase = '' buildPhase = ''
make phoenix=${gui} profile=${profile} -C ananke make phoenix=${guiToolkit} profile=${profile} -C ananke
make phoenix=${gui} profile=${profile} make phoenix=${guiToolkit} profile=${profile}
''; '';
installPhase = '' installPhase = ''
@ -86,5 +86,4 @@ stdenv.mkDerivation rec {
# TODO: # TODO:
# - fix the BML and BIOS paths - maybe submitting # - fix the BML and BIOS paths - maybe submitting
# a custom patch to Higan project would not be a bad idea... # a custom patch to Higan project would not be a bad idea...
# - config.higan.{gui,profile} options # - Qt support
#

View File

@ -12091,8 +12091,8 @@ let
snes9x-gtk = callPackage ../misc/emulators/snes9x-gtk { }; snes9x-gtk = callPackage ../misc/emulators/snes9x-gtk { };
higan = callPackage ../misc/emulators/higan { higan = callPackage ../misc/emulators/higan {
profile = "accuracy"; profile = config.higan.profile or "performance";
gui = "gtk"; guiToolkit = config.higan.guiToolkit or "gtk";
}; };
misc = import ../misc/misc.nix { inherit pkgs stdenv; }; misc = import ../misc/misc.nix { inherit pkgs stdenv; };