2014-08-08 19:34:41 +00:00
|
|
|
{ stdenv, fetchurl
|
2015-12-12 16:23:56 +00:00
|
|
|
, p7zip, pkgconfig
|
2014-08-08 19:34:41 +00:00
|
|
|
, libX11, libXv
|
|
|
|
, udev
|
2014-09-07 01:57:52 +00:00
|
|
|
, mesa, SDL
|
2015-05-27 19:42:15 +00:00
|
|
|
, libao, openal, libpulseaudio
|
2015-12-12 16:23:56 +00:00
|
|
|
, gtk, gtksourceview
|
|
|
|
}:
|
2014-08-08 19:34:41 +00:00
|
|
|
|
2015-04-06 01:54:16 +00:00
|
|
|
with stdenv.lib;
|
2014-08-08 19:34:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2016-04-15 17:46:33 +00:00
|
|
|
name = "higan-${version}";
|
|
|
|
version = "098";
|
|
|
|
sourceName = "higan_v${version}-source";
|
2014-08-08 19:34:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-12-12 16:23:56 +00:00
|
|
|
urls = [ "http://download.byuu.org/${sourceName}.7z" ];
|
2016-04-15 17:46:33 +00:00
|
|
|
sha256 = "0qphvjfv17dbmzgb4pny2q6ln0lsgzyhalq6qyqxc3qwm4fzdjv1";
|
2014-08-08 19:34:41 +00: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 01:54:16 +00: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 01:57:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2016-04-15 17:46:33 +00:00
|
|
|
make compiler=c++ -C icarus
|
|
|
|
make compiler=c++ -C higan
|
2014-09-07 01:57:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2015-12-12 16:23:56 +00:00
|
|
|
install -dm 755 $out/bin $out/share/applications $out/share/higan $out/share/pixmaps
|
2016-04-15 17:46:33 +00:00
|
|
|
install -m 755 icarus/out/icarus $out/bin/
|
|
|
|
install -m 755 higan/out/higan $out/bin/
|
|
|
|
install -m 644 higan/data/higan.desktop $out/share/applications/
|
|
|
|
install -m 644 higan/data/higan.png $out/share/pixmaps/
|
|
|
|
cp --recursive --no-dereference --preserve='links' --no-preserve='ownership' higan/data/cheats.bml higan/profile/* $out/share/higan/
|
2014-09-07 01:57:52 +00: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}
|
|
|
|
|
2016-04-15 17:46:33 +00:00
|
|
|
cp --update $out/share/higan/cheats.bml \$HOME/.config/
|
|
|
|
cp --recursive --update $out/share/higan/*.sys \$HOME/.local/share/higan/
|
|
|
|
|
2014-09-07 01:57:52 +00:00
|
|
|
EOF
|
2014-08-08 19:34:41 +00:00
|
|
|
|
2014-09-07 01:57:52 +00:00
|
|
|
chmod +x $out/bin/higan-init.sh
|
|
|
|
'';
|
2014-08-08 19:34:41 +00:00
|
|
|
|
2015-04-06 01:54:16 +00:00
|
|
|
meta = {
|
2014-08-08 19:34:41 +00: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
|
2016-04-15 17:46:33 +00:00
|
|
|
WonderSwan; WonderSwan Color
|
2014-08-08 19:34:41 +00:00
|
|
|
higan also supports the following subsystems:
|
|
|
|
Super Game Boy; BS-X Satellaview; Sufami Turbo
|
|
|
|
'';
|
|
|
|
homepage = http://byuu.org/higan/;
|
2014-09-07 01:57:52 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = [ maintainers.AndersonTorres ];
|
|
|
|
platforms = platforms.linux;
|
2014-08-08 19:34:41 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# TODO:
|
2014-08-31 02:48:45 +00:00
|
|
|
# - fix the BML and BIOS paths - maybe submitting
|
2016-04-15 17:46:33 +00:00
|
|
|
# a custom patch to upstream would not be a bad idea...
|