Merge pull request #11659 from AndersonTorres/higan

Higan: 094 -> 095
This commit is contained in:
Pascal Wittmann 2015-12-19 17:37:41 +01:00
commit e0027501f1
3 changed files with 61 additions and 30 deletions

View File

@ -0,0 +1,35 @@
diff -rupN higan_v095-source.orig/GNUmakefile higan_v095-source/GNUmakefile
--- higan_v095-source.orig/GNUmakefile 2015-11-04 10:28:26.173428178 +0100
+++ higan_v095-source/GNUmakefile 2015-11-04 10:28:31.752231593 +0100
@@ -12,7 +12,8 @@ target := tomoko
# console := true
# compiler
-flags += -I. -O3
+flags += -I. $(CXXFLAGS)
+link += $(LDFLAGS)
objects := libco
# profile-guided optimization mode
@@ -43,7 +44,7 @@ ifeq ($(platform),windows)
else ifeq ($(platform),macosx)
flags += -march=native
else ifeq ($(platform),linux)
- flags += -march=native -fopenmp
+ flags += -fopenmp
link += -fopenmp
link += -Wl,-export-dynamic
link += -lX11 -lXext -ldl
diff -rupN higan_v095-source.orig/icarus/GNUmakefile higan_v095-source/icarus/GNUmakefile
--- higan_v095-source.orig/icarus/GNUmakefile 2015-11-04 10:28:26.186486119 +0100
+++ higan_v095-source/icarus/GNUmakefile 2015-11-04 10:28:48.755059317 +0100
@@ -1,8 +1,8 @@
include ../nall/GNUmakefile
include ../hiro/GNUmakefile
-flags += -I.. -O3
-link +=
+flags += -I.. $(CXXFLAGS)
+link += $(LDFLAGS)
objects := obj/hiro.o obj/icarus.o
objects += $(if $(call streq,$(platform),windows),obj/resource.o)

View File

@ -1,56 +1,51 @@
{ stdenv, fetchurl { stdenv, fetchurl
, pkgconfig , p7zip, pkgconfig
, libX11, libXv , libX11, libXv
, udev , udev
, mesa, SDL , mesa, SDL
, libao, openal, libpulseaudio , libao, openal, libpulseaudio
, profile ? "performance" # Options: accuracy, balanced, performance , gtk, gtksourceview
, guiToolkit ? "gtk" # can be gtk or qt4 , profile ? "balanced" # Options: accuracy, balanced, performance
, gtk ? null, qt4 ? null }: }:
assert guiToolkit == "gtk" || guiToolkit == "qt4";
assert (guiToolkit == "gtk" -> gtk != null) || (guiToolkit == "qt4" -> qt4 != null);
with stdenv.lib; with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "higan-${version}"; name = "higan-${meta.version}";
version = "094"; sourceName = "higan_v${meta.version}-source";
sourceName = "higan_v${version}-source";
src = fetchurl { src = fetchurl {
urls = [ "http://files.byuu.org/download/${sourceName}.tar.xz" ]; urls = [ "http://download.byuu.org/${sourceName}.7z" ];
sha256 = "06qm271pzf3qf2labfw2lx6k0xcd89jndmn0jzmnc40cspwrs52y"; sha256 = "0xsgyijcf4psi3mlahr5iq7vbbw3jby1if5pkhg8c5xqckpi2fj4";
curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick... curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick...
}; };
patches = [ ./0001-change-flags.diff ];
buildInputs = buildInputs =
[ pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio ] [ p7zip pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio gtk gtksourceview ];
++ optionals (guiToolkit == "gtk") [ gtk ]
++ optionals (guiToolkit == "qt4") [ qt4 ]; unpackPhase = ''
7z x $src
sourceRoot=${sourceName}
'';
buildPhase = '' buildPhase = ''
make phoenix=${guiToolkit} profile=${profile} -C ananke make compiler=c++ profile=${profile} -C icarus
make phoenix=${guiToolkit} profile=${profile} make compiler=c++ profile=${profile}
''; '';
installPhase = '' installPhase = ''
install -dm 755 $out/share/applications $out/share/pixmaps $out/share/higan/Video\ Shaders $out/bin $out/lib 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
install -m 644 data/higan.desktop $out/share/applications/ install -m 644 data/higan.desktop $out/share/applications/
install -m 644 data/higan.png $out/share/pixmaps/ 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' 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 = '' fixupPhase = ''
oldRPath=$(patchelf --print-rpath $out/bin/higan)
patchelf --set-rpath $oldRPath:$out/lib $out/bin/higan
# A dirty workaround, suggested by @cpages: # A dirty workaround, suggested by @cpages:
# we create a first-run script to populate # we create a first-run script to populate
# the local $HOME with all the auxiliary # the local $HOME with all the auxiliary
@ -67,6 +62,7 @@ stdenv.mkDerivation rec {
''; '';
meta = { meta = {
version = "095";
description = "An open-source, cycle-accurate Nintendo multi-system emulator"; description = "An open-source, cycle-accurate Nintendo multi-system emulator";
longDescription = '' longDescription = ''
Higan (formerly bsnes) is a Nintendo multi-system emulator. Higan (formerly bsnes) is a Nintendo multi-system emulator.

View File

@ -15777,8 +15777,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 = config.higan.profile or "performance"; inherit (gnome) gtksourceview;
guiToolkit = config.higan.guiToolkit or "gtk"; profile = config.higan.profile or "balanced";
}; };
misc = callPackage ../misc/misc.nix { }; misc = callPackage ../misc/misc.nix { };