about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix53
1 files changed, 36 insertions, 17 deletions
diff --git a/nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix b/nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix
index 44aba6d4a9e0..0b9eb51d3baf 100644
--- a/nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix
+++ b/nixpkgs/pkgs/applications/emulators/bsnes/higan/default.nix
@@ -1,8 +1,8 @@
 { lib
-, stdenv
-, fetchFromGitHub
 , SDL2
 , alsa-lib
+, darwin
+, fetchFromGitHub
 , gtk3
 , gtksourceview3
 , libGL
@@ -10,26 +10,25 @@
 , libX11
 , libXv
 , libao
+, libicns
 , libpulseaudio
 , openal
 , pkg-config
 , runtimeShell
+, stdenv
 , udev
-# Darwin dependencies
-, libicns
-, darwin
 , unstableGitUpdater
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "higan";
-  version = "115-unstable-2023-11-13";
+  version = "115-unstable-2024-02-17";
 
   src = fetchFromGitHub {
     owner = "higan-emu";
     repo = "higan";
-    rev = "993368d917cb750107390effe2cd394ba8710208";
-    hash = "sha256-D21DFLnYl2J4JhwmVmEKHhtglZWxVBrl/kOcvxJYbnA=";
+    rev = "ba4b918c0bbcc302e0d5d2ed70f2c56214d62681";
+    hash = "sha256-M8WaPrOPSRKxhYcf6ffNkDzITkCltNF9c/zl0GmfJrI=";
   };
 
   nativeBuildInputs = [
@@ -71,14 +70,34 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildPhase = ''
+  buildPhase = let
+    platform =
+      if stdenv.isLinux
+      then "linux"
+      else if stdenv.isDarwin
+      then "macos"
+      else if stdenv.isBSD
+      then "bsd"
+      else if stdenv.isWindows
+      then "windows"
+      else throw "Unknown platform for higan: ${stdenv.hostPlatform.system}";
+  in ''
     runHook preBuild
 
-    make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
-         platform=linux openmp=true hiro=gtk3 build=accuracy local=false \
-         cores="cv fc gb gba md ms msx ngp pce sfc sg ws" -C higan-ui
-    make -j $NIX_BUILD_CORES compiler=${stdenv.cc.targetPrefix}c++ \
-         platform=linux openmp=true hiro=gtk3 -C icarus
+    make -C higan-ui -j$NIX_BUILD_CORES \
+      compiler=${stdenv.cc.targetPrefix}c++ \
+      platform=${platform} \
+      openmp=true \
+      hiro=gtk3 \
+      build=accuracy \
+      local=false \
+      cores="cv fc gb gba md ms msx ngp pce sfc sg ws"
+
+    make -C icarus -j$NIX_BUILD_CORES \
+      compiler=${stdenv.cc.targetPrefix}c++ \
+      platform=${platform} \
+      openmp=true \
+      hiro=gtk3
 
     runHook postBuild
   '';
@@ -154,5 +173,5 @@ stdenv.mkDerivation rec {
     platforms = platforms.unix;
     broken = stdenv.isDarwin;
   };
-}
-# TODO: select between Qt, GTK2 and GTK3
+})
+# TODO: select between Qt and GTK3