summary refs log tree commit diff
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2023-07-10 11:41:50 +0200
committerOPNA2608 <christoph.neidahl@gmail.com>2023-07-10 11:42:07 +0200
commit076f6c0945f07fd71c8fdfb7eda342de4602173e (patch)
treee999d246d56f6d2c993cf53da52c3b2772ce0eaf
parent41b8228d5dee849528a451d892f4fb4312b87fab (diff)
downloadnixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar.gz
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar.bz2
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar.lz
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar.xz
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.tar.zst
nixpkgs-076f6c0945f07fd71c8fdfb7eda342de4602173e.zip
easyrpg-player: 0.7.0 -> 0.8, enable on Darwin
-rw-r--r--pkgs/games/easyrpg-player/default.nix112
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 98 insertions, 18 deletions
diff --git a/pkgs/games/easyrpg-player/default.nix b/pkgs/games/easyrpg-player/default.nix
index c95ca576eca..ea68c3a110e 100644
--- a/pkgs/games/easyrpg-player/default.nix
+++ b/pkgs/games/easyrpg-player/default.nix
@@ -1,23 +1,71 @@
-{ lib, stdenv, fetchFromGitHub, cmake, doxygen ? null, pkg-config
-, freetype ? null, fmt, glib, harfbuzz ? null
-, liblcf, libpng, libsndfile ? null, libvorbis ? null, libxmp ? null
-, libXcursor, libXext, libXi, libXinerama, libXrandr, libXScrnSaver, libXxf86vm
-, mpg123 ? null, opusfile ? null, pcre, pixman, SDL2, speexdsp ? null, wildmidi ? null, zlib
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, doxygen
+, pkg-config
+, freetype
+, fmt
+, glib
+, harfbuzz
+, liblcf
+, libpng
+, libsndfile
+, libvorbis
+, libxmp
+, libXcursor
+, libXext
+, libXi
+, libXinerama
+, libXrandr
+, libXScrnSaver
+, libXxf86vm
+, mpg123
+, opusfile
+, pcre
+, pixman
+, SDL2
+, speexdsp
+, wildmidi
+, zlib
 , libdecor
+, alsa-lib
+, asciidoctor
+, Foundation
+, AudioUnit
+, AudioToolbox
 }:
 
 stdenv.mkDerivation rec {
   pname = "easyrpg-player";
-  version = "0.7.0";
+  version = "0.8";
 
   src = fetchFromGitHub {
     owner = "EasyRPG";
     repo = "Player";
     rev = version;
-    sha256 = "049bj3jg3ldi3n11nx8xvh6pll68g7dcxz51q6z1gyyfxxws1qpj";
+    hash = "sha256-t0sa9ONVVfsiTy+us06vU2bMa4QmmQeYxU395g0WS6w=";
   };
 
-  nativeBuildInputs = [ cmake doxygen pkg-config ];
+  patches = [
+    # Fixed compatibility with fmt > 9
+    # Remove when version > 0.8
+    (fetchpatch {
+      name = "0001-Fix-building-with-fmtlib-10.patch";
+      url = "https://github.com/EasyRPG/Player/commit/ab6286f6d01bada649ea52d1f0881dde7db7e0cf.patch";
+      hash = "sha256-GdSdVFEG1OJCdf2ZIzTP+hSrz+ddhTMBvOPjvYQHy54=";
+    })
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    asciidoctor
+    cmake
+    doxygen
+    pkg-config
+  ];
 
   buildInputs = [
     fmt
@@ -29,29 +77,59 @@ stdenv.mkDerivation rec {
     libsndfile
     libvorbis
     libxmp
-    libXcursor
-    libXext
-    libXi
-    libXinerama
-    libXrandr
-    libXScrnSaver
-    libXxf86vm
     mpg123
     opusfile
     pcre
     pixman
     SDL2
     speexdsp
-    wildmidi
     zlib
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
+    alsa-lib
+    libXcursor
+    libXext
+    libXi
+    libXinerama
+    libXrandr
+    libXScrnSaver
+    libXxf86vm
     libdecor
+    wildmidi # until packaged on Darwin
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    Foundation
+    AudioUnit
+    AudioToolbox
   ];
 
+  cmakeFlags = [
+    "-DPLAYER_ENABLE_TESTS=${lib.boolToString doCheck}"
+  ];
+
+  makeFlags = [
+    "all"
+    "man"
+  ];
+
+  buildFlags = lib.optionals doCheck [
+    "test_runner_player"
+  ];
+
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    mkdir $out/bin
+    mv Package $out/Applications
+    ln -s $out/{Applications/EasyRPG\ Player.app/Contents/MacOS,bin}/EasyRPG\ Player
+  '';
+
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+
+  enableParallelChecking = true;
+
   meta = with lib; {
     description = "RPG Maker 2000/2003 and EasyRPG games interpreter";
     homepage = "https://easyrpg.org/";
     license = licenses.gpl3;
     maintainers = with maintainers; [ yana ];
-    platforms = platforms.linux;
+    platforms = platforms.all;
+    mainProgram = lib.optionalString stdenv.hostPlatform.isDarwin "EasyRPG Player";
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 146c63597b6..47f7a3c9399 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -36986,7 +36986,9 @@ with pkgs;
     d1x-rebirth-full
     d2x-rebirth-full;
 
-  easyrpg-player = callPackage ../games/easyrpg-player { };
+  easyrpg-player = callPackage ../games/easyrpg-player {
+    inherit (darwin.apple_sdk.frameworks) Foundation AudioUnit AudioToolbox;
+  };
 
   eboard = callPackage ../games/eboard { };