summary refs log tree commit diff
path: root/pkgs/applications/emulators/punes
diff options
context:
space:
mode:
authorChristoph Neidahl <christoph.neidahl@gmail.com>2023-01-31 20:59:19 +0100
committerGitHub <noreply@github.com>2023-01-31 20:59:19 +0100
commit6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9 (patch)
tree8a08c18395a1cc2a07db7879fdd0e26b225e1714 /pkgs/applications/emulators/punes
parent59e9ca3ae6ecd41a1befc2222153b94e439c6231 (diff)
downloadnixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar.gz
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar.bz2
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar.lz
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar.xz
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.tar.zst
nixpkgs-6e1b43747afb6fbdc3cf6d03c0cd67a195e92fe9.zip
punes: 0.109 -> 0.110, add Qt6 variant (#209485)
Diffstat (limited to 'pkgs/applications/emulators/punes')
-rw-r--r--pkgs/applications/emulators/punes/default.nix71
1 files changed, 44 insertions, 27 deletions
diff --git a/pkgs/applications/emulators/punes/default.nix b/pkgs/applications/emulators/punes/default.nix
index b68b70c0ac4..529dce53643 100644
--- a/pkgs/applications/emulators/punes/default.nix
+++ b/pkgs/applications/emulators/punes/default.nix
@@ -1,13 +1,8 @@
-{ mkDerivation
-, stdenv
+{ stdenv
 , lib
 , fetchFromGitHub
 , fetchpatch
-, nix-update-script
-, qtbase
-, qtsvg
-, qttools
-, autoreconfHook
+, gitUpdater
 , cmake
 , pkg-config
 , ffmpeg
@@ -16,41 +11,63 @@
 , libX11
 , libXrandr
 , sndio
+, qtbase
+, qtsvg
+, qttools
+, wrapQtAppsHook
 }:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "punes";
-  version = "0.109";
+  version = "0.110";
 
   src = fetchFromGitHub {
     owner = "punesemu";
     repo = "puNES";
     rev = "v${version}";
-    sha256 = "sha256-6aRtR/d8nhzmpN9QKSZ62jye7qjfO+FpRMCXkX4Yubk=";
+    sha256 = "sha256-+hL168r40aYUjyLbWFXWk9G2srrrG1TH1gLYMliHftU=";
   };
 
-  postPatch = ''
-    substituteInPlace configure.ac \
-      --replace '`$PKG_CONFIG --variable=host_bins Qt5Core`/lrelease' '${qttools.dev}/bin/lrelease'
-  '';
-
-  nativeBuildInputs = [ autoreconfHook cmake pkg-config qttools ];
-
-  buildInputs = [ ffmpeg qtbase qtsvg libGLU ]
-    ++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libX11 libXrandr ]
-    ++ lib.optionals stdenv.hostPlatform.isBSD [ sndio ];
+  patches = [
+    # Fixes compilation on aarch64
+    # Remove when version > 0.110
+    (fetchpatch {
+      url = "https://github.com/punesemu/puNES/commit/90dd5bc90412bbd199c2716f67a24aa88b24d80f.patch";
+      hash = "sha256-/KNpTds4qjwyaTUebWWPlVXfuxVh6M4zOInxUfYztJg=";
+    })
+  ];
 
-  dontUseCmakeConfigure = true;
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    qttools
+    wrapQtAppsHook
+  ];
 
-  enableParallelBuilding = true;
+  buildInputs = [
+    ffmpeg
+    libGLU
+    qtbase
+    qtsvg
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
+    alsa-lib
+    libX11
+    libXrandr
+  ] ++ lib.optionals stdenv.hostPlatform.isBSD [
+    sndio
+  ];
 
-  configureFlags = [
-    "--prefix=${placeholder "out"}"
-    "--without-opengl-nvidia-cg"
-    "--with-ffmpeg"
+  cmakeFlags = [
+    "-DENABLE_GIT_INFO=OFF"
+    "-DENABLE_RELEASE=ON"
+    "-DENABLE_FFMPEG=ON"
+    "-DENABLE_OPENGL=ON"
+    "-DENABLE_QT6_LIBS=${if lib.versionAtLeast qtbase.version "6.0" then "ON" else "OFF"}"
   ];
 
-  passthru.updateScript = nix-update-script { };
+  passthru.updateScript = gitUpdater {
+    rev-prefix = "v";
+  };
 
   meta = with lib; {
     description = "Qt-based Nintendo Entertainment System emulator and NSF/NSFe Music Player";