about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@gmail.com>2015-12-12 14:23:56 -0200
committerAndersonTorres <torres.anderson.85@gmail.com>2015-12-18 07:45:04 -0200
commit7070c2d9008f8f637d25f9da2f4fd129a8619f5e (patch)
tree3d9b762ef74ed0de33378aa924bf2b0aa1b1c0b3 /pkgs/misc
parent12b64621fdef0e777e6cfe5b87f6840d63785cf9 (diff)
Higan: 094 -> 095
In order to increase portability and flexibility, now the build phase
explicitly sets "compiler=c++" as a make parameter.
Further, there is a link "higan" for backwards compatibility; higan was
split in icarus (the game ROMS database manager) and tomoko (the
emulator itself).
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/emulators/higan/0001-change-flags.diff35
-rw-r--r--pkgs/misc/emulators/higan/default.nix52
2 files changed, 59 insertions, 28 deletions
diff --git a/pkgs/misc/emulators/higan/0001-change-flags.diff b/pkgs/misc/emulators/higan/0001-change-flags.diff
new file mode 100644
index 0000000000000..78f4a248c5fda
--- /dev/null
+++ b/pkgs/misc/emulators/higan/0001-change-flags.diff
@@ -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)
diff --git a/pkgs/misc/emulators/higan/default.nix b/pkgs/misc/emulators/higan/default.nix
index 95793de98845f..080805e9df565 100644
--- a/pkgs/misc/emulators/higan/default.nix
+++ b/pkgs/misc/emulators/higan/default.nix
@@ -1,56 +1,51 @@
 { stdenv, fetchurl
-, pkgconfig
+, p7zip, pkgconfig
 , libX11, libXv
 , udev
 , mesa, SDL
 , libao, openal, libpulseaudio
-, profile ? "performance" # Options: accuracy, balanced, performance
-, guiToolkit ? "gtk" # can be gtk or qt4
-, gtk ? null, qt4 ? null }:
-
-assert guiToolkit == "gtk" || guiToolkit == "qt4";
-assert (guiToolkit == "gtk" -> gtk != null) || (guiToolkit == "qt4" -> qt4 != null);
+, gtk, gtksourceview
+, profile ? "balanced" # Options: accuracy, balanced, performance
+}:
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
 
-  name = "higan-${version}";
-  version = "094";
-  sourceName = "higan_v${version}-source";
+  name = "higan-${meta.version}";
+  sourceName = "higan_v${meta.version}-source";
 
   src = fetchurl {
-    urls = [ "http://files.byuu.org/download/${sourceName}.tar.xz" ];
-    sha256 = "06qm271pzf3qf2labfw2lx6k0xcd89jndmn0jzmnc40cspwrs52y";
+    urls = [ "http://download.byuu.org/${sourceName}.7z" ];
+    sha256 = "0xsgyijcf4psi3mlahr5iq7vbbw3jby1if5pkhg8c5xqckpi2fj4";
     curlOpts = "--user-agent 'Mozilla/5.0'"; # the good old user-agent trick...
   };
 
+  patches = [ ./0001-change-flags.diff ];
+
   buildInputs =
-  [ pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio ]
-  ++ optionals (guiToolkit == "gtk") [ gtk ]
-  ++ optionals (guiToolkit == "qt4") [ qt4 ];
+  [ p7zip pkgconfig libX11 libXv udev mesa SDL libao openal libpulseaudio gtk gtksourceview ];
+
+  unpackPhase = ''
+    7z x $src
+    sourceRoot=${sourceName}
+  '';
 
   buildPhase = ''
-    make phoenix=${guiToolkit} profile=${profile} -C ananke
-    make phoenix=${guiToolkit} profile=${profile}
+    make compiler=c++ profile=${profile} -C icarus
+    make compiler=c++ profile=${profile}
   '';
 
   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.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)
+    cp -dr --no-preserve='ownership' profile/* data/cheats.bml $out/share/higan/
   '';
 
   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
@@ -67,6 +62,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
+    version = "095";
     description = "An open-source, cycle-accurate Nintendo multi-system emulator";
     longDescription = ''
       Higan (formerly bsnes) is a Nintendo multi-system emulator.