summary refs log tree commit diff
diff options
context:
space:
mode:
authorPascal Wittmann <PascalWittmann@gmx.net>2015-12-19 17:37:41 +0100
committerPascal Wittmann <PascalWittmann@gmx.net>2015-12-19 17:37:41 +0100
commite0027501f1e93aedb898d68f74ccf79f9797c785 (patch)
tree2979140704f83cd715bfce88e0f81036a9932606
parent6f4850fbe7811758686c564bc18ec46fc513455f (diff)
parent7070c2d9008f8f637d25f9da2f4fd129a8619f5e (diff)
downloadnixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar.gz
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar.bz2
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar.lz
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar.xz
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.tar.zst
nixlib-e0027501f1e93aedb898d68f74ccf79f9797c785.zip
Merge pull request #11659 from AndersonTorres/higan
Higan: 094 -> 095
-rw-r--r--pkgs/misc/emulators/higan/0001-change-flags.diff35
-rw-r--r--pkgs/misc/emulators/higan/default.nix52
-rw-r--r--pkgs/top-level/all-packages.nix4
3 files changed, 61 insertions, 30 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 000000000000..78f4a248c5fd
--- /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 95793de98845..080805e9df56 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.
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7f1fd6b52cd2..305ed0a4735b 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -15777,8 +15777,8 @@ let
   snes9x-gtk = callPackage ../misc/emulators/snes9x-gtk { };
 
   higan = callPackage ../misc/emulators/higan {
-    profile = config.higan.profile or "performance";
-    guiToolkit = config.higan.guiToolkit or "gtk";
+    inherit (gnome) gtksourceview;
+    profile = config.higan.profile or "balanced";
   };
 
   misc = callPackage ../misc/misc.nix { };