2014-08-08 20:34:41 +01:00
|
|
|
{ stdenv, fetchurl
|
2015-12-12 16:23:56 +00:00
|
|
|
, p7zip, pkgconfig
|
2014-08-08 20:34:41 +01:00
|
|
|
, libX11, libXv
|
|
|
|
, udev
|
2014-09-07 02:57:52 +01:00
|
|
|
, mesa, SDL
|
2015-05-27 20:42:15 +01:00
|
|
|
, libao, openal, libpulseaudio
|
2015-12-12 16:23:56 +00:00
|
|
|
, gtk, gtksourceview
|
|
|
|
, profile ? "balanced" # Options: accuracy, balanced, performance
|
|
|
|
}:
|
2014-08-08 20:34:41 +01:00
|
|
|
|
2015-04-06 02:54:16 +01:00
|
|
|
with stdenv.lib;
|
2014-08-08 20:34:41 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2015-12-12 16:23:56 +00:00
|
|
|
name = "higan-${meta.version}";
|
|
|
|
sourceName = "higan_v${meta.version}-source";
|
2014-08-08 20:34:41 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-12-12 16:23:56 +00:00
|
|
|
urls = [ "http://download.byuu.org/${sourceName}.7z" ];
|
2015-12-23 02:32:06 +00:00
|
|
|
sha256 = "0yc5gwg6dq9iwi2qk3g66wn8j2l55nhdb0311jzmdsh86zcrpvqh";
|
2014-08-08 20:34:41 +01:00
|
|
|
curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick...
|
|
|
|
};
|
|
|
|
|
2015-12-12 16:23:56 +00:00
|
|
|
patches = [ ./0001-change-flags.diff ];
|
|
|
|
|
2015-04-06 02:54:16 +01:00
|
|
|
buildInputs =
|
2015-12-12 16:23:56 +00:00
|
|
|
[ p7zip pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio gtk gtksourceview ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
7z x $src
|
|
|
|
sourceRoot=${sourceName}
|
|
|
|
'';
|
2014-09-07 02:57:52 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
2015-12-12 16:23:56 +00:00
|
|
|
make compiler=c++ profile=${profile} -C icarus
|
|
|
|
make compiler=c++ profile=${profile}
|
2014-09-07 02:57:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2015-12-12 16:23:56 +00:00
|
|
|
install -dm 755 $out/bin $out/share/applications $out/share/higan $out/share/pixmaps
|
|
|
|
install -m 755 icarus/icarus $out/bin/
|
|
|
|
install -m 755 out/tomoko $out/bin/
|
|
|
|
(cd $out/bin; ln -Ts tomoko higan) #backwards compatibility
|
2014-09-07 02:57:52 +01:00
|
|
|
install -m 644 data/higan.desktop $out/share/applications/
|
|
|
|
install -m 644 data/higan.png $out/share/pixmaps/
|
2015-12-12 16:23:56 +00:00
|
|
|
cp -dr --no-preserve='ownership' profile/* data/cheats.bml $out/share/higan/
|
2014-09-07 02:57:52 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
# 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 20:34:41 +01:00
|
|
|
|
2014-09-07 02:57:52 +01:00
|
|
|
chmod +x $out/bin/higan-init.sh
|
|
|
|
'';
|
2014-08-08 20:34:41 +01:00
|
|
|
|
2015-04-06 02:54:16 +01:00
|
|
|
meta = {
|
2015-12-23 02:32:06 +00:00
|
|
|
version = "096";
|
2014-08-08 20:34:41 +01: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 02:57:52 +01:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.AndersonTorres ];
|
|
|
|
platforms = platforms.linux;
|
2014-08-08 20:34:41 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# TODO:
|
2014-08-31 03:48:45 +01:00
|
|
|
# - fix the BML and BIOS paths - maybe submitting
|
|
|
|
# a custom patch to Higan project would not be a bad idea...
|
2014-09-30 21:35:53 +01:00
|
|
|
# - Qt support
|