2014-08-08 21:34:41 +02:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, pkgconfig
|
|
|
|
, libX11, libXv
|
|
|
|
, udev
|
2014-09-07 03:57:52 +02:00
|
|
|
, mesa, SDL
|
2014-08-08 21:34:41 +02:00
|
|
|
, libao, openal, pulseaudio
|
2014-09-30 22:35:53 +02:00
|
|
|
, profile ? "performance" # Options: accuracy, balanced, performance
|
|
|
|
, guiToolkit ? "gtk" # can be gtk or qt4
|
2014-09-07 03:57:52 +02:00
|
|
|
, gtk ? null, qt4 ? null }:
|
|
|
|
|
2014-09-30 22:35:53 +02:00
|
|
|
assert guiToolkit == "gtk" || guiToolkit == "qt4";
|
|
|
|
assert (guiToolkit == "gtk" -> gtk != null) || (guiToolkit == "qt4" -> qt4 != null);
|
2014-08-08 21:34:41 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "higan-${version}";
|
|
|
|
version = "094";
|
|
|
|
sourceName = "higan_v${version}-source";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2014-09-30 22:35:53 +02:00
|
|
|
urls = [ "http://byuu.org/files/${sourceName}.tar.xz" "http://byuu.net/files/${sourceName}.tar.xz" ];
|
2014-08-08 21:34:41 +02:00
|
|
|
sha256 = "06qm271pzf3qf2labfw2lx6k0xcd89jndmn0jzmnc40cspwrs52y";
|
|
|
|
curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick...
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = with stdenv.lib;
|
2014-09-07 03:57:52 +02:00
|
|
|
[ pkgconfig libX11 libXv udev mesa SDL libao openal pulseaudio ]
|
2014-09-30 22:35:53 +02:00
|
|
|
++ optionals (guiToolkit == "gtk") [ gtk ]
|
|
|
|
++ optionals (guiToolkit == "qt4") [ qt4 ];
|
2014-09-07 03:57:52 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
2014-09-30 22:35:53 +02:00
|
|
|
make phoenix=${guiToolkit} profile=${profile} -C ananke
|
|
|
|
make phoenix=${guiToolkit} profile=${profile}
|
2014-09-07 03:57:52 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -dm 755 $out/share/applications $out/share/pixmaps $out/share/higan/Video\ Shaders $out/bin $out/lib
|
|
|
|
|
|
|
|
install -m 644 data/higan.desktop $out/share/applications/
|
|
|
|
install -m 644 data/higan.png $out/share/pixmaps/
|
|
|
|
cp -dr --no-preserve=ownership profile/* data/cheats.bml $out/share/higan/
|
|
|
|
cp -dr --no-preserve=ownership shaders/*.shader $out/share/higan/Video\ Shaders/
|
|
|
|
|
|
|
|
install -m 755 out/higan $out/bin/higan
|
|
|
|
install -m 644 ananke/libananke.so $out/lib/libananke.so.1
|
|
|
|
(cd $out/lib && ln -s libananke.so.1 libananke.so)
|
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
oldRPath=$(patchelf --print-rpath $out/bin/higan)
|
|
|
|
patchelf --set-rpath $oldRPath:$out/lib $out/bin/higan
|
|
|
|
|
|
|
|
# A dirty workaround, suggested by @cpages:
|
|
|
|
# we create a first-run script to populate
|
|
|
|
# the local $HOME with all the auxiliary
|
|
|
|
# stuff needed by higan at runtime
|
|
|
|
|
|
|
|
cat <<EOF > $out/bin/higan-init.sh
|
|
|
|
#!${stdenv.shell}
|
|
|
|
|
|
|
|
cp --update --recursive $out/share/higan \$HOME/.config
|
|
|
|
chmod --recursive u+w \$HOME/.config/higan
|
|
|
|
EOF
|
2014-08-08 21:34:41 +02:00
|
|
|
|
2014-09-07 03:57:52 +02:00
|
|
|
chmod +x $out/bin/higan-init.sh
|
|
|
|
'';
|
2014-08-08 21:34:41 +02:00
|
|
|
|
2014-09-07 03:57:52 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-08 21:34:41 +02:00
|
|
|
description = "An open-source, cycle-accurate Nintendo multi-system emulator";
|
|
|
|
longDescription = ''
|
|
|
|
Higan (formerly bsnes) is a Nintendo multi-system emulator.
|
|
|
|
It currently supports the following systems:
|
|
|
|
Famicom; Super Famicom;
|
|
|
|
Game Boy; Game Boy Color; Game Boy Advance
|
|
|
|
higan also supports the following subsystems:
|
|
|
|
Super Game Boy; BS-X Satellaview; Sufami Turbo
|
|
|
|
'';
|
|
|
|
homepage = http://byuu.org/higan/;
|
2014-09-07 03:57:52 +02:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.AndersonTorres ];
|
|
|
|
platforms = platforms.linux;
|
2014-08-08 21:34:41 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# TODO:
|
2014-08-31 04:48:45 +02:00
|
|
|
# - fix the BML and BIOS paths - maybe submitting
|
|
|
|
# a custom patch to Higan project would not be a bad idea...
|
2014-09-30 22:35:53 +02:00
|
|
|
# - Qt support
|